Archive

Archive for the ‘Linux’ Category

mysql upgrade error – start failed

December 11th, 2012 No comments

Was upgrading today and got this:

Setting up mysql-server-5.5 (5.5.28-0ubuntu0.12.10.1) ...
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
 subprocess installed post-installation script returned error exit status 1

yay, so it can’t start for some reason..
#tail -n 20 /var/log/mysql/error.log:

121211 20:37:00 [Note] Plugin 'FEDERATED' is disabled.
121211 20:37:00 InnoDB: The InnoDB memory heap is disabled
121211 20:37:00 InnoDB: Mutexes and rw_locks use GCC atomic builtins
121211 20:37:00 InnoDB: Compressed tables use zlib 1.2.7
121211 20:37:00 InnoDB: Using Linux native AIO
121211 20:37:00 InnoDB: Initializing buffer pool, size = 128.0M
121211 20:37:00 InnoDB: Completed initialization of buffer pool
121211 20:37:00 InnoDB: highest supported file format is Barracuda.
121211 20:37:00  InnoDB: Operating system error number 22 in a file operation.
InnoDB: Error number 22 means 'Invalid argument'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/operating-system-error-codes.html
InnoDB: File name ./ib_logfile0
InnoDB: File operation call: 'aio write'.
InnoDB: Cannot continue operation.

Google says aio on tmpfs doesn’t work. I don’t want mysql to store it’s crap on my disk – it is just my desktop db and I don’t need it to be blazing fast and contribute to ssd wear.

Solution in my case is innodb_use_native_aio = 0 in my.cnf

Categories: Linux Tags: , , ,

Notify on cbr.ru rates change

June 28th, 2011 No comments

script for cron:

#!/bin/bash
TOMMOROW=$(date +"%d.%m.%Y" --date="next day")
touch /var/tmp/cbr.log # just so that it exist
curl http://cbr.ru/currency_base/D_print.aspx?date_req=01.01.2099 |\
sed 's/Курсы валют за 01.01.2099 не зарегистрированы\.//' |\
sed '/<!--/,/-->/d' |\
sed '/<script/,/<\/script>/d' > /tmp/cbr.html

if [ -z `cat /var/tmp/cbr.log | grep "$TOMMOROW"` ]
then
   if [ -n `cat /tmp/cbr.html | grep "$TOMMOROW"` ]
   then
      echo "$TOMMOROW" > /var/tmp/cbr.log
      echo "Курсы во вложении"| mutt me@example.com -s "ЦБР обновил курс!" -a /tmp/cbr.html
   fi;
fi;
Categories: Linux Tags:

zip individual files recursively

January 26th, 2011 No comments

Zip up every fb2 file in a book collection to save some space since reader can read them from zip files anyway:

find . -type f -execdir zip -m '{}'.zip '{}' \;
Categories: Linux Tags: