Archive for the ‘linux’ Category

Buffalo Linkstation Pro Duo

November 1, 2008

My Linkstation Pro Duo arrived yesterday. So what is this thing? Basically it is a NAS, that meens storage provided via a computer network. It has two harddrives that can be configured as software RAID, either 0 or 1. The operating system is Linux(is there a device linux is not capable of running on?^^), what makes it flexible like hell, at least after you gained shell access. In the following lines I will describe the things I struggled with and how I configured the device. I’m planning to use it for:

  • Backups via the network
  • share storage in a heterogeneous network (WinXP, Vista and Ubuntu machines in it)
  • store data
  • downloading things without being forced to turn a “real” machine on, e.g. the DVD of the distribution of my choice during the night
  • I probably can’t resist running a web server on it accessible via dyndns

On other NAS from buffalo you can use a debian-like linux called freelink, though this is not yet ready for the Duo version of the Linkstation pro. Therefore I used the stock version and customized it.

The Web Interface is quite good, there are many things you can do via it, though having shell access invaluable. Therefore the first thing to do is gaining access via the shell. A good guide to do so can be found here. installing the addons.tar is not a bad idea, it will give you the executable of wget, which will be needed a lot. I prefer logging in via public key authentication over the old password method. To enabled it you have to uncomment the following lines in /etc/sshd_config:

PubkeyAuthentication yes
AuthorizedKeysFile      .ssh/authorized_keys

Now copy the key of the client to the server, if you have not yet created one you can do this with:

ssh-keygen -t dsa

now copy it to the machine

ssh-copy-id -i ~/.ssh/id_dsa.pub root@192.168.1.123

The permissions of the dir /root where odd, which caused failures with the pub key auth. therefore I changed them with

chown root:root /root

From your favorite linux distribution you know that thing called “package manager” which eases the management of software on your computer. There is a package manager designed especially for embedded devices called ipkg. You can install it with some bootstrapping script. How to do so is described here.

There is a default samba share called info, this can be disabled by adding those lines:

cp /etc/samba/smb.conf /etc/samba/smb.orig
sed '/^\[info\]/,/guest ok = yes/d ; /^###info###/d' /etc/samba/smb.orig > /etc/samba/smb.conf

at the end of the configure() method in /etc/init.d/smb.sh

ok enough for now,

Ressources:

Advertisements

Ubuntu Intrepid Ibex near

October 13, 2008

