utorok 25. októbra 2011

ID3 v2.4 tags

It all started when I found out my xmms2 did not read ID3 tags of some of my files properly. I use kid3 to create and modify the ID3 tags of my music collection and it was reading them all OK, so I started investigating. The first clue was this bug in id3v2 which did not read the ID3 tags as well, so I recompiled the latest sources but still no cigar. I learned id3v2 is using id3lib to parse tags and I found this bug. So I changed the ID3V2_LATEST = ID3V2_3_0 to ID3V2_LATEST = ID3V2_4_0 and it all started working. The question is why is this not enabled by default.

pondelok 1. augusta 2011

Machine Cycle: SSH and DBUS Sessions

Machine Cycle: SSH and DBUS Sessions

Get rid of w00tw00t

Ever since I installed Apache on my server, I noticed annoying w00tw00t requests in the access log. At first I created fail2ban rule to block the IPs that originated the requests, but of course this is quite useless, since the requests come from different IPs and only repeat from the same IP after a few days.
So I found out the best solution to be blocking it at iptables level.

štvrtok 28. júla 2011

Munin/rrdtool spike removal

Occasionally I see spikes on my network card charts. I found this article which says how to remove them and basically it shows how to convert the rrd file to xml and vice versa, so it's worth remembering.
cd /var/lib/munin/HOSTNAME
# To export rrd file to xml, use
rrdtool dump file.rrd > file.rrd.xml

# Move the rrd file to backup
mv file.rrd file.rrd.bak

# To convert from xml to rrd, use:
rrdtool restore -r file.rrd.xml file.rrd

# In case running under different user (e.g. root), don't forget to change back the ownership of rrd files:
chown munin:munin file.rrd

# To regenerate graphs, run as munin:
/usr/share/munin/munin-graph --nolazy --host $HOSTNAME --force

piatok 1. júla 2011

mycal2rem

I was using ical2rem.pl to pull data off my Google calendar and display it in wyrd, which I'm using on my laptop. After a while I found a few shortcomings:
- the parsing of the .ics file from Google took about 25 seconds (on my Intel CoreII Duo T7100) during which the CPU was fully utilized
- the script does not use the features of remind format, e.g. the repeating events are created as multiple entries in the remind file

The mycal2rem.pl is far from full implementation of the .ics format (RFC 5545), but currently it parses all events from my calendar just fine.

The script can be found at github.

pondelok 20. júna 2011

fail2ban

I am quite happy user of denyhosts for my server.
However, I started to look for a solution that is able to block access to other services as well. And I discovered fail2ban.
I am using it to block access to my ssh server and also my apache server, because there is a few queries for the phpmyadmin etc.
There were a few issues with stock fail2ban, namely What are fail2ban's log iptables “returned NNN” entries? (Fail2ban is failing to ban) and fail2ban startup iptables error.
Another problem is that the banned IPs are lost on fail2ban restart. I managed to fix that somehow bu exporting the list of banned IPs on service stop and importing it back again on service start. I even posted the way to export banned IPs to the wiki

#!/bin/sh
jails=$(fail2ban-client status | grep Jail\ list: | sed 's/.*Jail list:\t\+//;s/,//g')
for jail in ${jails}; do
for ip in $(fail2ban-client status ${jail}|grep IP\ list|sed 's/.*IP list:\t//'); do
echo "fail2ban-client set ${jail} banip ${ip}"
done
done

So far it works fine for me.

utorok 10. mája 2011

Converting AVCHD Videos (part 2)

Recently I tried to use ffmpeg to convert AVCHD to mp4. However I experienced sound issues and I discovered the default audio bitrate was used (64k). I needed to enhance the command to:
ffmpeg -i $1 -sameq -ab 192000 -f mp4 $1.mp4

This is on Ubuntu 11.04 x86_64.

utorok 15. februára 2011

Dropbox

I wanted to start using my Ubuntu One on my Debian server. Instead I tried out Dropbox. The installation is straightforward, I followed this guide. I needed to update the init.d script a little (I even updated the wiki @ Dropbox site).
I plan to use my account to store backups of my SVN repository, it's very small at the moment so the free 2GB quota should be enough for me. I will create a script that will compress, encrypt and store the SVN repo to Dropbox.

nedeľa 6. februára 2011

Update to Squeeze

Just updated to Squeeze. No issues so far, only munin got relocated from /var/cache/munin/www to /var/www/munin .

utorok 25. januára 2011

chmod recursion -- files only

chmod recursion -- files only
A great thread! Learned something new today again.

streda 19. januára 2011

SFTP on Ubuntu/Debian

I reused this article again, so it's worth bookmarking.
SFTP on Ubuntu and Debian in 9 easy steps

utorok 11. januára 2011

piatok 7. januára 2011

Atom - software

A brief followup on the software installed on my Atom PC.
I already mentioned Munin, a great monitoring software, very easy to setup. Even though there is quite a few plugins available in the Debian Lenny package, I have added and/or modified some (openssh, apache_accesses - with added SSL support, enabled graphing for apt).
Ever since I started sshd on port 22, I noticed some password guessing attacks, mostly for root, but also for oracle, guest, test, support, squid, svn. I tried to limit the number of connections via iptables as described here and here. Currently I am testing denyhosts.
I have also installed Apache2 with SSL, subversion, WebSVN (I originally wanted to use Insurrection but failed to configure it).