Linux (49)

Installing MONO on Linux Cent OS 6

First install the dependencies, you’ll likely have some of them, but this is the full list needed to install mono. yum install bison gettext glib2 freetype fontconfig libpng libpng-devel libX11 libX11-devel glib2-devel libgdi* libexif glibc-devel urw-fonts java unzip gcc gcc-c++ automake autoconf libtool make bzip2 wgetyum install bison gettext glib2 freetype fontconfig libpng libpng-devel libX11 […]

Move from Courier-imap to Dovecot on Cent OS6 running Plesk

First, install dovecot from the plesk panel. it will likely fail to start, and that’s due to the ssl cert not being present according to the defaults, the default config looks like this: #ssl_cert = #ssl_key = We will reuse the ssl cert used by courier, which lives in /usr/share/imapd.pem edit /etc/dovecot/dovecot.conf you’ll see the […]

Recursively counting files in a directory

find . -maxdepth 1 -type d -print0 | xargs -0 -I {} sh -c ‘echo $(find “{}” | wc -l) “{}”‘ | sort -n

Remove query string from filename after wget

  • July 30, 2014
  • Linux

After using wget to fetch multiple files, you end up with any query strings as part of the filename, remove them: for file in *.js\?*; do mv “$file” “${file%%\?*}”; done

wget – ignore robots.txt rules when grabbing site files

Simply do: wget -r -e robots=off –wait 0.25

rsync for migrating websites

Using rsync to migrate websites to new servers. How to copy files to a remote server and keep symlinks in place, using rsync (instead of cp or scp) Useful rsync switches [code] -v verbose -q quiet -a archive -r recursive -d directories without recursion -g preserve group -o preserve owner -t preserve times -z compress […]

php session save path permission denied

seems an update in plesk overnight (twice in the last few weeks) has cocked up the php session_save_path: no websites were able to write any sessions, so nothing added to baskets… angry customers… ahem. not sure whether i’m blaming plesk just yet, i’m investigating. but the problem in all error logs is: [code]mod_fcgid: stderr: PHP […]

configure sendmail on mac os x

Unable to send email using PHP mail()? Learn how to configure sendmail on mac os x… Open up /etc/php.ini and set the sendmail_path: [code] sendmail_path = "/usr/sbin/sendmail -t -i" [/code] then restart apache: [code] apachectl restart [/code] if you try sendmail… [code]sendmail[/code] you will get an error: [code] sendmail: fatal: chdir /Library/Server/Mail/Data/spool: No such file […]

Get mailbox info on command line Plesk

Using the command line is sometimes a lot quicker than fannying around with a panel in the browser. So to grab a quick summary of a users mailbox, the following one-liner will show all you need: [code] /usr/local/psa/bin/mail -i [/code] On Plesk 11 If you’re running Plesk 11 you will see: [code gutter=”false”] $ […]