Twitter Updates

Saturday, 31 May 2008

Ubuntu configuring samba

Installing Samba on my new server
$sudo apt-get update
$sudo apt-get install samba

Backup configuration
$sudo cp /etc/samba/smb.conf /etc/samba/

Now configure
$vim /etc/samba/smb.conf

my setup
[edited 01/11/09]
My Example Config can be found here
[edit over]

Dont forget to create a samba user (relies on a standard user with that name present) then set the samba password.
$sudo smbpasswd -a username

Final step restart Samba
$sudo /etc/init.d/samba restart

Convert debain/ubuntu to static IP

My Ubuntu Mini-ITX server was by default being assined an IP through DHCP from the router. If my router could assign IP based on the MAC address I would not have to assign a STATIC IP on the machine itself but could control it from a central location. Since I dont have this most of my machine have a static IP assigned. For Debain and Ubuntu systems this is quite easy.
Following instructions are for eth0 (the first real network socket)

$sudo vim /etc/network/interfaces

This text should already be present
auto lo
iface lo inet loopback

if these lines are present delete/comment out (#at the beginning of the line is a commet)
auto eth0
iface eth0 inet dhcp

Add the following (replace the x's with the assigned ip)
#### Manually Added Below Morgy ####
auto eth0
iface eth0 inet static
address 192.168.1.x
gateway 192.168.1.x

Now restart networking
$ sudo /etc/init.d/networking restart

A more complete tutorial

Darwin Ports

I recently found out about the Darwin Ports. It is built on the BSD package management system and lets you easily install unix programs that have been ported to os x. The package management part of it handles the dependencies for you. You do need to install Xcode first though.

Once downloaded you need to add the darwin ports binaries folder to the search path. from the terminal run (or manually added the path to the .bashrc)
$echo 'export PATH=$PATH:/opt/local/bin' >> ~/.bashrc
$echo 'export PATH=$PATH:/opt/local/sbin' >> ~/.bashrc

Friday, 30 May 2008

Moving the /home dir

I am currently working on a low power mini-itx server. The operating system and boot partition is a 8GB flash drive, with a 1TB SATA drive for storage which can be powered down when not being used.

The OS is Ubuntu, running samba. I will be backing up my laptop to the server and so lots of data will be going into the homes directory. Therefore I need to move the /home/ directory to the 1TB Drive.

The partitioning/formatting/mounting steps taken for /dev/sda.

$ sudo fdisk /dev/sda
option n to edit partition table.
option w to write the new partition.

Format ext3
$ sudo mke2fs -j /dev/sda1

Mounting, edit /etc/fstab
$ sudo mkdir -p /mnt/hostname/partitionname
$ sudo vim /etc/fstab

added this line
/dev/sda1 /mnt/hostname/partitionname ext3 rw,auto,async,errors=remount-ro 0 1

$ sudo mount -a

The new partition is now mounted.
Now move the homes directory
$ sudo cp -ax /home /mnt/hostname/partitionname/
$ sudo mv /home /home.old
$ sudo ln -s /mnt/hostname/partitionname/home /