In order to prevent email delivery during development and log all email messages that would have been delivered, you can actually do a simple trick: Replace the file /usr/sbin/sendmail (on Ubuntu, use ‘locate sendmail’ to find it if it lies elsewhere) with this little shell-script, or rather make a _bak of the original and save [...]
Archive for the ‘Linux’ Category
Filed under: Linux, Serverstuff, Tools
Social Tagging: development • Linux • php • Serverstuff • Tools
Filed under: Linux, Snippets, Tools
Social Tagging: Linux • php • script • Tools
If you have to deal with very old PHP4 legacy code containing every syntax crime you may know from the early years, how would you handle it? Give it to your junior people to fix it manually? I like to have at least some handy helpers for the first rough corrections. I found sed to [...]
Filed under: Linux, Productivity
Social Tagging: commandline • Linux • subversion
Set ignore to all files of a directory with subversion: $ cd cache $ svn propset svn:ignore ‘*’ . $ svn ci . -m ‘Ignore set on cache dir.’ Show changed files between two revisions, overview $ svn diff -r 300:HEAD –summarize Show changed files between two revisions, for each revision: $ svn log -v [...]
Recursively remove all .svn directories from a working copy: find . -name .svn -exec rm -rf {} \; Recursively remove all ._xyz-files (OSX meta file info) from your WebDav-Drive, set via hourly cron: find /var/data/ -name “._*” -exec rm {} \; Do not forget to set your path ;). Check for syntax-errors (lint) in all [...]
Filed under: Linux, Software development, Tools
Social Tagging: development • Serverstuff • subversion • team • Tools
As a development team we always run into situations where we have trouble setting up a proper development environment for each of the team members to get going or add new staff on the go. It annoyed me every time since it causes a lot of unnecessary communication and friction. I often heard of virtualization [...]
Filed under: Linux, Productivity
Social Tagging: commandline • Linux
I had a list of files from a large file structure as a result from a maintenance script run with lines like this: /home/web/…/sources/…/2008/12/25/4f1feabbd76f79ecab150bdee3f6ae4d.xml /home/web/…/sources/…/2008/12/25/e506e433a2d87f0275c7641da59bbf7f.xml /home/web/…/sources/…/2008/12/28/901c4f081645b986e9b1377d3f586b8e.xml /home/web/…/sources/…/2008/12/28/6bec4d4bbcf8f596c40694210d220a3b.xml /home/web/…/sources/…/2008/12/24/477c535d6111605c8f6020a959f32fde.xml /home/web/…/sources/…/2008/12/24/9f253a96fc26d8f6d9e61b8f1bdb3453.xml Each line represented a document path to a file which was supposed to be removed from the filesystem. You can do that with the following simple [...]
Filed under: Linux, Productivity, Snippets, Tools
Social Tagging: commandline • Linux • Productivity
I am currently working on a project in which we have lots of images from an old CMS waiting to be migrated into a new layout. Of course there are restrictions so it should not happen that certain image types exceed a certain max. width. OK, we have many many images… So I took a [...]
Filed under: Linux, Problems, Serverstuff
Social Tagging: Debian • Linux • php
I was having trouble with a server running Debian 4.0 (etch). Using the standard sources in the /etc/apt/sources.list the supported PHP5 version was 5.2.0-8+etch13 which contained a very annoying bug for my application. A daily running script – let’s call it the Importer – regularly exited randomly with a “Fatal error: Out of memory (allocated [...]
Filed under: Linux, Tools
Social Tagging: Linux • mount • samba • subversion
I use a Subversion repository which sits on a Samba share in our LAN. Most of the times I used it from Windows machines where I simply assigned a drive letter (N:\) to the filesystem of the network share (//TERASTATION2/share) hosting the repository. A SVN checkout including URL looked like this: svn co file://N:/_repos/projectname/trunk . [...]
I have an o2 surf stick to provide me with connectivity on the go via UMTS. It worked fine so far under Windows and it worked also my MacBook. Now I wanted to use it also from my new Ubuntu (Intrepid Ibex) laptop. The first thing I tried was to start it with wine. But [...]
I have just installed Ubuntu Intrepid Ibex on my laptop and had trouble getting a WiFi-connection to work. Since channels 12 and 13 are blocked on some WLAN apapters in the US, you have to unlock them following these instructions: http://wiki.ubuntuusers.de/Intrepid_Ibex#WLAN-auf-Kanaelen-12-und-13 (in German) Thanks for the help Torsten!
gt5 is a handy shellscript that extends the linux command du (disk usage). It can be run from the console or remotely over ssh. Nothing to be installed. It uses GNU tools like head, sed, awk and lynx. It generates html which is then passed to lynx to be displayed. You can install it via: [...]
The advanced packaging tool has a built in cow. A nice piece of programmer humor.
(1) Finds files in generated documentation, containing <span class=”field”>webservice:</span> and writes a file containing a clickable list of links to those pages: ~/sites/html/phpdoc_all_global$ find -type f -print0 | xargs -0 grep -li ‘<span class=”field”>webservice:</span>’ | while read in; do echo “<a href=\”$in\”>$in</a>”; done > clickable_list_page.html (2) A for-loop on the commandline. The * equals all [...]
Inspired by the book “The Productive Programmer” I was paying attention more and more on how I actually get things done and how I could better exploit existing shortcuts or faster paths. Please do not ask why, but I had the following problem: One my PHP-Apps had scattered syntax errors. The question was, how I [...]
Here is a tool which generates loads of random passwords: pwgen. On Debian you can install it with ‘apt-get install pwgen’.
On the command line if you close a console with a running job, you kill the job. This is different with the tool ‘screen’, where you can attach and detach from a ‘screen’ without terminating it. You can even start a job in a screen on another machine, detatch, travel somewhere else and re-attach to [...]
Case: I had many .sql-files from a backup containing one table-dump each which should be loaded into another MySql-DB. Simply using phpMyAdmin would not have worked with regard to the size of the tables. So I was thinking about a way to do it on the commandline under Linux. A foreach-solution would have caused me [...]
The tool “ots” simply is an open source tool for summarizing texts content. You can install it on your Linux box with: “apt-get install libots0 libots-dev” http://libots.sourceforge.net – Here you will also find the academic publications around that topic. Example usage: cat myarticle.txt | ots –ratio 5 This command would summarize the article, giving the [...]
Since I am doing more and more stuff on the commandline, I noticed that sometimes I just wait for some task to finish to do a next step in a sequence to accomplish a certain goal. What if a running task would take an estimated 3-8 hours and it is Friday afternoon? In this case [...]





RSS