OpenWRT

OpenWRT is one of my most "beloved" operating systems ever. I am using it since 2006, already. It is very small (>= 4 MB), light weight and therefore an excellent choice for embedded computing or very small appliances. I have used it on several occasions ("prototype") in my blog, but never actually gave a heads up in terms of "What is it?" - So, let’s get rid of that:

OpenWRT is a debian linux derivate especially made for routers. OpenWRT does derive from the famous Linksys WRT series, which were based on Linux. One of the founders found out about that and got Linksys (by pointing out about the caveats of the used Linux GPL License) to the point of releasing the source code (except the wifi drivers). From the point on, OpenWRT was founded and the project began to write an own "router linux". On the course of that adventure, several forks of OpenWRT were founded (i.e. FreeWRT) - but in the end, OpenWRT remained "THE" third hand firmware for your router. Nowadays OpenWRT does support a load of routers out of the box, with famous titles like the Linksys WRT Series or even hardware like the Seagate Dockstar (which was an sort of NAS Appliance for Seagate Hard drives).

But the project did not stop on providing an firmware: With ipkg and later opkg, they also did offer packages to configure your own router experience. By using an simple build system, nearly everyone is able to configure his personal firmware and setup the things he likes. While in the beginning, only router related stuff (like wifi tools or pppoe dialers and such) was available, also big programs like recent mysql, web or file servers are found in the packet manager.

Using this little, flexible OS in cooperation with the GPIO ports of an router, software defined Inputs and Outputs, you can use your router to switch on lights, close your garage door or sound an alarm as soon as some sensors tell your router to do so. Especially with the appearance of the Raspberry Pi and its GPIOs, fast CPU, big RAM and storage, this could be the OS of your choice.

So the next time you think about throwing away your old router, check www.openwrt.org and see whether you can make it do some cool stuff.

You will be surprised.

Raspberry Pi Con "Pi and More"

At the 23. of August 2012, the University of Trier held the first Raspberry Pi Convention in Germany. It was a little, but awesome gig with about 30 IT Students and other interested people.

The main idea was to rise the awareness for the new microcomputer, called "Raspberry Pi" which combines an 700 MHz ARM Processor, 512 MB of RAM, Full HDMI Output, Audio, Ethernet and USB into an very small and affordable package (about 35 US Dollar). With this microcomputer, and its General Purpose Input and Outputs (GPIO), pupils can actually have a "hands-on" (in) physical computing. That means: Connecting software (i.e. Python, Perl, C programs) with the real world. For example: Controlling LEDs, driving motors or even react on buttons, attached to the GPIO port. Combining these possibilities into a small and affordable package started a big hype about this little computer, long before it was even available to the public.

But now, about half a year after the release, multiple versions and even more Operating Systems started to appear. Even a special modified Debian version, called Raspbian is ready to download. There are special versions of Arch Linux, Fedora, XBMC (a Multimedia Entertainment Center) and even a special version of OpenWRT is under development. During this meeting, the participants had the opportunity to listen to speaks (an Intro to the RaspPi, a Speech about Cross compiling and the I2C Bus System) and workshops (driving an LED, building the so called "Ladder Game", getting a Nokia 3310 LCD Display to work as Output). The overall response was great as well as the conference itself and I would wish to have additional meetings in the future.

On this occasion I also want to thank the organization of the PiAndMore, especially the Fachschaft of the University of Trier and Daniel Fett. You made an awesome job. Please keep it up.

Additional pictures and infos can be found on my JCTixx Project Twitter Account @JCTixx