At the end of the month the new version of Ubuntu, 8.10, called Intrepid Ibex, will be released. We have reached the last phases in the Release Schedule. The Feature Freeze is active, this means that there will be no new packages added, instead everyone is concentrating on fixing existing bugs. The beta is out already, anyone interested can test it right now. The more will test it, the more bugs are reported and the better the release will be. Therefore get it while it’s hot. The system boots directly from the CD, you don’t have to install it. The available versions can be found here.
The new release has quite some new features:

  • Kernel 2.6.27, which was released just recently
  • Xorg 7.4
  • encrypted ~/Private directory, mounted automatically on login
  • Gimp 2.6
  • Nautilus has a new way of displaying files: Compact View, which arranges the items in columns
  • Guest User, which restricted rights
  • Kubuntu uses KDE 4.1 as default
  • KWin is enabled by default, it enables desktop effects, similar to compiz, though for KDE
  • Adept has been ported to KDE4
  • … and some more
  • I’m awaiting the Private folder the most, it’s a good compromise between encrypting the whole harddisk and leaving sensitive data unencrypted, especially for notebook users. You can just symlink certain files from the Private folder to their old location.
    The switch to KDE4 is in my eyes a little to early. KDE4 is pretty stable in the current state, though it doesn’t seem to be completely ready for a complete switch. Not everything is working perfectly together. And there are quite some programs that aren’t ported to the new version of KDE yet. Tough if KDE4 improves a little it will be quite tempting. I am thinking of moving to KDE in the near future.
    Currently I’m a little annoyed of GNOME and the support of two screens, when using 2 differen xscreens and no Xinerama. Windows are often opened on the wrong screen. Even things that worked back than in 2.22.
    Nevertheless I’m looking forward to the release of Intrepid, as many bugs have been fixed and some interesting features will be added. Now go and test it and report bugs and wishes to the Launchpad.
    Ubuntu 8.10 - Coming October 30!

    gnome panel applet: Network Mon

    July 14, 2008

    I have written a little panel applet for the GNOME Panel that shows your current network traffic in plain text. You can choose one or more of your network interfaces and a adequate speed unit, as you desire.

    Here a screenshot:

    A tarball can be downloaded here: download
    The CVS source code can be browsed here.

    It’s being released under the GPL, so feel free to change and redistribute.

    Please test, comment,enhance, redistribute … 😀

    Acer 5920g Wireless LED Ubuntu 8.04

    June 10, 2008

    The Wireless LED wasn’t working with Ubuntu 8.04 until I did this:

    sudo apt-get install linux-backports-modules-hardy
    sudo rmmod iwl4965; sudo modprobe iwl4965

    Now it lights solid if wireless is turned on. Under Windows its kind of blinking on network traffic, this is not the case here, though I personally prefer it to light solid.

    installing X-Wrt

    June 8, 2008

    The approach of OpenWrt(especially compared to DD-Wrt) is more like offering a basic system which can be highly customized, which is the approach I prefer. The standard web interface has limited functionality. X-Wrt is a seperate project that tries to provide a nice user interface, which nearly makes it unnecessary to use the shell, you can configure many things, install/remove packages,  traverse the file system, and you are able to e.g. analyze traffic trough same fancy graphs. And it is pretty easy to install, too. Making the shell obsolete is not my intention tough, as there are many things that can be done with the shell way easier than with some nice looking GUI.

    There are different ways to install X-Wrt, I choose the one over ssh.

    Connect to your router (note: routerIP being the IP of your router, e.g. 192.168.1.1 ):

    ssh root@routerIP

    After that add a new source to your /etc/ipkg.conf:

    echo “src X-Wrt http://download2.berlios.de/pub/xwrt/packages” >> /etc/ipkg.conf

    Now use ipkg to install the X-Wrt package:

    ipkg install http://ftp.berlios.de/pub/xwrt/webif_latest_stable.ipk

    This pretty much was it. After a reboot of your router, the Webif² should be display in your browser.(type in your router’s IP in the address bar of course)

    the http daemon of OpenWrt doesn’t support a https connection. The root passwort will therefore be transmitted in plain text, which isn’t a clever idea when accessing your router over wlan.

    A straightforward solution is:

    ssh -L 5000:localhost:80 root@192.168.1.1

    192.168.1.1 being the router’s IP.

    Now type in the browsers bar: localhost:5000

    All information is now tunneled through ssh. Windows users can use Putty for this behavior.

    Now go and enjoy your new graphs!

    Links:

    http://wiki.x-wrt.org/index.php/Installation_Guide#X-Wrt_as_ipkg_install_.28via_SSH.29

    SD Card on OpenWrt

    June 8, 2008

    I recently switched to OpenWrt, as I had some problems with DD-Wrt and more important I just wanted to try it out. The change was pretty seamless, as most nvram variables are shared and therefore I didn’t even have to change much for the router to work correctly. If you don’t plan to go back to DD-WRT this script cleans up your nvram variables.(deleting those that aren’t used by OpenWrt)

    Now you need to download the MMC Card module:

    cd /lib/modules/2.4.30

    wget http://programmingstuff.free.fr/files/openwrt/whiterussian/mmc/1_3_4/gpio2/mmc.o

    See comments for an alternative link, if the one above doesn’t work.

    Your card should be formated with ext2. The drivers for the ext2 filesystem are needed, too. They can be installed via a ipkg package:

    ipkg update
    ipkg install kmod-ext2

    insmod ext2

    Now you can test if the card works:

    echo “0x9c” > /proc/diag/gpiomask
    insmod mmc

    mount /dev/mmc/disc0/part1 /mmc

    Note: The gpiomask fits to the modification I described in the post below, adapt it corrosponding to your modification.

    When I used DD-WRT my card was mounted under /mmc. Installing software in that mount-point caused same problems, hence I decided to mount the SD-Card to the root directory in OpenWRT. This enhances your available memory very seamlessly. Furthermore it would be possibly to have differend SD-cards containing different configurations of OpenWRT. If no card is attached the system will start in the normal behavior. First the needed files will be copied to the card:

    mkdir /tmp/root
    mount -o bind /rom /tmp/root
    mount -o bind / /tmp/root
    cp /tmp/root/* /mmc -a

    /sbin/init is a link to the busy box init. This will be replaced with our own init script which will do the work for mounting the card to / and after that execute the init of busy box.

    rm /sbin/init

    This is the new init script(copy paste it to /sbin/init), after that make i executable(chmod +x /sbin/init)

    #!/bin/sh
    echo “0x9c” > /proc/diag/gpiomask
    insmod mmc
    insmod ext2
    boot_dev=”/dev/mmc/disc0/part1″

    sleep 15s
    mount “$boot_dev” /mmc
    [ -x /mmc/sbin/init ] && {
    mount -o move /proc /mmc/proc && \
    pivot_root /mmc /mmc/mmc && {
    mount -o move /mmc/dev /dev
    mount -o move /mmc/tmp /tmp
    mount -o move /mmc/jffs2 /jffs2 2>&-
    mount -o move /mmc/sys /sys 2>&-
    }
    }
    exec /bin/busybox init

    Now reboot. run

    df

    to test  if it works correctly. If the router doens’t boot or something doesn’t work as intended you can remove the card an everything should be just like before.

    xubuntu on usb stick

    May 30, 2008

    Only a few steps are needed to install a complete *ubuntu on an usb stick. I have coosen Xubuntu because I have never tested Xfce before and more important I thought a lightwight distribution would be a good idea for an usb stick. A detailed description can be found here:

    http://www.pendrivelinux.com/2008/05/21/usb-xubuntu-804-persistent-install-from-live-cd/

    It’s pretty easy, no special linux skills are needed, just double check which device you are formatting 😉

    If you plan to use some part of the stick for other stuff, both on linux and on windows, keep in mind that windows got problems with partitions on removable media. Therefor the partition for random stuff has to be the first. (and fat formated of course )

    setting up Wlan (Acer Aspire 5920g)

    May 2, 2008

    My laptop(acer aspire 5920g) has built in wifi(Intel Wireless WiFi Link 4965AGN). The OS is Debian GNU/Linux, though it should work with other distros, too.

    The Kernel module was already installed out of the box, but this one didn’t work for me, at least ifconfig and iwconfig didn’t show a wlan device. Thus I decided to compile the newest version myself. The sourcecode can be downloaded under click. To compile properly the kernel source/headers have to be installed. The rest is just some make, make install, make load routine. Follow the url above for more information.

    The next step was to set up the gnome network-manager. (packages: network-manager and network-manager-gnome)

    now edit /etc/network/interfaces and comment out all interfaces beside the loopback interface, otherwise the gnome network-manager will not work correctly. Now there should be an icon beside you clock at the top panel. Click on it to see the networks that are accessible. Choice one to connect. more information can be found here.

    The network keys will be stored in the gnome-keyring. Therefore you will be prompted on every bootup to type in the password for the keyring. This can be avoided with the following steps:

    • install the package libpam-keyring.
    • now edit /etc/pam.d/gdm by adding the following lines at the end of the corresponding blocks (‘auth’, ‘session’)
    • auth            optional        pam_gnome_keyring.so
    • session         optional        pam_gnome_keyring.so  auto_start
    • now edit /etc/pam.d/passwd by adding the following line at the end of the password block:
    • password    optional    pam_gnome_keyring.so

    The next time you boot there will a checkbox. select it as the last step.