Archive for the 'Browser' Category

mount WebDav in Ubuntu/Linux from FireFox

Gallery_mount_with_webDavOn a standard photo Gallery, you can select to mount Gallery on your desktop with a WebDAV client. I searched for an easy solution to mount webdav from the browser but was not able to find any scripts doing so with only one click. See the first picture to see how you find the link on a Gallery 2.0.

Here is the simple script: (Read more for an advanced script)

#!/bin/sh
 
DAVURL=`cat "$1" | grep ":url" | egrep -o "http[^< \"]+"`
DIR=`echo $DAVURL | egrep -o "[a-zA-Z0-9\.]" |xargs | sed s/\ //gi`
MOUNTPATH="/media/webdav.$DIR"
 
gksu -- mkdir $MOUNTPATH
gksu -- mount.davfs -onoaskauth $DAVURL $MOUNTPOINT
nautilus $MOUNTPOINT

Continue reading ‘mount WebDav in Ubuntu/Linux from FireFox’

If you're new here, you may want to subscribe to my RSS feed.
Thanks for visiting!

Send each directory over ssh to their own gzipped tar file (.tar.gz)

Find directories in the directory you are standing in:
-maxdepth 1 -type d

Exclude the first ‘.’ :
-mindepth 1

Remove the ./ part from the list:
sed s@^.\/@@gi

Tar-gzip the directory with compression 1 for faster network transfer:
tar -cv $a | gzip -1

Send the file to the dd program:
ssh -l user server "dd of=/path/to/$a.tar.gz"

Wrapping it into a small example script:

for a in `find . -mindepth 1 -maxdepth 1 -type d | sed s@^.\/@@gi`; do 
(tar cv $a | gzip -1) | ssh -l user server "dd of=/path/to/$a.tar.gz" ;
done

I suggest you install a ssh-key before doing this, or you will have to type the user password for each directory. This script does not support spaces in directory names.

The script below handle directories with space in them, just like “Document and Settings”.
I print each file (%p) with a colon at the end. The seperator used by the for-loop is also the colon which is defined by the IFS variable.

IFS=":"
for a in `find . -mindepth 1 -maxdepth 1 -type d -printf '%p:' | sed s@^\".\/@\"@gi`; do
(tar cv $a | gzip -1) | ssh -l username servername "dd of='/outputdir/$a.tar.gz'" ;
done
unset IFS

Boot the ubuntu-live cd, making the network start.
livecd$ ssh-agent
livecd$ ssh -l username server -A
server$ ssh-add

root@ubuntu:/media# dd if=/dev/sda2 | ssh -l username hostname "dd of=/path/to/save/my_backup_sda2.ntfs.disk"
The authenticity of host 'hostname (192.168.1.1)' can't be established.
RSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'hostname,192.168.1.1' (RSA) to the list of known hosts.
username@hostname's password:
38957625+0 records in
38957625+0 records out
19946304000 bytes (20 GB) copied, 2541 s, 7,8 MB/s
37811184+2292882 records in
38957625+0 records out
19946304000 bytes (20 GB) copied, 2532.89 s, 7.9 MB/s
root@ubuntu:/media#

Firefox 3.0 crashed and would not start up again

I’m using Firefox 3.0b5.. and suddenly it crashed on me.. Guess that’s in it self is no surprise.. But this time, it would not start up again when i clicked on the icon again.. I guess a reboot of my Ubuntu would have fixed the problem…

But here is how I temp-fixed it
Continue reading ‘Firefox 3.0 crashed and would not start up again’

Building Liferea 1.5.3 from tar.gz

When installing Liferea 1.5.3 from the tar.gz file, I ran into these problems, and here is a solution if you’re running Ubuntu. Here is how I managed to install all needed libs to get liferea 1.5.3 compiling. This is how ./configure become:

liferea 1.5.3
 
