GnutonLogo
My Home

Mirroring a website n Linux

May 1st, 2009

Well, in linux the best tool to take a copy of a entire website is WGet.
Scenario: To get all the pages, images and the other contents that are in a hypothetic book/ directory of a hypothetic website (eg: example.com), we can run:
wget -m -np -p http://www.example.com/book/

where “m” stands for “mirror”, “np” is “no parent” (we want only the pages in the book/ directory) and the “p” flags tells to wget  taking all the resources (like images) needed to display correctly the web pages mirrored in offline mode.

Bookmark and Share

Updating DinamicDNS and OpenDNS settings with a public IP

May 1st, 2009

Most people run a home server behind a router. If you have a dynamic IP, this could be very annoying. The server don’t know about the public IP (of the router), the router sometime don’t update the dinamic DNS. The OpenDNS settings are not valid anymore if your IP chages.

To avoid all these issues, this night I wrote a very cool script that updates  DynDNS and OpenDNS at the same time.

DynDNS allows me to have a domain like my-server.dyndns.org with a dinamic IP. OpenDNS instead after a free registration and after that I added its DNS IP to my DHCP router configuration, it offers a safe browsing to my network users protecting them from several internet threats like phishing, adult sites ecc..

My server runs this script every hours via cron.

#! /bin/bash

user=MYUSER
password=MYPASSWORD
hostname=MYDNS.MYDNS.ORG
#wildcard allowed values are NOCHG, Y, N
wildcard=NOCHG
mx=NOCHG
# Y=Yes, use it as my primary mail relay.  N=No, use it as backup MX record.
backmx=NOCHG

