Killing a mass of queries from MySQL

mysql

to kill a whole bunch of mysql queries in one go, I used something like this that you can adapt for your own use:

select concat('KILL ',id,';') from information_schema.processlist where Host like 'some-sexy-server-ws%';
select concat('KILL ',id,';') from information_schema.processlist where Host like 'some-sexy-server-ws%' into outfile '/tmp/a.txt';
source /tmp/a.txt

CUPS / Samba / Wireless Printing randomly stops working on Ubuntu

CUPS, linux, samba

I’ve setup a CUPS (Common Unix Printing System) wireless printer sharing in our office, and occasionally the wireless printing randomly stops working. In addition, Samba also stops for file sharing. This kind of behaviour is normally coupled with the LAN/Wireless connection dropping, so you cannot even SSH into the machine itself.

There is no need to restart the computer, just restart the network-manager from the machine itself.

sudo service network-manager restart

mysql install from a binary distro

mysql

Installing mySQL from a binary is very simple. Download the binary to your server.

tar zxvf mysql-binary.tar.gz
cd mysql-binary
mkdir /mysql/partition/here
./configure --prefix==/mysql/partition/here
make
make install

Alternatively, even easier:

tar zxvf mysql-binary.tar.gz
cd /mysql/partition/here
chown -R mysql .
chgrp -R mysql .
scripts/mysql_install_db --user=mysql;
cd .;
./bin/mysqladmin -uroot -pSoMePasSwOrdHeRe