Archive | linux RSS feed for this section

Setting up SnomONE PBX on Centos 5.5

I’ve been looking at the new SnomONE PBX tonight, and have set up a test installation on a virtual machine. I couldn’t see any instructions in their manual for installing on Linux, so I thought I’d blog about the steps I took as it might help someone else! 1. Install Centos 5.5 x86_64 system. 2. [...]

Read full story Comments { 1 }

Trixbox blue screen after probing video card

I was experiencing an error during an installation of Trixbox 2.6.2.2 whereby it would lock up with a blue screen after the keyboard language selection / probing video card steps. Initially I thought it was a faulty CD, but after burning 3 copies with 2 computers, I would get the same problem every time. This [...]

Read full story Comments { 0 }

Creating a Virtual Host with Webmin

These instructions apply to Webmin version 1.450 Create a folder where you wish to store your sites files.  You can do this in the Others > File Manager section.  We typically use something like: /sites/domainname.com/http/ Setup the vhost. Click on Servers > Apache Web Server in the left hand menu. Click the “create virtual host” [...]

Read full story Comments { 14 }

A script to reset the MySQL root password

It’s a pain if you ever forget your MySQL root password. Fortunately it’s a fairly straightforward process to reset it, here’s how: pkill -9 mysqld; echo "UPDATE mysql.user SET Password=PASSWORD(‘MyNewPass’) WHERE User=’root’; FLUSH PRIVILEGES;" > /tmp/reset-pass.sql mysqld_safe –init-file=/tmp/reset-pass.sql & sleep 10 pkill -9 mysqld; A bash script to reset the mysql root password To make [...]

Read full story Comments { 5 }

Spam score an e-mail from the command line

To test the spam score for an e-mail without sending it, install a copy of Spam Assassin then run: [root@mail ~]# spamc -c < testemail.txt -1.0/5.0 Where testemail.txt is the raw message source.

Read full story Comments { 0 }

Running mysqldump via ssh (direct host to host copy)

In order to run a mysqldump from one host to another over SSH you can run: mysqldump dbname | ssh root@remotehost.com “mysql -D dbname” This will pipe the output of mysqldump directly to the ssh connection which is running MySQL at the other end and receiving the mysqldump from standard input.

Read full story Comments { 2 }

Generating a Certificate Signing Request

When applying for a secure certificate you will need to generate a certificate signing request (CSR). If you are renewing an existing certificate you might want to keep your existing private key, if it’s a new certificate then you will probably need to create a new private key. If you have previously registered a secure [...]

Read full story Comments { 0 }

When sudo echo ‘test’ > /root/test gives permission denied

If you get a permission denied error when trying to redirect the output of a sudo command then the reason for this is normally because the superuser permissions only apply to the first part of the statement, e.g. the echo command. They do not carry through to the bash redirection. paul@backups:~$ sudo echo ‘test’ >> [...]

Read full story Comments { 7 }

rtorrent: Error in option file

My bit torrent client of choice is rtorrent, which runs from the command line. I have been using it without problems for months, but today it stopped working and gave an error instead: rtorrent: Error in option file: ~/.rtorrent.rc:4: Not a value It seems that the rtorrent developers have made some changes to the way [...]

Read full story Comments { 0 }

Killing Processes

Previously if I had wanted to kill a bulk list of mysql processes I would have done something like: ps auxww | grep ^mysql | awk ‘{print $2}’ | xarg kill -9 Today I discovered two really handy commands that make listing and killing processes a lot easier, pkill and pgrep. You can achieve the [...]

Read full story Comments { 1 }