Archive for 2008

Remote login to a Solaris 10 box

Wednesday, March 12th, 2008

Xnest is a nested X server that I use in some cases to remotely access my Solaris 10 boxes. From Xnest man pages:

Xnest is a client and a server. Xnest is a client of the real server which manages windows and graphics requests on its behalf. Xnest is a server to its own clients. Xnest manages windows and graphics requests on their behalf. To these clients Xnest appears to be a conventional server.

I’ve installed X11 on my MacBook and now I can log into my server:

Xnest -query solaris_host01 :2 &

If you get an error like this:

Not on system console, root login rejected

Edit /etc/default/login and comment out the following line.

# CONSOLE=/dev/console

Be very carefull with this for the security implications. That’s all.

Serial terminal support in GRUB

Saturday, February 9th, 2008

In some situations it is very useful to have the possibility to access the GRUB boot menu from a serial line. For example you could remotely reboot your machine with the new kernel you just compiled.

In my case I have a couple of remote machines linked together by a serial cable. I can log into machine A via ssh and get the Grub menu of machine B through minicom. Thus I can boot whatever OS/kernel I want as if I were in front of the machine. Kind of KVM IP for the rest of us.

Simply add this to Grub’s menu.lst:

serial –unit=0 –speed=9600 –word=8 –parity=no –stop=1
terminal serial

Debian apt-file

Sunday, January 27th, 2008

According to man pages:

apt-file is a command line tool for searching packages for the APT packaging system.

So let’s proceed:

apt-get install apt-file

apt-file update

The first command will install apt-file and the second command will fetch the content of the packages from the repositories specified in /etc/apt/sources.list and will resynchronize the contents from the sources.

Now give it a try:

apt-file -v search /usr/sbin/postfix

D: got ‘deb http://192.168.1.2:9999/debian/ etch main contrib non-free’
D: kept ‘deb http://192.168.1.2:9999/debian/ etch main contrib non-free’
D: regexp: ^(.*?usr/sbin/postfix[^s]*)s+(S+)s*$
D: Search in /var/cache/apt/apt-file/192.168.1 .2_debian_dists_etch_Contents-i386.gz

postfix: usr/sbin/postfix
postfix-policyd: usr/sbin/postfix-policyd
postfix-policyd: usr/sbin/postfix-policyd-cleanup

Note that you can get similar information by typing this:

dpkg -S /usr/sbin/postfix

postfix: /usr/sbin/postfix

The difference, however, is that apt-file provides information even if the package is not installed or was uninstalled.

MySQL quick backup

Sunday, January 27th, 2008

This trick will show you how to quickly perform a MySQL backup. So let’s dump all the contents of your databases and compress them to be more portable.

mysqldump -u root -p –all-databases | gzip > myDatabases.sql.gz

If you now want to dump this data to another server, simply type:

gunzip < myDatabases.sql.gz | mysql -u root -p

Reference:

Mysqldump manual

Sun Microsystems acquires MySQL AB

Wednesday, January 16th, 2008

From Sun Microsystems web site:

Sun announced an agreement to acquire MySQL AB, an open source icon and developer of one of the world’s fastest growing open source databases. This acquisition accelerates Sun’s position in enterprise IT to now include the $15 billion database market and reaffirms Sun’s position as the leading provider of platforms for the Web economy and its role as the largest commercial open source contributor.

More information from Sun Microsystems, Cnet and MySQL web site.