Posts Categorized: linux

Shell Script: Search for Strings in Web Files

I used this shell script to search through some web directories for references to particular strings – just for future reference.The find command only greps in html, php and pdf files: the -o switch is an OR. #!/bin/bashPATHTOSEARCH=/path/to/webrootFIND=/usr/bin/findNICE=/bin/nicePATTERN=’Media,1234,en.pdf|Media,1235,en.pdf|Media,1236,en.pdf’ $NICE $FIND $PATHTOSEARCH -type f \( -name ‘*.html’ -o -name ‘*.php’ -o -name ‘*.htm’ -o -name ‘*.pdf’… Read more »

PHP, Pear, PECL and UploadProgress

I had need to use the UploadProgress and SMTP Mail PECL PHP extensions so a brief overview: Check pear is installed and working: # which pear To get a list of help/commands: # pear help Run the updates: # pear channel-update pear.php.net Show the installed packages: # pear list This will install the Mail package… Read more »

Ubuntu Desktop Showing Home Folder Contents

I was playing with a shell script to rename a bunch of image files to lowercase then resize them but I had a typo in one of my variables resulting in accidentally renaming all the folders in my home directory with lowercase names. After next log in I now see the home folder contents displayed… Read more »

Troubleshooting Munin

Having given up on installing and using Munin once already I thought I would jot a few notes to help in future troubleshooting. Test the connection by telnet from the munin-server to the munin-nodetelnet mynode 4949list [you should get a list of services available]fetch vmstat [you should get some vmstat numbers] Firewall is the munin-node… Read more »

Plesk SSL Certificates from Comodo

Trying a free SSL cert from Comodo and had some difficulties with an error message: The CA certificate does not sign the certificate So downloaded the following CA bundle:https://support.comodo.com/index.php?_m=downloads&_a=viewdownload&downloaditemid=77and used that instead of the one supplied in the email and the certificate was accepted.The install instructions here explain the process for Plesk. If using a… Read more »

Plesk ClamAV and SpamAssassin: ART

Configuring Plesk’s version of Qmail to use Clam and Spamassassin. I followed the instructions here:http://www.jaguarpc.com/forums/showthread.php?t=19328But I also received an error: Cannot find any reference to the Q-S administrator Email address in  and needed to: vi /var/qmail/control/defaultdomain entering my domain name mybigdomain.tld Useful File Locations: /etc/qmail-scanner.ini/etc/mail/spamassassin/local.cf

Courier IMAP maximum connections

Just increased the maximum number of IMAP (courier) connections (for thunderbird and Mac users) in /etc/courier-imap/imapdMAXDAEMONS from 40 to 80MAXPERIP from 4 to 40as discussed here. I also set DEBUG_LOGIN=1 from DEBUG_LOGIN=0so I could use Munin to count the IMAP logins in the maillog.

Printing Color Syntax Highlighted Code on Ubuntu

There are other ways to achieve this but I like this method.Using Komodo Edit – a free/open-source light code editor licensed under various licenses including GPL, LGPL, MPL.The source code can be downloaded from: http://www.activestate.com/komodo_edit/Install by running: ./install.sh To print colour syntax-highlighted code choose File > Print > Print to HTML file and choose a… Read more »

Proftpd mod_tls and Jscape FTP applet

Recent problem with a Proftpd server configuration on Red Hat/Centos. I had configured mod_tls but on this newer version of the module I had to add the following lines to my proftpd.conf file for the JScape FTP applet to work with:Connection Type FTP/SSL (AUTH TLS) TLSProtocol             SSLv23TLSOptions              NoCertRequest I had been previously been using the… Read more »

Ubuntu Convert YouTube Video to MP3

Having recently heard an acoustic version of VV Brown’s Shark in the Water I wanted an audio file I could listen to until it is released in 2 weeks. There was an acoustic version in a London Cab on Youtube so: I grabbed the youtube video using youtube-dl (get it with Synaptic) youtube-dl “http://www.youtube.com/watch?v=Kcgffz72b_8” I… Read more »