Posts mit dem Label linux werden angezeigt. Alle Posts anzeigen
Posts mit dem Label linux werden angezeigt. Alle Posts anzeigen

Dienstag, 22. Oktober 2013

How to mount your backups with Obnam using FUSE

With the latest version 1.5 Obnam introduced a pretty cool new feature: You now can mount your backup as if it would be a "virtual hard drive". That is, you don't need to extract / restore your backup using Obnam's command line anymore if you only are interested in certain files or directories to restore.

Since this feature is pretty new I had to bring myself up-to-date on how to exactly use the mount option. Since this is FUSE (Filesystem in Userspace) you don't need to be root to mount the actual backup. Still, it took my a while until I figured out the right parameters to make it all work.


This is how to make it happen (tested on Ubuntu / Mint / Debian):

First, you have to create a new directory in your home directory where to actually let Obnam mount the backup into. I chose
/home/<your-user-name>/tmp/obnam
for that.
Second, your user needs to be part of the group "fuse". This already should be the case, and if not: 
 sudo usermod -a -G fuse <your-user-name>

Now comes the fun part: Mounting your backup! For me, my backups are located on my NAS, which in turn are mounted (read-only, for saftey!) into
/media/ds212/backup/<your-hostname>/backup_YYMM

To mount the this backup repository, do a

obnam mount --repository /media/ds212/backup/<your-hostname>/backup_1310/ --client-name <your-hostname> --viewmode=multiple / --to=/home/<your-user-name>/tmp/obnam
Note: Execute the command above as your regular user, not as root! The backup will be mounted as ready-only -- makes sense with a backup, does it?

Now you should be able to access your backup within

/home/<your-user-name>/tmp/obnam

The cool thing is: With the option --viewmode=multiple just supplied above you can access all backup generations so far created at once. The latest folder contains a link to the, well, latest backup made.

To unmount the backup you need to be root however: sudo umount obnam

Have fun with this cool feature!

Freitag, 10. Mai 2013

Tiny Tiny RSS and Synology NASes

Today I spent a bit of time to evaluate Tiny Tiny RSS, an Open-Source and web-based RSS client with API support and much, much more.

I simply wasn't too happy with my last Feedly experiments, namely: No plugins, no filtering / tagging / scoring support and, well, it's closed-source. So I decided to give Tiny Tiny RSS a try. Why? Maybe you've heard about Google Reader closing soon.

Luckily, Syno Community is offering a (beta) package for Synology NASes, like for my DS212+. To get this package you have to add Syno Community's package repository with a special parameter:

http://packages.synocommunity.com/?beta=1

(Note the ?beta=1 at the end)

After adding, installation should go pretty smooth. Oh, and did I mention you have to enable MySQL and Web Station before doing that? Otherwise it won't work. Really.

