Entries Tagged 'Linux' ↓

XBMC….

xbmc_410In reply to my last article about media centers.
Well, I installed xbmc this weekend and actually it kinda sucked. Installation was a breeze: kudos for that. But when I ran it, it hogged all of the cpu time of the second core. 100% constantly.

I’ve got an Ati hd3200 integrated on the motherboard and in combination with XBMC I believe that’s a bad choice. I’ve read numerous threads about people having the same problem as me :( I’m quite upset with this. I don’t blame the XBMC developers, they do a fabulous job, but still it sucks.

I hope that in the next couple of weeks this problem is solved but I don’t think it will. I’m now looking for an alternative but XBMC just looks so polished…. It’s too bad it’s not usable for me :cry:

I’m now downloading the live cd of XBMC and see if that works ’cause I dont know who to blame: me, ati, xbmc or ubuntu…

Root crontabs/cronjobs not executing or running

Well as the title says: the cronjobs of the root user didn’t run on one of my servers (MY MACHINE!) and it took a while to figure out why they weren’t running. It ended up to be something with locking the root account. These steps fixed the problem:

sudo passwd -l root
sudo usermod -p ! root

fixing a hacked site

One of our Joomla! sites was “hacked” with some stupid script and the fuckers put a iframe in every page :(

But with sed that was fixed in a matter of seconds:

find . -type f -print |xargs sed -i 's/<iframe.*iqdoza.ru.*<\/iframe>//g'

OR:

find . -type f -print |xargs sed -i 's/<iframe.*.ru.*<\/iframe>//g'

Searching for hacked sites:

egrep -lir "<iframe|hacked" /home/*/public_html/*index*

Drawback is that it doesn’t removed the inserted newline :S Because it isn’t the design of sed (wha-evah).
Also it doesn’t handle files with spaces in the filename. But that’s only minor because in my case I didn’t have any php or html files with spaces in them :)

script-kiddie

python libindicate

I saw that there are python bindings for libindicate. They’re called “python-indicate“.

There’s also a wiki about this new feature from Ubuntu. I thought about creating a plugin for weechat that uses this library. Especially because the notify-plugins is useless if you’re away and somebody mentions you on irc. Libindicate would be perfect for this. First have to find out how the behaviour of the applet would be.

[update]
I asked my question on the libindicate launchpad so I’m very curious about the answer(s).
[/update]

messaging-menu-karmic ubuntu 9.10 libindicate

Weechat 0.3.0 on Ubuntu 9.10

Ubuntu 9.10 comes with an older version of weechat. So I downloaded the stable release 0.3.0 and installed it:

./configure --prefix=/home/leon/Software/local/ --enable-gtk --enable-demo
make
make install

Note: gtk is not very usable so you better use the ncurses interface!

I wrote a little plugin for it that autosaves the current connected channels and enables autojoin for them. It can be found on my github page and on the plugins page of weechat (if FlashCode aprobes the new version 0.2).

And here a nice plugin of weechat in action with the autojoin plugin (Nice!!):

Screenshot of weechat in action

Choosing a new editor: Emacs vs. Vim

For php I use Zend Studio for Linux. We have a license at work for it and it is in my opinion the best editor for php. It’s relatively fast and you can use it to quickfix php over an ftp connection.

For Ruby I use netbeans. I would also like to use it for php but it doesn’t allow to quicly open a file via ftp/scp or whatever. And it can sometimes be sloooooowwww. I’ve  seen netbeans used on a Windows platform and there it is much faster.

When I right-click on a project in netbeans for the first time, it takes 5 seconds (not lying!) to render the popup-menu. Come onm take forever!

And because I was now developing with Python I decided to try a new editor. Something more hardcore and lighter. Something nerdy :) So ofcourse I only have two decent options: Vim & Emacs.

I already had try them with Ruby. But I found good Ruby (& Rails) support rather lacking by both of them. I believe that the python comminity is more hardcore and therefore are using more arcane editors :) And maybe because they aren’t afraid to hack away in another language than their own (lisp, vimscript).

I think I have been comparing the two editors for nearly two weeks now. I have spent hours and hours comparing, trying and browsing for blog posts about the two. At the end, I really didn’t know which one to choose. I really suck at deciding something :) So I made a little list of what I find to be strong points of each editor:

VIM:

  • Better syntax highlighting/theming supprt (wombat ftw!!)
  • Faster/smaller
  • No weird handling of new buffers like with emacsclient
  • No daemon like: emacs –daemon
  • Better python integration
  • Easier to make extensions
  • Preview of docstrings when using omni completion

EMACS:

  • Better python-mode
  • No commandmode/normalmode
  • Directory browser/editor
  • Debugger (better integration with external tools)
  • easier to begin
  • Everyting is a buffer™

And now I have chosen to be the editor with which I am going to work is…… (drum roll please) …….:

Gedit!

No, it’s (g)Vim :)

And while writing this article I was looking for a WordPress/blog plugin for Vim and Emacs. At a glance it looked like the wordpress plugin for Emacs was a little bit better. So already I was doubting my decision… So it could be that I switch editor in the next few months :) But I’m first going to really use gvim to see if it fits with my workflow and is really useable for me.

As cherry on the pie, a nice screenshot of my gvim in action:

Vim with python-mode

[update]
I’ve installed Netneans 6.8m2 and it feels a lot faster than 6.7 but python completion is as bad as in 6.7.
[/update]

[update2]
Found out about Vim’s netrw. So Emacs no longer got “Directory browser/editor” as a strong point.
[/update2]

Zend and Compiz/visual effects

Zend logoWhen enabling Visual effects Zend wouldn’t maximize anymore. So after a bit of googling I found a nice tutorial to fix the problem with Zend.

Courier/postfix certificates

The certificates of the courier imapd-ssl and pop3d-ssl were expired. After some searching I found how to renew them:

sudo aptitude install courier-pop-ssl

nano /etc/courier/imapd.cnf #edit the CN
nano /etc/courier/pop3d.cnf #edit the CN

mv /usr/lib/courier/pop3d.pem /usr/lib/courier/pop3d.pem.old
mv /usr/lib/courier/imapd3d.pem /usr/lib/courier/imapd.pem.old

/usr/lib/courier/mkimapdcert
/usrlib/courier/mkpop3dcert

cp /usr/lib/courier/pop3d.pem /etc/courier/
cp /usr/lib/courier/imapd.pem /etc/courier/

/etc/init.d/courier-authdaemon restart
/etc/init.d/courier-imap restart
/etc/init.d/courier-imap-ssl restart
/etc/init.d/courier-pop restart
/etc/init.d/courier-pop-ssl restart

With thanks to this post.

If first thought that /usr/lib/courier/mkimapdcert generates the certificates in the wrong path. But on another server the cp command complained that the two files were identical. So it looks like they are hard-linked or something…

Trouble setting up digital output

Too lazy to type something usefull here. Just for my own reference…

Useful links:

  • http://alsa.opensrc.org/index.php/DigitalOut
  • http://www.pulseaudio.org/wiki/PerfectSetup

Steps to take:

usermod -a -G audio $USER
sudo aptitude install pulseaudio
sudo nano /etc/pulse/default.pa

load-module module-combine
load-module module-zeroconf-publish
load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;192.168.1.0/24

pulseaudio –start (or run pulseaudio in screen)
aplay ~/train.wav

Tomato firmware

sp-tomaatTomato is a replacement firmware for Linksys’ WRT54GL and it rocks!

I’ve installed it on my home router and on the new router of my boss. Both had other routers ( a Belkin and a US Robotics) and a lot of troubles with the stupid things. After switching to Tomato we’ve had no troubles at all! Upgrading was a breeze.

At work we still have a D-link but the conncetion keeps dropping. If I set it to WPA1 OR WPA2: no troubles. But WPA1 AND 2 it can’t handle :( So one of these days I’ve got to pick up a nice blue Linksys and install Tomato on it.

Linksys-WRT54GL