Deleting lots of tiny files really really quickly
This is the second half of that magento issue. Mainly, after having got a directory with millions of files in it, you can do one of two things.
mv sessions sessions_full && mkdir sessions && chown www-data:www-data sessions
rm -rfv sessions_full
Or
find /loc/of/sessions -ctime +1 -type f -exec rm -v {} \;
bind refuses to restart, debian squeeze
After an upgrade, I’ve noticed a few times that bind has refused to restart or reload, saying:
Stopping domain name service: namedrndc: connect failed: connection refused
This seems to be a permissions bug in debian, quite a long lasting one. In order to cheat-fix it quickly, I do the following:
chown bind:root /etc/bind/rndc.key
chmod 660
/etc/init.d/bind9 restart
That seems to fix it well enough. I think it’s a problem in that bind starts as one user, but runs as another. It may be that 440 are all the perms that are necessary. The debian bug report is here: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=169577
Magento Session Files
Magento (the popular open-source online shop system) likes to store its PHP session files in ~/public_html/var/session/
Most debian servers don’t have that in their cron job that deletes old session files.
So, you probably want to set it to store it’s session files in the default location (/var/lib/php5) or alter your cron job (/etc/cron.d/php5)
Fun!
Invalid method in request \x16\x03\x01
So, ran into this one. Firefox is throwing this error, along with ‘SSL_ERROR_RX_RECORD_TOO_LONG’. Turns out, apache was serving plain HTTP on port 443, as it hadn’t been given a default SSL config.
Other causes may be: Corrupted SSL cert (rare). Mis-configured proxy. Not adding “SSLEngine On” after configuring an SSL cert. But mostly, you’re trying to talk HTTPS to an HTTP serving webserver.
`a2ensite default-ssl` (on debian) fixed it. Well, fixed in in that the default server now has a snake-oil self-signed cert, but, you know, fixed it.
Possible missing firmware on debian squeeze
If you get these errors:
W: Possible missing firmware /lib/firmware/rtl_nic/rtl8105e-1.fw for module r8169 W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168e-2.fw for module r8169 W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168e-1.fw for module r8169 W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168d-2.fw for module r8169 W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168d-1.fw for module r8169
Do this as root (or using sudo):
# aptitude install firmware-realtek
Win!
Eaccelerator mirror / downloads
Eaccelerator is insanely useful in my line of work. However, their main downloads are down right now, so I’m mirroring the latest version here:
http://kirrus.co.uk/stuff/eaccelerator-0.9.6.1.tar.bz2
http://kirrus.co.uk/stuff/eaccelerator-0.9.6.1.zip
You can see the files sha1sums here: https://eaccelerator.net/wiki/Release-0.9.6.1
Alternatively, if you’re scripting (we are), you can use the following to get my (‘up-to-date’) version:
http://kirrus.co.uk/stuff/eaccelerator-latest.tar.bz2
bz2.. because that’s the version we use here
Linux Beep Music
Just a silly short post about a beep song i was making while waiting for a partition resize to go through.
This should run on pretty much any linux system, just copy and paste
beep -f 1000 -n -f 1500 -n -f 600 -n -f 500 -n -f 100 -r 2 -l 10 -n -f 50 -r 2 -l 200 -n -f 40 -r 2 -l 300 -n -f 60 -r 3 -n -f 50 -r 3
Thanks gparted and Sytem Rescue Cd (Linux)
Please continue my little ditty in the comments!
Ps modern computers may need speakers plugged in and on to make the magic happen, but shouldn’t need sound drivers.
Enjoy!
Help firefox wget and ssh shell script
I’m trying to create a script to allow me to command a remote server to download a file from firefox.
There are various reasons for this, mainly todo with connection speed.
What I have at the moment is:
#/bin/sh
terminator -x ssh user@site.com wget -qc -t 3 -o ~/wget_testlog ftp://anothersite.com/file.ext \\& \& &
I want it to kick off, ask for a password to login via ssh and then go away…
I would like to be able to set the location for the download to ~/www/files/
I was planning to place this script in /usr/bin and install it in firefox using the code/link provided on this blog: Wget from firefox
Can anyone complete my solution with the correct syntax, or provide a better solution (preferably KISS)?
I’m more of hacker than an expert IMO and I know when I’m out of my depth!
Cheers,
Garreth
Network Monitoring
I’ve been searching for some simple tools to monitor my internet connection for some time, and finally I’ve found a few tools that do the trick.
If you’re looking for a console application to give you a quick heads up on the transfer speeds across a network interface have a look for ifstatus (not to be confused with the ifplugd suite) .
If you’re looking for something to log and display network statistics checkout vnStat
Minor niggle: both these programs needed compiling and required additional dependencies which I recall were GD, for the graph creator of vnStat (vnstati) and curl for the console interface of ifstatus.
If you have any other suggestions, queries or points, please leave a comment!
Karmic notebook Theme
Finally got around to upgrading to Karmic Ubuntu, and so far Its looking good. There is a few oddities in the theme, which makes using it a bit annoying, but I guess I’ll get used to it. See the screen-shot below for what I mean, the strangeness of the interface The bar at the top, the new greying out an in of active icons all help to make the best use of this screen size. You can tell the design team are doing good work
One small problem, is the lack of a clock, or logout button. For some strange reason, both didn’t make it, and hitting the power button no longer brings up the shutdown interface. I’ve been using the command ‘shutdown -h now’ in a terminal for the moment, will have to dig around, see why it isn’t there/coming up later.



