Entries Tagged 'Linux' ↓
October 15th, 2009 — Linux, PHP, Ruby, development, python
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:

[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]
October 13th, 2009 — Linux, PHP
When 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.
October 2nd, 2009 — Linux
The certificates of the courier imapd-ssl and pop3d-ssl were expired. After some searching I found how to renew them:
CODE:
-
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...
September 28th, 2009 — Linux
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
September 24th, 2009 — Linux, Other
Tomato 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.

September 11th, 2009 — Linux, PHP
Since a few version of virtualmin I had some problems with checking the server configuration.

The problem is that I have manually patched suexec and the php fcgid script is in /var/www and not /home.
I had this error for quite a while but last week I fixed it. It was quite simple. Just change this code in "/usr/share/webmin/virtual-server/feature-web.pl:
CODE:
-
# Make sure home base is under base directory, or template CGI directory is
-
if ($tmpl->{'web_suexec'} && $suhome &&
-
!&same_file($suhome, $home_base) &&
-
!&is_under_directory($suhome, $home_base) &&
-
(!$cgibase || !&is_under_directory($suhome, $cgibase))) {
-
return &text('check_ewebsuexechome',
-
"<tt>$home_base</tt>", "<tt>$suhome</tt>");
-
}
-
-
<p style="text-align: left;">return undef;
-
}
To:
CODE:
-
# Make sure home base is under base directory, or template CGI directory is
-
return undef;
-
if ($tmpl->{'web_suexec'} && $suhome &&
-
!&same_file($suhome, $home_base) &&
-
!&is_under_directory($suhome, $home_base) &&
-
(!$cgibase || !&is_under_directory($suhome, $cgibase))) {
-
return &text('check_ewebsuexechome',
-
"<tt>$home_base</tt>", "<tt>$suhome</tt>");
-
} return undef;
-
}
So just add "return undef;" to the top of that piece of code. Then it will step out of the function before the additional check is executed.
# Make sure home base is under base directory, or template CGI directory is
if ($tmpl->{'web_suexec'} && $suhome &&
!&same_file($suhome, $home_base) &&
!&is_under_directory($suhome, $home_base) &&
(!$cgibase || !&is_under_directory($suhome, $cgibase))) {
return &text('check_ewebsuexechome',
"<tt>$home_base</tt>", "<tt>$suhome</tt>");
}
return undef;
}
April 20th, 2009 — Linux, Other
We got a lot of complaints about legitimate mails being marked as spam and therefore not being delivered to our customers. As a solution I wanted the mails to be delivered to the user's .SPAM folder.
These is the configuration I decided on:
/etc/amavis/conf.d/20-debian_defaults:
CODE:
-
$final_spam_destiny = D_PASS;
/etc/maildroprc:
CODE:
-
# Global maildrop filter file
-
-
# Uncomment this line to make maildrop default to ~/Maildir for
-
# delivery- this is where courier-imap (amongst others) will look.
-
DEFAULT="$HOME/Maildir"
-
SHELL="/bin/bash"
-
MAILDIRMAKE=`which maildirmake`
-
logfile "/var/log/maildrop.log"
-
-
`test -d $HOME/Maildir/.SPAM`
-
if ( $RETURNCODE == 1 )
-
{
-
`$MAILDIRMAKE -f SPAM $HOME/Maildir`
-
`echo INBOX.SPAM>> $HOME/Maildir/courierimapsubscribed`
-
}
-
-
if ( /^X-Spam-Status: Yes/ )
-
{
-
to "$HOME/Maildir/.SPAM/"
-
}
/etc/roundcube-webmail/main.inc.php:
CODE:
-
// store spam messages in this mailbox
-
$rcmail_config['junk_mbox'] = 'SPAM';
-
-
// display these folders separately in the mailbox list.
-
// these folders will automatically be created if they do not exist
-
$rcmail_config['default_imap_folders'] = array('INBOX', 'Drafts', 'Sent', 'SPAM', 'Trash');
Delete all the old Junk-folders:
CODE:
-
rm -r /home/*/Maildir/.Junk
-
rm -r /home/*/homes/*/Maildir/.Junk
To make it extra nice:
/etc/amavis/conf.d/50-user:
CODE:
-
use strict;
-
-
#
-
# Place your configuration directives here. They will override those in
-
# earlier files.
-
#
-
# See /usr/share/doc/amavisd-new/ for documentation and examples of
-
# the directives you can use in this file
-
#
-
-
#$log_level = 5;
-
-
$pax='pax';
-
-
read_hash(\%whitelist_sender, '/etc/amavis/whitelist');
-
read_hash(\%blacklist_sender, '/etc/amavis/blacklist');
-
read_hash(\%spam_lovers, '/etc/amavis/spam_lovers');
-
-
@bypass_spam_checks_maps = (
-
\%bypass_spam_checks, \@bypass_spam_checks_acl, \$bypass_spam_checks_re);
-
-
#------------ Do not modify anything below this line -------------
-
1; # ensure a defined return
And:
CODE:
-
touch /etc/amavis/whitelist
-
touch /etc/amavis/blacklist
-
touch /etc/amavis/spam_lovers
And restart amavis:
CODE:
-
/etc/init.d/amavis restart
February 23rd, 2009 — Linux
A while ago I blogged about installing the transmision bittorent client on ubuntu 8.10. Back then, in the days, you had to install transmission and install your own daemon script. But as of Ubuntu 9.04 there's a package for it!
As easy as:
CODE:
-
sudo aptitude install transmission-daemon
Be careful! The paths for the config file and the torrent files are changed. So backup before installing this because you may lose data (like me
).
December 26th, 2008 — Linux
I recently had some problems with using the crontab command on two of my servers. Don't know how it happened, but here are two links that solved my problem:
http://ubuntuforums.org/showthread.php?t=625184
http://ubuntuforums.org/showpost.php?p=3907857&postcount=4
December 19th, 2008 — Linux, Other, PHP
I download a Debian Sid livecd on my home server/HTPC and there's a cd burner in there. So I would like to burn the downloaded iso. There no X Server running (yet) on the box so I was searching for a nice commandline utility.
I found cdw and it really looked nice so I installed it:
After running it with "cdw" it detected my cd-writer so no configuration needed: nice. Because I once tried mybashburn (or something like that) and that piece of software needed all kinds of configuration. And I don't like that.
I wanted to burn the debian sid iso with cdw but I couldn't find an option for doing so. After some searching I found out that I had to go to "preferences" and change the value of "Default image file". WTF? That's not very nice I thought. But I tried it. But a no-go. The path to my iso was to long to fit in the box. So I couldn't even select it.
Don't get me wrong: cdw IS nice for burning music cd's or just some files to backup. But isos.... pfff
So I resorted to cdrecord. It's got a bit of a "hacker" feeling to it but it did the job nicely:
CODE:
-
cdrecord driveropts=burnfree /home/leon/debian-live-sid-amd64-xfce-desktop.iso
What I don't understand is why I have to manually enable burnfree. I mean: the last 5 cdr drives I had, all had burnfree. I'm doubting if they even make cd recorders without burnfree. So why not make it the default? Because apparently "Maybe it causes problems with *some* drives withput burn-free support". Hja, retards.
But there might be a solution to this problem. Cdrecord checks for "/etc/cdrecord.conf". And there you can change the default cdrecord parameters. My "/etc/cdrecord.conf" now contains:
But if it's correct of if it works: I don't know. I haven't yet tested it.