Archive for the 'hacks' Category Page 2 of 3



Install Firefox 3 in Debian Etch

Welcome to Linux Screw! If you're new here, you may want to subscribe our RSS feed.

If you downloaded fresh Firefox 3 installation e.g. from here and tried to install it in Debian Etch, you might notice that latest version of the popular browser requires GTK+ 2.10 while Etch contains only 2.8:

We're sorry, this application requires a version of the GTK+
library that is not installed on your computer.
You have GTK+ 2.8.This application requires GTK+ 2.10 or newer.Please upgrade your GTK+ library if you wish to use this application

Thankfully there is no need to upgrade GTK+, the tips given here (and here) will keep you from headache. The only thing that is necessary to do to get Firefox 3 working at Debian Etch, is to get GTK+ from backports by the following commands:

wget http://apt.linex.org/linex/gtk-2.10/libgtk2.0-0_2.10.13-2%7Ebpo.1_i386.deb
dpkg-deb -x libgtk2.0-0_2.10.13-2~bpo.1_i386.deb gtk2-10

Then copy contents of newly created directory gtk2-10 to /opt/firefox3 and add the following line into /opt/firefox3/firefox:

#!/bin/sh
#
export LD_LIBRARY_PATH="/opt/firefox3/gtk2-10/usr/lib"

It is necessary to inform Firefox where is new GTK+ is located :) Now it’s time to start Firefox…

P.S. In other distributions you can try to compile/install GTK+2.10 manually:

cd /usr/local/src
wget http://ftp.gnome.org/pub/GNOME/sources/gtk+/2.10/gtk+-2.10.14.tar.bz2
tar xjf gtk+-2.10.14.tar.bz2

mkdir gtk210
cd gtk+-2.10.14
./configure --prefix=/opt/firefox3/gtk2-10
make install

Mount your Flickr account as regular Linux drive

flickr logoFlickr is an extremely popular image/video hosting website, web services suite and an online community platform. It was one of the earliest Web 2.0 applications. In addition to being a popular Web site for users to share personal photographs, the service is widely used by bloggers as a photo repository. It hosts more than two billion images.

Now it is possible to mount your Flickr account on Linux PC as a virtual filesystem, allowing you to browse through your photos as if they were on a locally connected drive.  It can be now easily done with Flickrfs:

Once mounted, it retrieves information about your photos hosted on your flickr account, and shows them as files. You can now easily copy photos from your local machine to this mount, and it will automatically upload them to your flickr account. Similary, you can copy the files from your mount to your local machine, and it will download your images from flickr.

All the files in the mount have a meta file attached to them, which provides access to title, description, tags, and license information. Modifying any of these fields and saving the meta file, will update them on the server as well.

You are lucky if you chose Ubuntu as detailed step-by-step installation guide is available at author’s site for Ubuntu users. Of course you are welcome to use it under other Linux distributions e.g. Slackware ;)

ptunnel: send/receive TCP traffic via ICMP reliably

Yes, it can be useful sometimes. For example, you have access to Wi-Fi network but you’re not allowed to access Internet via TCP/UDP as these protocols are blocked. At the same time ICMP is opened and you can ping everything alive in Internet. So, to check your email just have ptunnel installed and work around the restrictions set by the Wi-Fi network sysadmin easily.

Ptunnel is an application that allows you to reliably tunnel TCP connections to a remote host using ICMP echo request and reply packets, commonly known as ping requests and replies. It is not a feature-rich tool by any means, but it does what it advertises. So here is what it can do:

  • Tunnel TCP using ICMP echo request and reply packets
  • Connections are reliable (lost packets are resent as necessary)
  • Handles multiple connections
  • Acceptable bandwidth (150 kb/s downstream and about 50 kb/s upstream are the currently measured maximas for one tunnel)
  • Authentication, to prevent just anyone from using your proxy

1. Install ptunnel in Ubuntu or Debian
apt-get install ptunnel

2. Start ptunnel proxy:

ptunnel -p proxy_address -lp listen_port -da destination_address -dp dest_port [-c network_device] [-v verbosity] [-u] [-x password] [-f file]

The following example assumes that ptunnel is run as root, both on the proxy and client. To tunnel ssh connections from the client machine via a proxy running on proxy.pingtunnel.com to the computer login.domain.com, the following command line would be used:

ptunnel -p proxy.pingtunnel.com -lp 8000 -da login.domain.com -dp 22

An ssh connection to login.domain.com can now be established as follows:

ssh -p 8000 localhost

P.S. A brief manual on how to use ptunnel can be got here.
P.P.S. If you are sysadmin and have to forbid Internet access to some user in LAN, don’t forget to block ICMP! :)

KDE on Nokia Internet Tablet n800 and n770

The Nokia N800 Internet Tablet is a wireless Internet appliance from Nokia. The N800 was developed as the successor to the Nokia 770. It is designed for wireless Internet browsing and e-mail functions and includes software such as FM and Internet radio, an RSS news reader, image viewer and media players for selected types of media.

TY:

KDE and all it’s supporting programs have been compiled for the Internet Tablet, and it works b-e-a-utifully. I’ve installed this sucker on my N770 and it purrs like a kitten, believe it or not ;)

kde_n800

Read more…

Web server oneliner with bash

It’s amazing but it’s possible to write little web server on bash shell script. Here is it’s source code:

:;while [ $? -eq 0 ];do nc -vlp 8080 -c'(r=read;e=echo;$r a b c;z=$r;while [ ${#z} -gt 2 ];do $r z;done;f=`$e $b|sed 's/[^a-z0-9_.-]//gi'`;h="HTTP/1.0";o="$h 200 OK\r\n";c="Content";if [ -z $f ];then($e $o;ls|(while $r n;do if [ -f "$n" ]; then $e "`ls -gh $n`";fi;done););elif [ -f $f ];then $e "$o$c-Type: `file -ib $f`\n$c-Length: `stat -c%s $f`";$e;cat $f;else $e -e "$h 404 Not Found\n\n404\n";fi)';done

Bash shell script web server

You can download it here.

Just run it and then load web page http://192.168.0.7:8080, where 192.168.0.7 is IP address of the Linux machine you’ve started above mentioned bash script. You’ll see links to files located in directory the script was started at. My respect to Alexey Sveshnikov.

P.S. Script was tested at Ubuntu and Debian Linux.




Pages: Prev 1 2 3 Next
Friendly Sites:Who is behind Linux Screw?
GeekyBits³ | Bash Cures Cancer | OMG! Ubuntu!
My SysAd Blog | Web Upd8
ZEPY | Linux config Wiki | Planet Sysadmin
a non-geek's linux notes | Linux Today
TuxArena: The arena of Tux | LinuxAlt.Com
My name is Artem N. (artiomix AT gmail DOT com) and I'm Linux/Unix, Cisco systems engineer. The main idea of Linux Screw is to share relevant knowledge, skills and observations over The Web. Here you can find a lot of information related to different Linux distributions, FreeBSD, IOS as well as a other Open Source around staff. Read more ››