Monday, May 7, 2012

replacing space in filename under osx/linux

just a little handy script to replace all the spaces in a filename with an underscore


for file in *.txt do newname=$(echo $file | tr ' ' _) mv "$file" $newname done




just a little handy tool

where is my space?

so since 24h I try no to discover why my harddrive is full... All I did was deleting a VMWare image and now all my space is gone, which look like there were some error during the delete option...

for example:


sh-3.2# du -shcx /*
 11G /Applications
8.4G /Developer
5.7G /Library
  0B /Network
2.8G /System
4.0K /User Guides And Information
 28G /Users
4.0K /Volumes
4.1M /bin
  0B /cores
4.5K /dev
4.0K /etc
1.0K /home
  0B /lost+found
 15M /mach_kernel
1.0K /net
 49M /opt
8.6G /private
2.3M /sbin
4.0K /tmp
1.4G /usr
4.0K /var
 65G total


means that the system should have a total size of 65GB.

Now on the other hand,

sh-3.2# df -h

Filesystem      Size   Used  Avail Capacity  Mounted on

/dev/disk0s2   238Gi  181Gi   57Gi    77%    /
devfs          182Ki  182Ki    0Bi   100%    /dev
map -hosts       0Bi    0Bi    0Bi   100%    /net
map auto_home    0Bi    0Bi    0Bi   100%    /home



it says that 181GB are used, which is a difference of ca 120GB. Now where is this space?

Disabling the local backups in OSX, verifying the disk and rebooting using Command-R. I was able to reapair the disk, which cleaned up the space.


Filesystem      Size   Used  Avail Capacity  Mounted on
/dev/disk0s2   238Gi   68Gi  170Gi    29%    /
devfs          181Ki  181Ki    0Bi   100%    /dev
map -hosts       0Bi    0Bi    0Bi   100%    /net
map auto_home    0Bi    0Bi    0Bi   100%    /home

Thursday, May 3, 2012

Basic Rocks linux stuff.

Some basic Rocks Linux Cluster stuff... just some stuff I need to remember and always forget:

list all host interfaces:


rocks list host interface

changing the mac address of a network card: 


rocks set host interface mac HOSTNAME iface=eth1 mac=00:00:00:00:00:02



please be a aware that you also have to remove the mac address definition in the following file:


/etc/sysconfig/networking/devices/ifcfg-eth*


you should be able to just uncomment the mac address line, without any ill effects and this will simplify this process next time.


and possible in the dhcpd.conf file


vim /etc/dhcpd.conf


in case you modify the eth0 interface. To ensure that the dhcpd configuration still works as supposed to.