ssh reverse tunning..

2013-02-14 1 min read Fedora Learning Linux
If you want to access some local resources like the release website from the remote server when you are connecting to the remoter server using ssh over VPN, then possibly reverse ssh tunnelling is the best option. So, basically when you are connecting to the remote server, you tell the server your intent to do so and which local resource you want to connect to and on which port.So, here I want to connnet to google. Continue reading

phpmyadmin access problem and change server from URL

2012-09-30 1 min read Database Fedora
I was having issues with one of the phpmyadmin setups. The first server defined in the config file was not accessible and the theme that I was using was not allowing me to change the server from the first page. This resulted in a state where I was not able to access phpmyadmin in any way. I could not connect to any of the servers. And thus had to hack my way in to phpmyadmin to find out how to connect to other servers from URL. Continue reading

mysql output to an array for easy parsing.

2011-05-11 2 min read bash Database
Today I was looking for some way to put the output of the mysql output in an array in a bash script. Quick google search yeilded to results something like this: 1 <td> <div class="text codecolorer"> output=$(mysql -e "select * from table") </div> </td> </tr> The problem with the above approach is that all the words go into separate index. So if you have a line that has space then that is split into multiple index’s. Continue reading

Easy ssh configuration with .ssh/config file

2011-04-11 1 min read bash Learning Linux
If you ssh to many hosts then you are aware of the pain that it takes to ssh with different username and hostname. There is an alias that you can creat with native ssh though. Here I will show you the same with an example. 1 2 3 4 5 <td> <div class="text codecolorer"> cat <<EOF >>~/.ssh/config<br /> Host <alias><br /> Username <user name><br /> Port <port number><br /> Hostname <hostname> </div> </td> </tr> You can optionally omit the parameters that you do not require explicitly. Continue reading

Using ssmtp to send mail using gmail.

2011-02-19 1 min read Fedora Linux
First install the package ssmtp using the command: 1 <td> <div class="text codecolorer"> sudo yum install ssmtp </div> </td> </tr> Open the configuration file for ssmtp as root user: 1 <td> <div class="text codecolorer"> vim /etc/ssmtp/ssmtp.conf </div> </td> </tr> Make the following changes to the configuration file: root=**username**@gmail.com mailhub=smtp.gmail.com:587 hostname=**username**@gmail.com UseSTARTTLS=YES AuthUser=username AuthPass=password FromLineOverride=yes In order to make the default (root) “from” field be the server name, edit the /etc/ssmtp/revaliases file as root user : Continue reading