In case you're wondering what's your admin user default password (in case you didn't change it yet) for the MySQL server: it's empty, nothing, nada.

If Tiny Tiny RSS' update daemon is not running correctly, that is, your feeds don't get updated, see the next steps:

Stop the package in the Synology package manger.

Check what's going on by manually running

su -m nobody -c "php /var/services/web/tt-rss/update.php --daemon"

on the SSH command line.

If there's an error like "sh: /usr/syno/bin/php: not found" you have to link the existing PHP binary via

ln -s /usr/bin/php /usr/syno/bin/php

After that the regular "--daemon" should work and also update the feeds. Now you can start the package again in the package manager.

Hope this helps.






Samstag, 12. Mai 2012

[UPDATE] Installing / setting up my Synology DS212+

Lucky me! Right before the weekend all needed parts (that is, the Synology DS212+ itself plus 2 x 3TB Seagate ST3000DM001 7200 RPM) arrived in time to spend some fun hours with it. Bonus: My girlfriend isn't here for the entire weekend, so even more time available! Life can be sooo nice, aww ...

Alright, so after unpacking this nice little box I installed the HDDs and hooked it up to my network. Since the initial RAID parity checks takes a while I did some research on what I need to get working and what I want to do with my DS212+. In case you didn't know: The DS212+ runs a 2.6.32 Linux on an ARMv5 Marvell SoC with 2,0 GHz.

This post will list all the things I did to get my setup into a working state (and also act as a reminder in case I need to set it up another time / migrate).

SSH


First, enabling SSH is a good thing to do (but don't go for the ancient and unsecure telnet crap!) -- go right into DSM and enable SSH in the system preferences. You then can login via ssh (on Windows use putty) using root@<ip-of-your-DS212+> as the address. The password is the very same password you use for the DSM administrator account.

Adding external package sources

To get a few more packages to browse I just added some more SPK repository sources to  the DSM package manager:

http://update.10trum.de/packageupdate/getpackages.php
http://pcloadletter.comlu.com/
http://packages.mertymade.com/
http://synopkg.superzebulon.org/spkrepo/packages

http://pvr.unzureichende.info/synology

Security advise: Be sure to only add at least somewhat verified / community accepted repository sources to your DSM. If you install malicious software from untrusted repositories to your poor, little DiskStation this really can bring your stored data into trouble!

Installing IPKG support

Another nice thing to do is to add support for *.ipkg packages to get even more software to your NAS-device: Since the DS212+ has an ARMv5-based CPU one has to do the following to get the IPKG stuff working:

  1. Login as root via SSH to your DS212+ (see SSH section for more information).
  2. Go to the "@tmp" directory by doing a "cd /volume1/@tmp/".
  3. Do a "wget http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/syno-mvkw-bootstrap_1.2-7_arm.xsh".
  4. Execute the just downloaded script by "sh syno-mvkw-bootstrap_1.2-7_arm.xsh"
  5. Note: The execution will fail because the scripts contains a too tightend processor type check which simply can be changed in the next step.
  6. Go into the directory "bootstrap" (that was created by the script above) by "cd bootstrap", open the required file via "vi bootstrap.sh", go to the line which has "Feroceon-KW" in it and change it to just being "Feroceon" (without quotes). Leave the rest unchanged though! If you don't know how to operate "vi" then have a look here. After editing that line save the file and exit vi.
  7. Unmount "/opt" if still mounted: "umount /opt".
  8. Due to some wget incompatibilities the pre-installed DSM version vs. the wget version IPKG will install the root's PATH variable needs to be adjusted first: Do a "vi /root/.profile" (note the dot in front of the filename!) and add "/opt/bin:/opt/sbin/" in front of the PATH variable's value so that it might looks like this: "PATH=/opt/bin:/opt/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/syno/bin:/bin:/sbin:/usr/bin ...". Exit the editor after you saved the file.
  9. Apply the changes to the environment by doing a "source /root/.profile".
  10. Go back to the "@tmp/bootstrap" directory by doing a "cd /volume1/@tmp/".
  11. Execute the script again by "sh bootstrap.sh".
  12. Now the script should report no error anymore and the IPKG stuff should get installed.
Phew, lot of stuff, wasn't it? So to update your IPKG package list you just need to do "ipkg update". This will retrieve the current repository list which will contain more fun software to install. Do that every now and then to keep your list updated; also mind for security updates.

Installing bash

As the default installation uses BusyBox with ash as the shell I'm not too happy with that. So installing bash with a "ipkg install bash" helps. After installing setting it as the default shell in "/etc/passwd" (usually the first line is for user root) via "/opt/bin/bash" solves this problem.

Installing OpenSSH

To use scp from my desktop box to transfer files to my new DS212+ I needed OpenSSH -- there is a nice small blog post over at Literati Tech which explains what to do. See it here.

Installing rdiff-backup

There's small wiki article over at forum.synology.com which explains how to install rdiff-backup. See it here.
Oh, and for getting your self-stitched backup script up and running you also might want to install coreutils by doing a "ipkg install coreutils" (includes mktemp and so on which busybox doesn't offer).


TODO: htop, vim

Fixing German Umlauts for Samba shares

This one took me a while to figure out. As I occasionally read German articles or documentation I got some files with German Umlauts (ä, ö etc.) in it. After putting them on my DS212+ the naming was screwed up on both, the Samba share on my Ubuntu (Mint) box and via SSH (sh).

To fix this you need to edit the file "/usr/syno/etc/smb.conf" by adding
 
unix charset = ISO8859-1

to the [globa] section. After that you need to restart Samba by doing a

/usr/syno/etc/rc.d/S80samba.sh restart

Also, edit your Samba shares on your local box (probably /etc/fstab) to include

iocharset=iso8859-1,codepage=CP850
 
in the mount options per share. For reference, my mount options look like this:

//192.XX.XX.XX/music       /media/ds212/music            cifs    _netdev,auto,iocharset=iso8859-1,codepage=CP850,user,uid=XXX,credentials=/etc/samba/auth_ds212.conf    0       0


After re-connecting to your Samba shares the Umlauts finally should work now.



Developing further ...watch out for updates!


Samstag, 4. Februar 2012

[Update 4] Ubuntu + TP-Link TL821Nv3 / TL822N v2.0

After I upgraded my Ubuntu 11.04 to 11.10 due to the upcoming 12.04 version (which I won't upgrade to anymore because of their Unity crap, just a personal rant btw) I had massive problems with my not-so-old TP-Link TL821Nv3 wireless USB-stick which worked fine most of the time all day long.

Now, for those of you who also have problems with this stick: Be aware that there are different versions of  TL821N / TL822N around: On the retail package there are very small version numbers (such as v3 or v2.0) printed on.

Okay, so after having that much trouble with my formerly bought TL821Nv3, I decided to go with the TL822N because of reports that this stick has a slightly different chipset on it. A few days later the new stick arrived and I did some basic lookup using "lsusb" on it: Crap, the very same chipset (0cf3:7015, ath9k_htc) on it as on my former TL821Nv3! They must have changed the chipset between revisions, because older reports claim they used a different Aheros chipset on this stick before. Bad luck for me ...so move on.

After doing some more research I thought it would be worth trying out the latest ath9k_htc driver from the Linux 3.3 kernel (Ubuntu's stock kernel with 11.10 is 3.0.0.15 btw) -- so digging further into the Linux Wireless Project. Here you can get a source package with the latest (stable?) drivers which come with the stated kernel. For getting a list of all current releases, take a look here.

So - finally, after a lot of text - here comes a small how-to for building and installing the latest ath9k_htc driver from the Linux 3.3 kernel on your Ubuntu (also should work on the Linux Mint/Kubuntu/you-name-it equivalents):

  1. First, verify that you're still using the old ath9k_htc module by doing a "modinfo ath9k_htc". The old driver's path in "filename" should point to "3.0.0.something" and the path should contain "kernel/drivers".
  2. Do a "sudo apt-get install --reinstall linux-headers-$(uname -r) build-essential" for installing the required build tools and Linux headers.
  3. Download the latest Linux Wireless package (at the time of writing this is 3.3-rc1-2) by doing a "wget http://www.orbit-lab.org/kernel/compat-wireless-3-stable/v3.3/compat-wireless-3.3-rc1-2.tar.bz2".
  4. Unpack it: "tar xvjf compat-wireless-3.3-rc1-2.tar.bz2".
  5. Go into that directory: "cd compat-wireless-3.3-rc1-2".
  6. Select the correct driver(s) to build by doing a "scripts/driver-select atheros".
  7. Finally, build the stuff by just doing a "make".
  8. After the stuff got built, install the newly built drivers and unload the old ones with "sudo make install && sudo make wlunload".
  9. Verify again that now the new driver got loaded by doing a "modprobe ath9k_htc".  In the filename field the path now should contain "updates/drivers" instead of "kernel/drivers" (as pointed out in step 1).
Update: If connections are still dropping, try disabling the power management of the USB stick by doing a "sudo iwconfig wlan0 power off", where "wlan0" represents your configured wireless device bound to the USB stick.


Update 2: After some more reading about the TP-Link sticks I get the impression they appear to have an overheating problem. Some users even opened their stick cases and added a small passive cooler to the main chip on the logic board. Another option that might help to cool down the stick a bit when processing a lot of wireless traffic is to add "options ath9k_htc nohwcrypt=1" to a newly created file named "ath9k_htc.conf" in the directory "/etc/modprobe.d/". After that just reload the modules or simply do a reboot of your machine.


Update 3: In case the above still doesn't work for you all day long (that's how it is for me -- it works okay, but not through and through yet), here's a simple sudo script called "fuckit.sh" which does all the teardown work for you to re-initialize all the stuff to get it back working again:
ifdown wlan0
rmmod ath9k_htc
rmmod ath9k_common
rmmod ath9k_hw
rmmod ath
rmmod mac80211
rmmod cfg80211
pkill wpa_supplicant
ifup wlan0
If, for whatever reason dmesg tells you "Registered led device: ath9k_htc-phyX", where "phyX" in a higher number (let's say > 10) then there is little chance to get the damn stick working again without reloading the modules mac80211 and cfg80211 (which does the script above already).


Update 4: Seems like there were a lot of changes in the 3.4-rc3 compat package (see Changelog). While the USB stick still is not running 100% perfect I'm giving 3.4-rc3 a go on my not-yet-updated Ubuntu 11.10. Go an grab the new compat package here.

Let me know if/how it's working out for you!

Good luck!

Donnerstag, 8. September 2011

UTF-8 and Unicode FAQ

Just stumbled over a nice FAQ about UTF-8 and Unicode encodings while investigating how to convert some UTF-8 filenames into Latin1 via command line (convmv will do the trick!):

http://www.cl.cam.ac.uk/~mgk25/unicode.html

Definitely a nice one-stop resource worth looking at.

Dienstag, 12. Juli 2011

Back ... and: Sunflower File Manager

Whew ... long time no post! Ok, have to admit that I was on vacation for a while (Austria is great, even for hiking ...) and I'm a bit of a lazy guy when it comes to posting new blog entries this summer ...anyway, here we go with a brand new entry:

Looking for a good graphical double-sided Linux file manager (like Total Commander on Windows)? You already tried the well-known stuff like GNOME-Commander or Tux-Commander and even less-known starters like Double Commander (http://doublecmd.sourceforge.net/) but you aren't satisfied yet?

Then take a look at Sunflower File Manager, located here: http://code.google.com/p/sunflower-fm/

It's a pretty new project and far from being complete, but I have to say - after a while of testing on several Linux boxes - it runs pretty stable and reliable for me -- better than the other alternatives mentioned above.


I'll stay with it.