Tag Archive > tips

VirtualBox useful commands (VBoxManage/VBoxHeadless)

gimpe » 25 July 2010 » In VirtualBox, bash, tips » No Comments

# change VirtualBox disk and machine default location
VBoxManage setproperty hdfolder /volumes/data/vbox
VBoxManage setproperty machinefolder /volumes/data/vbox

# create a VM
VBoxManage createvm --name "U10.4-base" --ostype Ubuntu --register
# add some ram, network card, DVD-ROM
VBoxManage modifyvm "U10.4-base" --memory 128 --acpi on --boot1 dvd --nic1 bridged
# create a HDD
VBoxManage createhd --filename U10.4-base.vdi --size 10000 --register

# attach storage controllers to it
VBoxManage storagectl "U10.4-base" --name "IDE Controller" --add ide
VBoxManage storageattach "U10.4-base" --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium none

# remove .iso
VBoxManage closemedium dvd /volumes/data/exchange/mini-ubuntu-10.04-server-i386.iso

# start VM
VBoxHeadless --startvm "U10.4-base"

# stop VM (requires package acpid)
VBoxManage controlvm "U10.4-base" acpipowerbutton

# view VM information
VBoxManage showvminfo "U10.4-base"

Continue reading...

Tags: , ,

Ping Ubuntu hostname from Windows (winbind+samba)

gimpe » 19 February 2010 » In linux, network, tips » No Comments

Here’s a procedure I found on taesch.com to ping a Ubuntu machine by the hostname from a Windows PC:

  1. sudo vi /etc/nsswitch.conf
    hosts: files wins dns
  2. sudo aptitude install winbind
  3. sudo aptitude install samba

SOURCE: http://taesch.com/my-digital-life/cant-ping-ubuntu-hostname-from-windows-xp-setup-winbind

Continue reading...

Tags: , ,

FreeNAS CIFS/Samba changing Guest Account ‘FTP’ not working

gimpe » 18 December 2009 » In FreeNAS, tips » No Comments

Using FreeNAS 0.7 Khasadar (revision 4919) with CIFS/SMB Authentication Anonymous, I changed the Guest account for but it is not actually applying it to the configuration, it is a trivial bug and here’s a small dirty workaround.

1 – Create an excutable file containing this:

#!/bin/sh

# find and replace 'ftp' by 'transmission'
sed -i. 's/ftp/transmission/g' /etc/rc.d/samba

# restart samba to use the new config
/etc/rc.d/samba restart

2 – Go in System|Advanced|Command scripts and add an entry for your script in “PostInit”

For those who are interested, I am doing this because my network is not accessible from the outside and I didn’t want to bother with user privileges. I am using my FreeNAS box to share media files downloaded using Transmission and I wanted everybody to be able to access/modify/delete them, so I change the guest account to be “transmission” :)

Continue reading...

Tags:

Tip: use rsync to convert filenames from/to UTF-8 <–> latin-1/ISO-8859-1

gimpe » 13 September 2009 » In tips » No Comments

This will copy files with UTF-8 encoded characters filenames to new files with a ISO-8859-1 encoded filenames and, when everything is completed, will delete the old (UTF-8) files.

BE CAREFUL THIS IS NOT FOOL PROOF :) YOU MUST KNOW WHAT YOU ARE DOING TO NOT DOUBLE ENCODE THE CHARACTERS FILENAMES.

rsync SOURCE SAMEFORDESTINATION --recursive --human-readable --stats --times --progress --iconv=utf8,iso88591 --delete-after

To do the opposite change the iconv switch to: --iconv=iso88591,utf8

Note: If you run rsync as root, you can use --owner --group to keep the same user.group for the copied files.

Continue reading...

Tags: