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 [...]
Posts Tagged ‘Linux’
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, 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 . [...]
(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 [...]





RSS