Posts Categorized: linux

cp: overwrite – force yes

Getting a bit peeved with the copy command prompting to overwrite files. cp -rf ./* ./another/location/cp: overwrite `/filename.conf’? y The ‘-i’ interactive option is obviously aliases into the copy command on Centos (even the -f option was not overriding this for me) but a quick way of overriding the aliasing behaviour is to prefix the… Read more »

Extracting ISO files

Needing to extract the contents of a CentOS iso file so that it could be used to http / kickstart installs: mkdir tmp_mntmkdir ./5.3mount -o loop ./CentOS-5.3-x86_64-bin-DVD.iso ./tmp_mntcp -R ./tmp_mnt/* ./5.3

Linux Web Filtering with OpenDNS and a Dynamic IP Address

Motivation Parental Control / Protecting my kids from some of the nastier stuff on the web is my motivation. On M$ Windows there are commercial offerings such as NetNanny. On Linux I had briefly tested and used Squid with DansGuardian – likely more accurate with word filtering but a little resource intensive for my daughters… Read more »

echo with new lines

For future reference: echo “This does not give \n a new line” does not work. I had used printf sometimes but the -e switch also works for echo: echo -e “This gives \n a new line”

Gimp and Layer Styles

Great guide here about using photoshop plug-ins in gimp, installing Layer Styles plug-in (Drop Shadows, Glows etc) in gimp and more.

Shell Script Spaces in Filenames

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

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 »

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 »

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 »