Click here

Sunday, January 23, 2022

Omicron - people gathers in crowd

Amidst omicron thread, people are gathered in crowd at markets and public places to buy their daily needs. Because of full lockdown at Sunday in Tamilnadu, people are standing in queues to buy fish and meat. 



Wednesday, December 16, 2020

org.gnome.Terminal: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.gnome.Terminal exited with status 9

 I have tried multiple options of setting locale to en.US.utf8 to solve the problem. But, it did not help out. Looks like something has corrupted in my server. I tried running vncserver as a root to solve the problem. If you get any error on running vncserver as a root, you need to execute this command "vncpasswd". Hope this post helps.

Sunday, April 26, 2020

Coronavirus - 3 days complete curfew announcement defeats the purpose of social distancing

After the recent announcement from Tamil Nadu CM E. Palanisamy about 3 days complete shutdown, people have gathered in masses at markets, shops and bakeries which defeats the whole purpose of social distancing and lockdown which had been done so far. I wouldn't blame government fully on this. I can say, people is not serious about Coronavirus. They think, if they all the basic needs stocked they don't need to go out but it should not come at the cost of breaking social distancing. Such a pathetic situation after koyambedu bus station incident.

Tuesday, October 2, 2018

Import private key and certificate into java keystore


From time to time you have to update your SSL keys and certificates. In some cases you may have a mixed infrastructure e.g. "normal" http servers and tomcat or other java based servers. In the latter case you'll have to import your shiny new certificate and key into your java keystore.
There are several methods that you can use but I found the following the most simple:
  1. Export your key, certificate and ca-certificate into a PKCS12 bundle via
    COPY
    % openssl pkcs12 -export -in my.crt -inkey my.key -chain -CAfile my-ca-file.crt -name "my-domain.com" -out my.p12
  2. Be sure to set an export password! (see further below for an explanation)
  3. If you get the following error message "Error unable to get issuer certificate getting chain." then you should concatenate the openssl ca-certs with your own ca-cert into one file and use that as parameter for -CAfile. Example:
    COPY
    % cat /etc/ssl/cert.pem my-ca-file.crt > ca-certs.pem % openssl pkcs12 -export -in my.crt -inkey my.key -chain -CAfile ca-certs.pem -name "my-domain.com" -out my.p12
  4. Import the PKCS12 file into a new java keystore via
    COPY
    % keytool -importkeystore -deststorepass MY-KEYSTORE-PASS -destkeystore my-keystore.jks -srckeystore my.p12 -srcstoretype PKCS12
Attention!
If you don't set an export password in the first step the import via keytool will most likely bail out with an NullPointerException.

Wednesday, September 19, 2018

Python - List comprehension

List comprehensions are a tool for transforming one list (any iterable actually) into another list. During this transformation, elements can be conditionally included in the new list and each element can be transformed as needed.

The basic syntax is
[ expression for item in list if conditional ]

This is equivalent to:

for item in list:
    if conditional:
        expression

Example
1)
x = 1
y = 1
z = 1

lis = []
lis = [ [i,j,k] for i in range(x+1) for j in range(y+1) for k in range(z+1) if (i+j+k) != N]
print lis

Output
[[0, 0, 0], [0, 0, 1], [0, 1, 0], [1, 0, 0], [1, 1, 1]]

Above is the nested for loop
2)
x = [i for i in range(10)]
print x

This will give the output:
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

Thursday, September 13, 2018

Python - Print without newline and space


In python , by default print inserts newline character at the end of an output

For example:



Output
1
2

1) To ignore the new line at the end of an output, you can do it multiple ways

In python 2.x



Output
1 2

2) To ignore the space in between



Output
12

Using backspace character replaces the space in between. Comma at the end replaces the newline character with an empty string.  If you use + operator , both the operators has to be in string format

3) To print without using string



Output
12

Comma at the end replaces the new line character. Printing an empty string suppresses the space in between

4) Python 3.x has an easy way of doing this



Using end statement, replaces the end terminator with an empty string.

print('a', 'b', 'c', sep='')
to suppress the white space separator between items.





Friday, April 20, 2018

ldconfig , to set library path in linux

LDCONFIG
( Where are the Libs ? )


Sometimes when you install a program from source it can complain that a certain library is missing . . . and still you know that the lib it is complaining about is actually installed on your system. But most likely it is not on the default place ( /usr/lib ) where the program looks for the lib.

There is a file on your system where all the paths to the libraries are mentioned: the /etc/ld.so.conf file. Here is an example of the /etc/ld.so.conf file on Slackware:
 
QUOTE
/usr/local/lib
/usr/X11R6/lib
/usr/i486-slackware-linux/lib
/usr/lib
/opt/kde/lib


So, what's the solution ?

1). First locate the lib the program is complaining about, maybe it is in /usr/lib/qt/lib or in /usr/include or any other odd location.

2). Next add the path to that lib in the /etc/ld.so.conf file. So, for our example the /etc/ld.so.conf file would look like:
 
QUOTE
/usr/local/lib
/usr/X11R6/lib
/usr/i486-slackware-linux/lib
/usr/lib
/opt/kde/lib
/usr/lib/qt/lib
/usr/include

3). Finally to let the system know that you updated the /etc/ld.so.conf file and make it use the new values give the command:
CODE
# ldconfig

Omicron - people gathers in crowd

Amidst omicron thread, people are gathered in crowd at markets and public places to buy their daily needs. Because of full lockdown at Sunda...