Using gmail as SMTP on Ubuntu 10.04

Yet another reminder to myself how to use Gmail as SMTP-service.

Start with installing postfix. Just do the usual:

sudo aptitude install postfix

Select the following settings to start with during installation. Adjust according to your needs.

Raising nofile using ulimit on Ubuntu 10.04

I've been working with Nginx lately and spotted the error Too many open files in the error log. To deal with this I raised the number of files that the Nginx user (www-data) is allowed to open. By default only 1024 files are allowed to be opened. This may be checked by running these commands as user www-data:

ulimit -Hn
ulimit -Sn

The H and S refer to hard and soft values and the n switch to number of files. So to raise the limit a bit I added these lines in /etc/security/limits.conf:

Sluggish NetBeans 6.9 due to project scanning

I've been using NetBeans lately for a PHP project and the IDE has been quite good, until yesterday. For some reason NetBeans scanned the project continuously and I couldn't just kill the process from within the IDE, as it refused to shutdown. Upon a restart of NB the problem prevailed.

I solved the problem by removing two NetBeans directories. Start with shutting down NB, then run:

Killing a hanged SSH session to get back to console

Sometimes I forget to terminate a SSH session properly from my laptop, just closing the lid and then away. One of the consequences are that active SSH sessions are terminated but they are not handing over the console. But there is a handy key combination that releases the console:

<ENTER>~.

That keycombo works on my Mac OSX 10.6. 

 

Renaming files by removing suffix

This is just a reminder to myself how to rename files by removing a suffix. The typical scenario is that I have just renamed a bunch of files, by adding the suffix .bak or something like that. Now I want to rename the files to their original name by removing .bak.

For example to rename all files matching *.conf.bak so that just have the .conf-suffix: 

for i in $(ls *.conf.bak); do mv -f $i ${i%.conf.bak}.conf; done;

 

 

 



 

Disable UAC for specific programs

My sons Vista installation was driving me nuts. I installed a game for him on the Vista machine, but an UAC dialog was popping everytime he wanted to run the game. Giving him administrator privileges wasn't an option. Neither was giving him my administrator password, nor turning off UAC completly. In fact UAC is quite good even if it is getting in your way sometimes. This is how I solved the problem.

Activating ANT in Eclipse for PHP developers

Last time I downloaded the latest version of Eclipse, in this case Gallileo, I choose to download the version Eclipse for PHP developers. For my concern I mostly work with Python and PHP so by adding the PyDev extension I was up running quite soon. But the other day I needed to run an ANT script, that I use to generate documenation, and noticed that the Run as... context menu didn't show up ANT as an option.

Can't shift that many

Had this annoying message popping up when running a script on Ubuntu 8.0.4 LTS. The message read:

shift: N: can't shift that many

On Debian it works fine. The reason for this is the use of different shells in Debian and Ubuntu. Debian is using bash and Ubuntu is using dash. Check the symlink /bin/sh on the different distributions.

To reproduce save the following to a file named test_shift.sh:

Factory reset of Galaxy Samsung with Android

This is just a reminder to myself after trying to do a factory reset of Android on a Samsung Galaxy.

The wrong way: trying to boot the phone in recovery mode and choosing to format data. After reboot all data were intact.

The solution was to power on the phone and go to Settings -> SD Card & Phone Settings -> Factory Data Reset. After that operation the phone was clean.

// John 

DLNA server for Sony NAS-Z200 IR

Last week I've ordered the multi-talented music system NAS-Z200IR, as Sony nicely named it. It's just one flat panel with loud speakers and remote control with 3.5 inch LCD screen. You can plug your Ipod to the system, an USB-stick, play internet radio, ordinary FM/AM-radio. It is actually that ancient that it still can play CD:s, if you recall what they look like.

Syndicate content