Swarm of robots

With this swarm of robots my dream might come true one day. Well I guess it is a pretty common dream. A swarm of small cleaning robots! Wouldn’t that be brilliant? Hundreds of small helpers cleaning up when we are at work. OK, the vacuum robots we can buy today are not bad, but I want something than can clean on my desk and the windows as well. 

The internet of things, an IPv6 light-bulb and thoughts about the future.

I just read this article about an IPv6 enabled lightbulb http://www.theregister.co.uk/2013/03/29/zigbee_ip/. A good example for the internet of things how the number of interconnected devices will explode in future. Today we see only the very beginnings of it. It seems normal to us that our smartphones are connected to the internet, but only 20 years ago this was still since fiction. I am trying to imagine how the wold will look in 20 years from now. What will be the technology or service that will change the wold? 

Two possible areas where this could happen:

The first one is a revolutionary user interface. Maybe google glass or this contact lenses are already early signals we see. I can imagine that we will have a break through idea here in the next twenty years, and I am looking forward to it. Maybe we can get rid of keyboard, mouse and monitor altogether.

The second area I see as potential candidate is a service that is utilizing the huge amounts we create every day in a clever way. What this could be I cant really imagine, but it seems to me that we  have this kind opportunity for the first time. And I am pretty optimistic that someone will have a brilliant idea and implement it. 

So what do you think, what will be the next big thing?

How to recover lost files

I am assuming you do not use any disk encryption here, that would require another procedure to follow.

I use Ubuntu as OS.

First of all, if you lost an important file, stop using the file system the file was on NOW. The data you lost might still be on the disk, but the longer you use the file system, the higher the chances are that the data gets destroyed. So unmount that file system or switch the system off now.

I will show how data can be recovered that was on a 2GB USB stick, but in principle that works for HDs as well. It just takes much longer, and you need much more disk space for recovery.

First thing I do is that I create a disk image of the disk. That way I do not accidentally destroy any data that might still be there.

I have stored files on this stick and then reformatted the stick:

IMGP1176.JPG

test.txt

Now the file system does not know anything about the files anymore. However the data has not been overwritten and is still on the stick.

Lets try to recover them. I need to recover them the hard way, a simple undelete will not work.

I dump all data from the USB stick /dev/sdi to a file.

dd if=/dev/sdi of=USBimage.raw

OK, the data is in a secure place now.

No I try to recover the file. I use the carving tool foremost. Foremost scans the disk for known start and end markers of several file types.

I will now use foremost to reconstruct the file

foremost -i USBimage.raw -o foremostout

And like a miracle the file was reconstructed in foremostout/jpg/00007750.jpg

This works quite well for all files with a clear start and end marker. Look into the foremost man pages for more info.

A bit more effort is needed to restore a simple txt file. Here we have no clear start and end markers.

My favorite way is to extract the strings from the diskimage and then restore the files manually.

strings USBimage.raw > strings.txt

I open strings.txt with vi and find the text I was looking for “This text is very important to me.”

Good luck with recovering your data!

Setting up Hadoop on a single node

