Posts Tagged ‘Shares’

Sync Firefox bookmarks to Dropbox

19, May 2010

I’ve tried all the Firefox add-ons to sync bookmarks between PC’s and found them all to be unreliable at times so I decided to try Dropbox. I do have an Ubuntu One account but I have had problems syncing my tomboy notes to it and it often does not sync at all during my session so as my Dropbox account seems to sync everything very quickly and accurately I decided to use that.

First I closed Firefox and copied the bookmarks database called places.sqlite from my hidden Firefox profile in my home folder at /home/martin/.mozilla/firefox/57k8ls89.default to a folder in my Dropbox account called bookmarks then renamed the original to places.sqlite.bak

In a Terminal I cd in to the Firefox profile with;

$ cd /home/martin/.mozilla/firefox/57k8ls89.default

copied the database across with;

$ cp places.sqlite /home/martin/Dropbox/bookmarks/places.sqlite

renamed the original with;

$ mv places.sqlite places.sqlite.bak

And then sym linked the Dropbox copy back to the Firefox profile with;

$ ln -s /home/martin/Dropbox/bookmarks/places.sqlite places.sqlite

Now when I re launch Firefox if uses the bookmarks database in Dropbox and I can do the same on my laptop so they both use the same set of bookmarks.

Note : [Thanks to Barbara below]

Although this method works fine with several PC’s/Laptops for me I have found as has Barbara that Dropbox cannot cope with multiple browsers open at the same time. Dropbox will save conflicted copies of the sqlite file which will mean any changes you make are lost next time the browser is closed and opened again. So the rule is only one browser open at a time on one PC.

Sheevaplug – automount USB drive at boot

17, February 2010

The problem with the Sheevaplug is that it boots too damn fast and the USB drive is too slow to be available for the fstab mount.

The solution, see here for my post on setting up the fstab file to mount your USB drive. When you edit the fstab on the Sheeva you will find it empty but you should end up with an entry similar to this.

# UNCONFIGURED FSTAB FOR BASE SYSTEM
/dev/sda1 /mnt/usbdrive ext3 auto,user,rw,exec 0 0

My usb drive is mounted at /dev/sda1 and I created a mount point called /mnt/usbdrive, the drive is formatted as ext3 but you can replace this with the format of your drive or just replace with the word auto for it to check.

Once you have your fstab in place you need to create a script which will slow down the boot for the USB drive to start. Thanks to restamp on the plugcomputer.org forum see here for the solution.
First navigate to the init.d folder, in a [Terminal] issue the command;

cd /etc/init.d

then using whatever text editor you have installed [I added nano], open a file called wait4usbdrive with;

nano wait4usbdrive

then copy into it restarts script;

#!/bin/sh
#
# If /etc/fstab has been configured to mount a USB drive, pause to give
# the USB drive devices time to show up in /dev. If this is not done,
# checkfs.sh will fail, requiring manual intervention…
#
case "$1" in
start)
grep -q ^/dev/sda /etc/fstab &&
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
do
[ -b /dev/sda ] && exit 0
sleep 1
done
exit 1
;;
stop)
;;
esac

Then make it executable with;

chmod +x wait4usbdrive

Then link it to the rcS.d folder with this command;

ln -s ../init.d/wait4usbdrive /etc/rcS.d/S25wait4usbdrive

Now you can shutdown and restart the plug and the USB drive should now auto-mount. My USB drive is a 1.5 TB iomega with it’s own power supply.

Shared Directories with Samba

4, October 2009

Configuring the Samba conf.file [smb.conf]

First, create a shared folder by opening a [Terminal] and either typing or copy & pasting the following;

martin@linux:~$ sudo mkdir /home/my_share

make it available to all users;

martin@linux:~$ sudo chmod 0777 /home/my_share

install samba with;

martin@linux:~$ sudo apt-get install samba

stop samba running with;

martin@linux:~$ sudo /etc/init.d/samba stop

Under Lucid this is now; sudo service smbd stop

rename the current config file as a backup template with;

martin@linux:~$ sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.backup

create a new config template;

martin@linux:~$ sudo touch /etc/samba/smb.conf

open new config file with;

martin@linux:~$ sudo gedit /etc/samba/smb.conf

now copy & paste in the details from the smb.conf file here, changing details of network name [my_network], computer name [my_linux_box] and the shared folder details [my_share] as required.

save and close the config file.

start samba again with;

martin@linux:~$ sudo /etc/init.d/samba start

Under Lucid this is now; sudo service smbd start

Add yourself as a samba user with;

martin@linux:~$ sudo smbpasswd -L -a my_name

enter your admin password when asked.

martin@linux:~$ sudo smbpasswd -L -e my_name