#current IP
currentIP=$( curl -s http://checkip.dyndns.org/ | grep -o “[[:digit:].]\+” )

#check
if [ "$currentIP" != "$(cat lastIP)" ]; then
echo IP changed to $currentIP
echo “$currentIP” > lastIP
#update OpenDNS
/usr/bin/curl -m 60 -u $user:$password ‘https://updates.opendns.com/account/ddns.php?’
#update DynDNS
curl -v -k -u $user:$password “https://members.dyndns.org/nic/update?hostname=$hostname&myip=$currentIP&wildcard=$wildcard&mx=$mx&backmx=$backmx”

else
echo IP not changed. It is still $currentIP
fi

Bookmark and Share

Goodbye Last.fm, Welcome Magnatune.com!

April 30th, 2009

Last.fm, the internet personal radio has played about 2000 songs for me since January. Since a bit the service is not free anymore. The people have to pay to use it. The fee is cheap but I think that it’s too high for the service offered. Then I decided to don’t pay money for that and I decided to explore the ocean of free music available in streaming from websites like magnatune.com, coolstreams.com and similar. I’m using amarok to listen those radios..they are already there. Amarok works great with them!
There I can find a lot of musics genres; Jazz, Rock, Blues and so on.. what’s your favorite one?

Bookmark and Share

Parental Control in a small network

April 30th, 2009

If you have children or you want to ensure to the people in your network a safe browsing, you can install squid + dansguardian.
I installed them on my home linux server. It runs Ubuntu Dapper (a very old distro)… and Installing and configuring them have been very easy.
First of all I installed squid with apt-get install squid. Then I installed dansguard with apt-get. The installation script told me that I had to modify the config file.
Then I removed the “REMOVE ME” line in the config file and i started the two new services with a /etc/init.d/squid start and then /etc/init.d/dansguard start.
Squid (the proxy) will listen for connection at the port 3128, instead the filter (dansguard) wiill listen at the port 8080.
At this point we can block the access to the port 3128 with iptable and removing every possible way to have a gateway in the net.
The people in our network are forced to use the filtered proxy to browse now.
After that I setted the proxy in my boxes everything is okay.. the children can surf the web again safely!

Bookmark and Share

A Cool Nightmare before XMas Gif

April 13th, 2009
JackReDelleZucche

JackReDelleZucche

Bookmark and Share

Watching movies for free (Part I – Streaming of italian translated movies)

March 22nd, 2009

I write this post in italian just because I’ll speak about sites that provies to italian translated movies only.

So I apologize for that!

Dicevo.. ah si.. :D La pirateria su internet si estende su diversi fronti.. ed arrestarla da parte delle authority sarebbe un po come usare le mani per fermare una cascata. I film pubblicati in internet non sempre hanno qualita audio video di cui tutti si accontentano. Anzi io credo che nonostante si trovi tutto quel che si vuole su internet, difficile e’ trovare qualcosa con un ottima qualita.. con dolby ecc.

Motivo per il quale credo che chi si vuolegustare un film davvero deve andare al cinema o cmq prendersi un blue ray disk.

Cmq andiamo al sodo.. in Italia molti film sono indicizzati in siti come animedb.tv e http://ffinalsqualo.altervista.org/.

AnimeDB e’ usatissimo e spesso da problemi. Su ci si trova di tutto ed e’ abbastanza seguito e curato.

ffinalsqualo e’ anch’esso fatto bene. Non ho idea di quante persone partecipano al progetto.. e nn so nemmeno quanto durera.

Per il momento e’ cmq una valida alternativa nei momenti di inattivita’ di AnimeDB.

Inoltre per chi la sera nn sa che film vedersi.. ffinalsqualo e’ una manna dal cielo!

Buona visione

Bookmark and Share

Remembering the past: Cartoon, The visionaries.

March 21st, 2009

When I was child I loved too much watching cartoons. One of my preferred was “The Visionaries”.
I didn’t remember the name of this cartoon, just because I watched it when I was too younger and it broadcast few times. :(
Since yesterday I had a vague memory of it. But thanks to youtube I found the opening theme and so the name and all (?) the episodes too! :D
That’s cool.
Ist episode and Playlist

Bookmark and Share

Goosh: Google Shell

March 10th, 2009

Some minutes ago I discovered this cool site: http://goosh.org/ here you have a “google powered” terminal.. ahah :D

Bookmark and Share

Using Avahi

March 3rd, 2009

Few people know how much useful avahi could be. You can forget to run ifconfig on the target machines/devices to know the IP, you don’t need a static Ip anymore for those…
You can give to any machine that runs an avahi-server the possibilty to have a DNS like machinename.local.

Installing avahi is quite simple; you just need to run apt-get install avahi-daemon.
After that you can reach that machine over the net using its new domain name.
You can discover them with:
gnuton@joshua:~$ avahi-browse -a
+ vmnet8 IPv4 WOPR [00:50:56:c0:00:08] Workstation local
+ vmnet1 IPv4 WOPR [00:50:56:c0:00:01] Workstation local
+ eth1 IPv4 WOPR [00:1e:c2:be:4e:f6] Workstation local
+ eth1 IPv4 key [00:0d:60:5e:35:ab] Workstation local

In my case I have some virtual nets belong to VMWare and one wireless net on eth1.
These interfaces are using the same domain name: WOPR.local
You can see also that there is another workstation in my net.
Its domain name is key.local. That’s my home server…

What more? Avahi can also publish some services so that they are discoverable in the net.
Use case:
- I want to transfer files with Dolphin for KDE4 using ssh/scp. The target machine doesn’t have a static Ip on my net.
I can get the files that I need just opening Dolphin, clicking on the “Network” icon in the sidebar and then “Network services”.

To make discoverable the ssh service you have to:
copy the config ssh service file in the avahi configuration directory with:
cp /usr/share/doc/avahi-daemon/examples/ssh.service /etc/avahi/services/
and then you have to restart the avahi service with
/etc/init.d/avahi-daemon restart

Then you can check that everything goes okay with avahi-browse-domain utility:
root@key:/etc/avahi# avahi-browse-domains -a
+ eth0 IPv4 joshua [00:1e:c2:be:4e:f6] Workstation local
+ eth0 IPv4 key [00:0d:60:5e:35:ab] Workstation local
+ eth0 IPv4 key SSH Remote Terminal local

Here we are! The new service is in the last line! :D

Avahi is also available for the Meemo devices. You can install it on your N810/N800 just
running apt-get install avahi-daemon.
Note: An old post says about some problem with at the startup that have been solved.

On your linux box now you have something like this:
root@joshua:/etc/avahi# avahi-browse-domains -a
+ vmnet8 IPv4 joshua [00:50:56:c0:00:08] Workstation local
+ vmnet1 IPv4 joshua [00:50:56:c0:00:01] Workstation local
+ eth1 IPv4 joshua [00:1e:c2:be:4e:f6] Workstation local
+ eth1 IPv4 key [00:0d:60:5e:35:ab] Workstation local
+ eth1 IPv4 key SSH Remote Terminal local
+ eth1 IPv4 Nokia-N810-43-7 [00:1d:6e:9c:00:e8] Workstation local
- eth1 IPv4 Nokia-N810-43-7 [00:1d:6e:9c:00:e8] Workstation local
+ eth1 IPv4 Nokia-N810-43-7 [00:1d:6e:9c:00:e8] Workstation local
- eth1 IPv4 Nokia-N810-43-7 [00:1d:6e:9c:00:e8] Workstation local
+ eth1 IPv4 freaky [00:1d:6e:9c:00:e8] Workstation local

In this report you can see that I restarted 2 times my avahi daemon on the N810 and
the last time I changed the hostname editing /etc/avahi/avahi-daemon.conf

Note: the avahi utils are in a separate package: avahi-utils :P

Bookmark and Share

Addio Machummer

January 27th, 2009

Dopo tanto tempo il nostro capo e’  andato via :( Non ci sono parole per descrivere il nostro stato d’animo.

Nonostante cio’, forgiati dal suo spirito riusciremo ad andare avanti fino a fine server.

Saremo pirati per sempre…

Grazie Machummer!

Leggi l’ultimo saluto di Machummer…

Bookmark and Share