Search Results 

Results tagged “linux” from Nothing new here

Backing up your home folder with rsync

I have been looking for a way to mirror my home folder on my Macbook with a linux server (nslu2 with Unslung Linux in this case), this article describes how to do that with tools already available in Leopard.

nslu2.jpg
"Home Server v2" by Montini

I assume you have a valid SSH login on the server, I simply enabled my account on the NSLU2 and assigned the proper home and shell values to it. I also assume both computers have an working installation of rsync (run rsync --version to check)

For automatic, password-less logins, first we need to generate keys for SSH, if you have them already, skip this section. Run this command on your local computer:
$ ssh-keygen -d

Now copy your public key into ~/.ssh/authorized_keys2 on the server. If this file already exists on the server, you will have to edit it, if it does not (e.g. your account is fresh) first create the ~/.ssh directory on your server (mkdir ~/.ssh), then execute this command on your local computer:
$ scp ~/.ssh/id_dsa.pub yourname@yourserver:.ssh/authorized_keys2

Before we can start mirroring your home folder, we have to create a list of files we don't want to synchronize, this are the contents of my ~/.rsync/exclude file:

- .DS_Store
- Virtual Machines.localized
- Library/Mail Downloads
- Library/Caches
- Downloads/
- Applications/
- Books
- anthill_cache
- .Trash
- .localized

That's it, now all you need to do is to adapt this command to your environment,  run it and wait...
$ rsync -avzP --exclude-from=/Users/me/.rsync/exclude -4 --delete -e 'ssh -ax' ~/ you@yourserver:~/Backups/mymacbook/

you can also create a shell script so you don't need to remember the command everytime:
$ echo "rsync -avzP --exclude-from=/Users/me/.rsync/exclude -4 --delete -e 'ssh -ax' ~/ you@yourserver:~/Backups/mymacbook/" > ~/remotebackup; chmod +x ~/remotebackup
You can start the backup by executing ~/remotebackup


...well not much to write. Basically i'm very busy with several projects right now, coz you know, all of them need to be finished ASAP, after nothing had happened for months. PHP, Java and Project Management all at once. Besides that i have some project running in my spare time, so not much time left for bullshitting on this blog.

But in case you did not notice... who cares, really... I am back to Apple Laptops, because the Wintel world still hasn't managed to make laptops function properly with linux. Or, you could say the Linuxguy* has no clue about laptops, but that may be considered as flamebait in the Linuxworld. Story in short: Fedora upgrade borked my setup, no hibernate, no suspend to ram. Installed Ubuntu, got everything running, upgraded and was left on the console with a borked hibernate and suspend to ram. Thanks ATI, thanks Linuxguy, but I have no time for this. Macintosh, it also crashes, but it does what i want it to do.

*Linuxguy as in whomever packaged my .deb/.rpm based distro.

Enabling IPv6 on your PC is not as difficult as you think. This is a quick Teredo/Miredo Howto for the most popular operating systems allowing you to penetrate most NATs and Firewalls and most likely allowing you to bypass any blocking or censorship happening at your place. As a free bonus, i will will show you where to access tons of Usenet posts, including binaries over ipv6 for free.
Nota bene: Since Teredo also works from China, you can use it together with the *.sixxs.org proxy to read any of your favourite, blocked sites.

I also have a tutorial for IPv6 with tunnelbroker.net from HE for Mac OS X.

Windows XP
WARNING: Whatever you do, make sure you have all the latest security patches for remote exploits and your Windows firewall is up, if you use 3rd party, ensure it supports IPv6. Enabling IPv6 will put you on the net, losing any protection you may have had behind your router's NAT. At the moment there are not many attacks over ipv6, but this may change any time.

Install
Open the Terminal with Start -> Run -> cmd

netsh interface ipv6 install
netsh interface ipv6 set teredo client
Wait for few moments.


Uninstall

netsh interface ipv6 uninstall