Here how I set up my hadoop test/development environment on Ubuntu 12.10. I used a single-node pseudo-distributed config. That way I can test and develop my apps on a very small cluster.

  1. Donwload the latest hadoop code from http://hadoop.apache.org/. I use hadoop-1.1.2.tar.gz
  2. I decided to create a dedicated hadoop user and group. I hope that way I don’t accidentally mess up my system or delete user data.
     Bash |  copy code |? 
    1
    addgroup hadoop
    2
    adduser --ingroup hadoop hadoop
    3
    su - hadoop
    OK, now you are logged in as hadoop and we can start the install
  3. Extract the hadoop code and configure it for single-node in a pseudo-distributed mode
     Bash |  copy code |? 
    1
    tar -xzvf hadoop-1.1.2.tar.gz
    2
    ln -s hadoop-1.1.2 hadoop
  4. Configure .bashrc to add the required environment varsadd this to the top of .bashrc
     Bash |  copy code |? 
    1
    export JAVA_HOME=/usr
    2
    export PATH=$PATH:/home/hadoop/hadoop/bin
  5. now configure the hadoop config files in hadoop/confcore-site.xml
     XML |  copy code |? 
    1
    <?xml version="1.0"?>
    2
    <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
    3
    <configuration>
    4
     <property>
    5
             <name>fs.default.name</name>
    6
             <value>hdfs://localhost:9000</value>
    7
         </property>
    8
    </configuration>
    mapred-site.xml
     XML |  copy code |? 
    01
    <?xml version="1.0"?>
    02
    <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
    03
    <configuration>
    04
       <property>
    05
             <name>mapred.job.tracker</name>
    06
             <value>localhost:9001</value>
    07
         </property>
    08
       <property>
    09
             <name>mapred.local.dis</name>
    10
             <value>/home/hadoop/tmp</value>
    11
         </property>
    12
    </configuration>
    hdfs-site.xml
     XML |  copy code |? 
    01
    <?xml version="1.0"?>
    02
    <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
    03
    <configuration>
    04
     <property>
    05
             <name>dfs.replication</name>
    06
             <value>1</value>
    07
         </property>
    08
     <property>
    09
             <name>dfs.name.dir</name>
    10
             <value>/home/hadoop/hdfs/namedir</value>
    11
         </property>
    12
     <property>
    13
             <name>dfs.data.dir</name>
    14
             <value>/home/hadoop/hdfs/datadir</value>
    15
         </property>
    16
    </configuration>
  6. Now lets get ssh working. Leave the ssh key password empty.
     Bash |  copy code |? 
    1
    ssh-keygen
    2
    ssh-copy localhost
  7. Finally format hdfs and start the deramons

     Bash |  copy code |? 
    1
    hadoop namenode -format
    2
    start-all
  8. Now you can connect to the NameNode http://localhost:50070/ and JobTracker http://localhost:50030/

WordPress and the twitter widget

Some folks has ask me what I use to show my tweets. 
The answer is simple, I use the widget provided by twitter.
Here the step by step instructions how to include it on your wordpress blog.

  1. Go to twitter and open your settings. Select “Widgets” and then create new
  2. Modify the widget settings as you like it, I took the default settings
  3. Press the create button and copy the widget html code
  4. Now open your wordpress dashboard – Appearence – Widgets 
  5. Take the default “Text” widget and place where you like.
  6. Now paste the html code from the twitter widget into the text field. Done. 

Have fun!

WordPress and Jetpack Comments not working

It just took me an hour to realize that Jetpack Comments are not working on my site. To bad, it really is feature I would like to have. I googled around and found that it could be that the theme I was using is not working with Jetpack comments. So I switched over to 2012 and voila, now the comments are working.

So when you find that Jetpack Comments are not working on your site try to switch to another theme!

My (almost) silent PC

Some time ago the CPU fan of my PC started to produce some strange (and annoying) sounds every now and then. So I decided to replace it with a new one. I do not like PCs that sound like a starting Airbus, so I decided to buy a quiet one. Finally I bought a be quiet! Shadow Rock PRO SR1. This thing is big (98 x 96 x 158mm), but once I installed it I begun to appreciate it. It is really quiet and cools my CPU to 40°C almost without any sound.

I already had a be quiet! power supply Moneygram honoraires and an Asus ATI Radeon HD5450 Silence Graphics card installed. Together with a SSD drive my PC is now really silent. 

Forcasting the future

Since quite some time I am interested in forecasting the future. Seems this is something we are all doing every day without even realizing.

It starts when we set our alarm clock for the next morning. We then forecast that we will need some time to get to work, based upon our prior experience. Some times this forecast is wrong and we get stuck in a traffic jam. 

A more for reaching forecast we do when we plan the investment for our pensions. Here we implicitly forecast for next decade or even more. 

As shown in this two little examples we all do forecasting all the time. Actually we we cant plan anything without a forecast in the back of our head. To plan we need to make assumptions about future events. Based on these forecast we develop a plan to archive the desired result.

If you want to know more about that topic you might be interested in the following podcast  from Stephan Magnus Adventure Future