I was using a for loop to read the filenames in a directory but received errors on files with spaces in the names. For future reference the following worked: #!/bin/bash ls -1 | while read FILE; do echo “$FILE” # double quotes needed for filename with spaces!done exit 0
Posts By: jonny
htaccess symlink problem
I doubt this will be of any help to anyone else but for future reference.Problem:A content management system writes the URLs in <a> tags with a path e.g.: /sites/mysite/AboutUs but the customer wants the addressbar to show just: /mysite/AboutUs Solution:Add a symbolic link from the apache root to the site directory e.g. ln -s /var/www/sites/mysite… Read more »
PhotoRec Easy Linux File Recovery
I was copying some photos from my wife’s Fuji camera when the photos disappeared from view – obviously not something I caused!Anyway after the initial panic I found PhotoRec which can be downloaded from the CG security website or can be installed on Ubuntu using Synaptic (package name is testdisk). I was hoping for something… Read more »
WordPress Theme Tutorial
This tutorial is useful for converting an existing design to a WordPress theme quickly:http://jonathanwold.com/tutorials/wordpress_theme/
Uptime Update
Availability Report year to date: 99.991% Unfortunately a reboot is necessary for a kernel update.
FreeNX on Ubuntu in 5 minutes
The last time I tried installing FreeNX was on Suse about 3 years ago. So again frustrated with the speed of VNC I tried FreeNX again this time on Ubuntu 9.04 following this guide. Ensure SSH server is installed or sudo apt-get install openssh-server Install nx client, then node, then server using the deb packages… Read more »
MySQL InnoDB Table Lock
I had a customer with a problem using a web based email marketing software application. Importing data and deleting data seemed to stop working. The database uses InnoDB tables so I used phpMyAdmin to try to execute the delete SQL code and received the following error: 1205 lock wait timeout exceeded For future reference: To… Read more »
Find and Replace Strings in Files
The Wikipedia article on find is great. Searching To check for the existence of the string in any of the files in the directory structure: find . -exec grep -H “searchstring” ‘{}’ \; -print On Solaris ommit the ‘-H’.or using grep only: grep -r “searchstring” /tmp Replacing Find in the current directory (.) type file… Read more »
rsync: fatal: libpopt.so.0: open failed
I was trying to use Rsync on a Solaris machine and received the following error message: ld.so.1: /usr/local/bin/rsync: fatal: libpopt.so.0: open failed: No such file or directory I discovered from http://www.sunmanagers.org/pipermail/sunmanagers/2002-May/014178.html that it is an evil LD_LIBRARY issue which can be overcome with the following (as root): crle -l /usr/lib:/usr/local/lib crle -u
Tor and Privoxy in Ubuntu
Tor is a free implementation of anonymity network which protects your privacy over the internet. Tor enable this by providing virtual tunnels to internet application through SOCKS interface. This post will show you how to setup and use Tor to browse the web anonymously. First of all you need to install tor and privoxy package… Read more »