Build Mozilla Plugin............ : yes (firefox)
Build XulRunner Plugin.......... : yes
Build WebKit Plugin............. : no
Build GtkHTML Plugin............ : yes
 
Build libnotify Plugin.......... : yes
Build LUA scripting Plugin ..... : yes
 
Use X Session Management........ : yes
Use DBUS........................ : yes
Use NetworkManager.............. : yes
AVAHI Support................... : yes
 
Liferea will be installed in /usr/bin.
 
configure complete, now type 'make'

Continue reading ‘Building Liferea 1.5.3 from tar.gz’

Make a VCARD file of your Facebook friends

This script is OLD. It does not work on the new facebook

A hot tip to get a VCARD file of your facebook friends.

Go to http://www.facebook.com/mobile/?phonebook and paste this javascript in the URL:

javascript: var s=""; for each(person in document.getElementsByClassName("info")) { if(person.firstChild) { s+="BEGIN:VCARD<br>VERSION:3.0<br>"; var fullname = person.firstChild.firstChild.innerHTML.split(" "); var firstname = fullname[0]; var surname = fullname[1]; s+="N:"+surname+";"+firstname+";;;<br>"; s+="FN:"+firstname+" "+surname+"<br>"; var phone=person.childNodes[1].innerHTML; var phonenumber = phone.substring(0,phone.search("<span")).replace(/\./g,"-"); if(phone.search("<span>M</span>") != -1) { s+="TEL;type=CELL;type=pref:"+phonenumber+"<br>"; } else if(phone.search("<span>L</span>") != -1) {    s+="TEL;type=HOME;type=pref:"+phonenumber+"<br>";  } if(person.childNodes[2]) { phone=person.childNodes[2].innerHTML; phonenumber = phone.substring(0,phone.search("<span")).replace(/\./g,"-"); if(phone.search("<span>M</span>") != -1) { s+="TEL;type=CELL;type=pref:"+phonenumber+"<br>"; } else if(phone.search("<span>L</span>") != -1) { s+="TEL;type=HOME;type=pref:"+phonenumber+"<br>";  }   }   s+="END:VCARD<br>"; } } document.write(s);

Firefox 3.0 beta 5 on Ubuntu 8.04

After upgrading to the new Ubuntu 8.04 LTS, I’ve got some minor problems with my browser.

I guess that problems I’m experiencing now is going to be better later.

Look at the list of plugins/extensions I have, few of them are ready for the 3.0 version of Firefox:
Continue reading ‘Firefox 3.0 beta 5 on Ubuntu 8.04′

liferea-add-feed – Start Liferea if it is not running to add RSS feed

The bash script /usr/bin/liferea-add-feed is adding the url you send as an argument to your list of rss feeds in Liferea. If liferea is not running it will tell you “Liferea is not running! You need to start it first.” but if you did like me, the url is passed from firefox to the liferea-add-feed -script without you seeing that anything goes wrong. To avoid this, I changed the liferea-add-feed script so it makes sure that liferea is running before trying to add the RSS feed.
Continue reading ‘liferea-add-feed – Start Liferea if it is not running to add RSS feed’

All-in-One Gestures

All-in-One Gestures (firefox plugin) makes firefox feel more like Opera.

And it is very customizable. Look at the settings:

all_in_one_gestures4.png all_in_one_gestures2.png all_in_one_gestures3.png all_in_one_gestures4.png

La Linea

la_linea_1.gif

I’ve been waiting for this.. Please go and enjoy!

http://www.tv5.org/TV5Site/la_linea/

Handle both single and double quote characters in input field

There is normaly no problem for the server to recive both double and single quotes from a input field. The problem is when you want to show both single and double quote characters: ‘ and ” in a input text field. You can’t escape characters in html to make the browser show everytning between the outer quote-characters. The trix around this problem is to use javascript to change the value of the input field. That works because javascript understands the whole string when you have escaped it.

Continue reading ‘Handle both single and double quote characters in input field’