Windows Vista
Install
IPV6 and Teredo is enabled per default. You can get into the settings by going into the preferences for an network interface. "Obtain an IPv6 address automatically" should do the trick. However, Teredo will disable itself if you have "edge traversal" or outgoing udp packets blocked in your firewall or if your router is a symmetric-nat router (e.g. Speedtouch 780). In that case you have to use a tunnel broker, see comments below.
If you can go to http://www.ipv6.sixxs.net/, everything works well, if not... well, good luck. I never really got Teredo to work on Vista Business reliably, sometimes it works, most of the time it does not.

Uninstall
Add this registry value ("DWORD") set to 0xFF (long line, double-click, and copy):

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters\DisabledComponents
Or save the two lines in a .reg file and double-click it:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters]
"DisabledComponents"=dword:000000ff
You can also go to the interface properties of an network interface and deselect the IPv6 protocol for that interface. To enable IPv6 again, replace dword:000000ff above with dword:00000000.

Debian, Ubuntu
Install
On Ubuntu IPv6 is enabled per default, but not configured.
sudo apt-get install miredo

Because the default server did not work for me, I had to change it to another one:
sudo vi /etc/miredo.conf
ServerAddress teredo.ipv6.microsoft.com
sudo /etc/init.d/miredo restart

Uninstall
sudo apt-get remove miredo

Fedora, Redhat
Install
About the same as on Ubuntu. On Fedora Core 6 & 7 IPv6 is enabled per default, but not configured. You need to get miredo rpm from the Dries RPM repository.
sudo rpm -Uvh miredo-*.rpm
Uninstall
sudo rpm -e miredo

Mac OS X
Install
Get the Miredo installer from Miredo-Osx, and install it. If you are lucky, that's it. if not, try changing the server, see Debian howto above.


Uninstall
If you want to uninstall, execute the uninstall-miredo.command script, located in the /Applications/Utilities folder.

Checking if everything is working

On the terminal type:

ping6 pugio.net

In browser come back to this page, there should be a pin-up girl in lower right corner telling you that you have IPv6 and give you some more info if you click her... If you can ping6 but can't visit ipv6 websites, check your Firefox network.dns.disableIPv6 setting, did you set it to true previously?


Cool stuff

This server is running Fedora Core 6, since I like to play with fresh packages - Debian was always years behind and i did not want to depend on backports.org forever. So anyway, Fedora has always some basic things which just don't want to work out of the box. bind-chroot being one, and proper local mail delivery with procmail being another. Should you ever get something like:

Mar 28 08:00:39 h70524 postfix/local[4916]: 4D2A440C646: to=<root@pugio.net>, orig_to=<root>, relay=local, delay=3.9, delays=3.6/0.17/0/0.1, dsn=5.2.0, status=bounced (can't create user output file. Command output: procmail: Couldn't create "/var/mail/nobody" )

just do a "chmod 4755 /usr/bin/procmail" and all your problems will be solved.

New mail notifier for Evolution

Evolution is a great email client, it's just missing a good new mail notifier - actually, it has none. I am running Fedora Core with Gnome and there's the new-mail applet, but it's huge and an overkill for most cases. To make a long story short, i was looking for a new mail notifier for Evolution and found none which were usable - so i made one. The following code should work on most Gnome desktops including Ubuntu and you can use with any other mail client which can pipe new emails to an external application:

Notifier
Getting a new spam notification

It's using the libnotify library with python bindings (yum install notify-python), this is the source:

Save the code to a new file, give it the .py ending and make it executable (chmod +x notifier.py). Go to Evolution and create a new message filter for incoming mail and pipe all new mails to the script.

filter

You can also use the script if you are running procmail locally, just add the following script to your ~/.procmailrc file:

# popup new mail alert
:0 c
| ~/notify.py

I release the notifier code in the public domain, do whatever you like with it. If you do some changes to it, please send me a copy, i may be interested in seeing it. Also it would be nice if you could link back to this post.