Shell

Testing of SSL connection could be easily done using openssl command. This powerful tool can check both SSL and TLS connection. Certificate chain can be also checked. It is very useful especially for testing newly installed SSL certificate.
Verification could be done using s_client command in openssl. As an example we will use www.sslshopper.com, test.rebex.net and gmail.com. Here is a list of the most common s_client command’s variations:
To test http SSL connection type:

openssl s_client -connect www.sslshopper.com:443 -CApath /etc/ssl/certs/

Continue Reading

Hello again :). Today I would like to introduce two commands that may be used to flush Postfix queue (after network failure for example).

First of them is postsuper command. Use this syntax to re-queue all waiting mails.

# postsuper -r ALL

You can type individual mail ID instead of word ALL. Next flush all mail immediately.

# postqueue -f

Now the whole mail queue is processed again.

 

Sometimes you need to get a specified column of a text but it’s really hard to choose a suitable column separator. For example we will get the second column from the following text file.

$ cat ./text.txt
abc,def-ghi
123-456-789
qaz,wsx,edc
qwe-asd,zxc

We can see two field separators: a comma and a minus sign. Fortunately awk can use regular expressions as field separator. In this case we use the following line.

$ awk -F"[-,]" '{print $2}' ./text.txt 
def
456
wsx
asd

 

The simplest way to start VM on VirtualBox is a GUI. You have to click ‘Start’ and that’s all. What if you want to control your machines from a shell script? You have to use VBoxManage tool. It offers a really huge set of commands:

VBoxManage startvm
VBoxManage list
VBoxManage showvminfo
VBoxManage controlvm
VBoxManage addiscsidisk
VBoxManage adoptstate
VBoxManage clonehd
VBoxManage closemedium
VBoxManage convertfromraw
VBoxManage createhd
VBoxManage createvm

and more. Continue Reading