Monday 22 June 2009

Install Samba Server on Ubuntu

Install Samba Server on Ubuntu


If you want to share files between your Ubuntu and Windows computers, your best option is to use Samba file sharing.


To install, first open a terminal window and enter the following command:


sudo apt-get install samba smbfs


We’ve got samba installed, but now we’ll need to configure it to make it accessible. Run the following command to open the configuration file, substituting your editor of choice:


sudo gedit /etc/samba/smb.conf


Find this section in the file:


####### Authentication #######

# “security = user” is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba-HOWTO-Collection/ServerType.html
# in the samba-doc package for details.
; security = user


Uncomment the security line, and add another line to make it look like this:


security = user
username map = /etc/samba/smbusers


This will set Samba to use the smbusers file for looking up the user list.

Create a Samba User

There are two steps to creating a user. First we’ll add that username to the smbusers file.

sudo gedit /etc/samba/smbusers


Add in the following line, substituting the username with the one you want to give access to. The format is ubuntu-usuername = “username”. You can use a different samba user name to map to an ubuntu account, but that’s not really necessary right now.

joe = “joe”


Next, we’ll run the smbpasswd utility to create a samba password for the user.


sudo smbpasswd -a


Now you can create samba shares by right clicking in Nautilus and defining the share in properties/sharing.


Tuesday 16 June 2009

How to install Filezilla3

Very simple, download Filezilla from http://filezilla-project.org/download.php?type=client

Then run these commands in a terminal where you downloaded the file to:

sudo tar jxvf FileZilla_3.2.5_i586-linux-gnu.tar.bz2 -C /opt/
sudo chown -R root:root /opt/FileZilla3/
sudo chmod -R 755 /opt/FileZilla3/

You may need to edit the first line to correct for version/name changes to the file you have downloaded, FileZilla works a treat ;)

Create a menu item next:

sudo gedit /usr/share/applications/filezilla.desktop

And add the following lines:

[Desktop Entry]
Encoding=UTF-8
Name=FileZilla
Comment=FTP Client
Exec=/opt/FileZilla3/bin/filezilla
Icon=/opt/FileZilla3/share/pixmaps/filezilla.png
Terminal=false
Type=Application
Categories=Application;Network;
StartupNotify=true

FileZilla can then be started from Applications → Internet → FileZilla.

Monday 15 June 2009


How to read 20 magazines for free.


You will need Firefox and an addon called User agent Switcher and configure it with an iPhone setting :

Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/4A102 Safari/419 (United States)

You can then visit http://zinio.com/iphone/ and read 20 magazines each month for free.

It gets better though, it is very simple to download these pages onto your computer using Linux, aren't you glad you dumped windows ;)

We now need the URL to the image so "copy image location" from the right click menu then using this command:

curl -O -A "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/4A93 Safari/419.3" INSERTURL

Replace INSERTURL with the copied link you got to page 1, then delete back to the underscore and append [1-300].jpg this is a range option to grab pages 1 to 300 and can be adjusted, so the final command will look like this:

curl -O -A "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/4A93 Safari/419.3" http://imgs.zinio.com/iphone/issues/416078746/[1-300].jpg

The files will need to be renamed, as sadly they won't sort correctly if you are going to do the next step of combining them into a single pdf. We need the jpgs numbering from 001.jpg so they order correctly. this can be achieved in a variety of ways, using Thunar rename to insert the necessary 0's in two stages is one simple way, insert 00 at position 10 for number 1-9, and insert 0 into postion 10 for pages 10-99. it can also be scripted in a couple of steps with :

for i in `seq 1 9`; do mv *_$i.jpg 00$i.jpg ;done

for i in `seq 10 99`; do mv *_$i.jpg 0$i.jpg ;done

This could of course be scripted into one single command using a bash script.

Then we can simply issue the command:

convert *.jpg magazine.pdf

Thats it, you now have a local copy of the magazine in a handy PDF format relatively simply, it lokos more complex than it really is once you get your head around it.

Thursday 11 June 2009

Acer Aspire One update broke Wifi


Just updated my Acer Aspire One (Intreprid 8.10) and the wifi broke. A quick poke around and installed:

linux-backports-modules-generic

After a reboot the wifi sprang back into life.