Friday, October 28, 2011

Extract archives with Linux find

Example:
~/Folder/A/a.rar
~/Folder/A/a.nfo
~/Folder/B/b.rar
~/Folder/B/b.nfo
Extract all archives in Folder subdirectories and delete them afterwards:
Linux terminal:~$
cd Folder 
find . -name "*.rar" -execdir unrar x {} +
find . \( -name "*.rar" -o -name "*.nfo" \) -execdir rm -r {} +

Labels: , , , ,

Saturday, October 8, 2011

VirtualBox Guest Additions date settings

If you need to change the date settings in a VirtualBox machine use the following command in the cmd/terminal:

Offset in miliseconds:
VBoxManage modifyvm <vm name> -biossystemtimeoffset <offset in milliseconds>

6 months in msec:

15768000000

Example (minus 6 months from current date):

VBoxManage modifyvm WindowsXP --biossystemtimeoffset -15768000000

Labels: , , ,

SAS 9.2 on Windows 7 Pro

  1. Before installing SAS 9.2 download Microsoft Visual C++ 2005 SP1 package and install it.
  2. Use compatibility mode with Windows XP SP 2 on setup.exe file in SAS 9.2 cd.
  3. During installation it will give you an error that it can't run Microsoft Runtime Components 8.0 SP1, ignore it and just continue install.
  4. After the installation finishes set SAS program compatible to Windows XP SP 2.

Labels: , , ,

Saturday, October 1, 2011

Access your encrypted data from a live CD (ecryptfs)

     From: bodhizazen.net
     You can access the data in your encrypted home directory with a live CD using chroot if you know your login password.
     Start by booting a live CD and, assuming they were automatically mounted, unmount your partitions.
Next mount your partitions in /mnt. I assume your root partition is /dev/sda1 and if you have a separate /home partition it is /dev/sda2 , you will need to adjust your partitions accordingly.
 ubuntu@ubuntu:~$ sudo mount /dev/sda1 /mnt

#################
# Separate home #
#################

# SKIP THIS STEP IF YOU DO NOT HAVE A SEPARATE HOME DIRECTORY
ubuntu@ubuntu:~$ sudo mount /dev/sda2 /mnt/home
 Set up the chroot:
ubuntu@ubuntu:~$ sudo mount -o bind /dev /mnt/dev
ubuntu@ubuntu:~$ sudo mount -o bind /dev/shm/ /mnt/dev/shm
ubuntu@ubuntu:~$ sudo mount -o bind /proc /mnt/proc
ubuntu@ubuntu:~$ sudo mount -o bind /sys /mnt/sys
 Enter the chroot and su switch user to your login user, I use bodhi here as an example:
ubuntu@ubuntu:~$ sudo chroot /mnt
ubuntu@ubuntu:~$ su - bodhi
keyctl_search: Required key not available
Perhaps try the interactive 'ecryptfs-mount-private'
To run a command as administrator (user "root"), use "sudo >command<".
See "man sudo_root" for details.

# Notice the user name change from 'ubuntu' to 'bodhi'
bodhi@ubuntu:~$
Decrypt your home directory:
bodhi@ubuntu:~$ ecryptfs-mount-private
Enter your login passphrase:
Inserted auth tok with sig [b0d08471978769db] into the user session keyring

INFO: Your private directory has been mounted.
INFO: To see this change in your current shell:
cd /home/bodhi

bodhi@ubuntu:~$ cd
bodhi@ubuntu:~$ ls
bin Desktop Downloads Music Public Videos
bzr Documents examples.desktop Pictures Templates zen

Labels: , ,