Official Stuff: Facebook Event (https://www.facebook.com/events/330497597037314/), Twitter Account (@PiAndMore), Google Site (https://sites.google.com/site/piandmore/)

[Samba] Windows Client can't access Unix Samba Share KB2536276

On 16.06.2011 Microsoft fixed an Security Issue with Samba which ended in Windows Users beeing unable to access Unix Samba Shares by using Plain Text Authentication.
By removing Security Update KB2536276 and rebooting you can enable your client again - or you patch your samba server, which is the real source of error - Microsoft did just fix an flaw.

https://bugzilla.samba.org/show_bug.cgi?id=8238

https://bugzilla.samba.org/attachment.cgi?id=6593

Infos taken from:
http://answers.microsoft.com/en-us/windows/forum/windows_xp-windows_update/kb2536276-windows-xp-pc-get-system-error-58-when/d9dbdde5-2666-4423-b47c-fbdb80b995d9

[PROCMAIL] Anonymized E-Mail

Feedback is always important, especially if its about working with other people.

For our little (now over 10 year lasting) monthly meeting we wanted an Mailaccount to which people could send ideas and other stuff - but before the Mail would be forwared to the "heads" accounts, we wanted an function to strip off the senders email address - as we wanted to give them the freedom of sending anonymous feedback with their current Mailaccounts (yeah, we won't be able to answer because of that - but its ok!).

So I came up with that little .procmailrc File. It will copy the mail, strip off the sender and replace it with its own and send it to the mail@domain.com Account.

I used ( http://www.uibk.ac.at/zid/systeme/mail/procmail/extend_procmail.html#Weiterleiten3 ) to get to that point. Thanks guys for writing down that infos!

 

LOGFILE=$HOME/.procmailrc.log
VERBOSE=no
:0 cw
* ^Subject:.*
| formail -k \
-I "To: mail@domain.com" -X "To:" \
-X "Subject:" \
| $SENDMAIL $SENDMAILFLAGS -t

[Linux] Ubuntu Root Server to VMWare BareMetal Recovery

I got an root server on the net hosting an important website and am doing backups on a daily base using Tartarus ( http://wiki.hetzner.de/index.php/Tartarus_Backup-Konfiguration ). But as we all know: Backups are only worth a penny if they really work and are usable after an crash. Therefor I did try to recover the "dead called" machine onto BareMetal - or at least BareAir - as it was an VMWare Machine I used.

PreWork:
- Creating VMware Machine with same background and partition structure
( 40 GB HDD: Swap, Root, Boot Partition )
- Install Ubuntu 10.04.2 LTS

Recovery:
- Boot with Linux Live CD
- mount /dev/sda2 (my Root Partition)
- Recover Tartarus Backup curl ftp://USER:PASS@YOURSERVER/home-20080411-1349.tar.bz2 | tar xpvj -C /mnt/restore
- mount /dev/sda1 (my Grub Partition) and maybe recover Tartarus Backup of the Partition (most likely that should be do more harm than good... so... maybe leave it 😉 )
- Check UUID of the Partitions with blkid
- Change blkid within /etc/fstab
- Reboot

Done... or most likely 😉

PS: Maybe you will need to remove /etc/udev/rules.d/70-net-persistent and reboot because of the broken Ethernet Card...

[Linux] Multiplexing Screen

And now an nice tip by Darren Kitchen of Hak5!
( www.hak5.org )

HakTip: Multiplexing Screen Sessions

What’s more wicked than a screen session? Two screen sessions! As we’ve talked about recently the unix command Screen is a great way to maintain bash sessions from multiple SSH clients without losing your work. My favorite shortcut after invoking the “screen” command is CTRL+a followed by “S”, which splits the screen horizontally in two. Use CTRL+a then Tab to switch between the views. Debian users get the added sexyness of vertical split by hitting CTRL+a then Pipe.

[Linux] Screen

Hello there, this a 5 Minute Tutorial to screen.
What Screen is?
Well screen is an old unix / linux terminal programm with which you can create multiple virtual "screens".
You can switch between these screens and also can disconnect from them.
Especially useful: If you start an daemon within screen and disconnect from it,
you can reconnect anytime and see what its doing.
Or you can setup a screen session, detach and close your SSH.
If you reconnect, it will still be running.
Oh, and it will be also there and running if your connection drops.

My little list of important Screen Commands:

screen // Create a Screen
screen -ls // List active Screen sessions
screen -r // Resume Screen, if multiple, enter Screen Number from ls after r

CTRL A C - create new tab
CTRL A P - previous
CTRL A N - next
CTRL A D - detach from Screen

To close and exit a screen, just type exit within the screen session.
To start an script in the same folder "daemon like": screen -A -m -d -S SCREENSESSIONNAME ./SCRIPTNAME.sh

Easy, ain't it?

Webconverger - Install ISO to HDD

Just found some old notes, dunno wheter they still apply but its worth a try.

1. Make an Image of your choice by the creator. I made an post about that. Copy the resulting ISO to an USB Stick.
2. Boot in the new PC with Ubuntu or Knoppix Live DVD. Mount the USB Stick.
3. Copy the ISO to the Harddrive. With dd.
dd if=webconverger.iso of=/dev/sda
4. Reboot, thats it

[OpenWRT] Build your own image on Ubuntu 10.03

I'm a huge geek when it comes down to OpenWRT.
I love the style of small little router boards with not much power consumption and still big impact and power.
I have been registred on OpenWRT Forums since 2006, and thats also the time I'm already working on it and doing (weird) stuff with it.
And actually I just plainly love that small debian derived linux.

And thats why most of you would be wondering why I never downloaded the build enviroment and build an image myself.
Actually, I have to face the same question. Because, In fact, its very easy to build an image from source to your own like.

I was thinking about writing an long big blog entry about this topic, but actually, its awesomly well documented within the OpenWRT Wiki, so I just give you the link and encourage you on building your own images: http://wiki.openwrt.org/doc/howto/build

But for all who want it short for Ubuntu 10.03, here are my notes:

install req:
apt-get install build-essential asciidoc autoconf binutils bison bzip2 \
flex gawk gettext libncurses5-dev libz-dev patch unzip zlib1g-dev subversion

download stable:
mkdir OpenWrt/
cd OpenWrt/
svn co svn://svn.openwrt.org/openwrt/branches/backfire

download and install feeds:
Before downloading feeds (additional predefined package build recipies for OpenWrt) you
can check which sources you want to include. Just edit feeds.conf.default in your base directory.
Then start the download with
./scripts/feeds update -a
install with
./scripts/feeds install -a

Building Process

1. Updating sources via Subversion
## Here, backfire is the directory name of the current release branch you're tracking
cd OpenWrt/backfire/
svn up

2. Updating package feeds
./scripts/feeds update -a
./scripts/feeds install -a

3. Creating a default configuration (if necessary)
make defconfig

4. Configuring the image(s) to build
make menuconfig

5. Building the image
make

copy images:
cd bin/
ls */

cleaning up
make clean

cleaing everything, erasing build images:
make distclean

If you need own files compiled into the image, put them to: OpenWrt/backfire/files

How to disable failsafe:

Edit "package/base-files/files/lib/preinit/30_failsafe_wait"
- FAILSAFE=
- pi_failsafe_net_message=true
- preinit_net_echo "Please press button now to enter failsafe"
- pi_failsafe_net_message=false
- fs_wait_for_key f 'to enter failsafe mode' $fs_failsafe_wait_timeout && FAILSAFE=true && export FAILSAFE
+ FAILSAFE=false
+ #pi_failsafe_net_message=true
+ #preinit_net_echo "Please press button now to enter failsafe"
+ #pi_failsafe_net_message=false
+ #fs_wait_for_key f 'to enter failsafe mode' $fs_failsafe_wait_timeout && FAILSAFE=true && export FAILSAFE