[2013-06-28] install sphere camera on CM 10.1 galaxy S3

  1. get the zip file from here
  2. copy it to your sd card
  3. reboot into the recovery loader (vol up + center + power for 10 sec)
  4. select install zip from sd card and install it.

Remeber, you have to install the zip again if you update your CM image.

[2013-06-28] python tell

Maybe you think that both examples would produce the same output, but the tell of the filehandler will give you a wrong output in the first version. This version is a bit faster but in this case also a bit inaccurate.

infh = open("bigfile")
print infh.tell()
for line in infh:
    # ...
    print infh.tell()
    line = infh.readline()
infh = open("bigfile")
print infh.tell()
line = infh.readline()         
while len(line) > 0:
    # ...
    print infh.tell()
    line = infh.readline()

[2013-06-28] save edited file in vim as root

If you start to edit a file as a regular user and realise you should have done it as root. You can still save the files as root:

:w !sudo tee %

or

:w !sudo tee new-file.name

[2013-06-28] xmacro on Ubuntu

Install it with:

sudo apt-get install xmacro

Record the macro:

xmacrorec2 > yourfile.txt

Now record your keystrokes and mouse movements, to end it just hit Esc.

To play it back, just run it using the text file like so:

xmacroplay "$DISPLAY" < yourfile.txt

Tip: In my case this wasn't enough because the replay was too fast. I just opend the txt file with an text editor and added some of these Lines:

Delay 1

Now it works like a charm :)

[2013-06-20] ninite - a simple autoupdate tool for windows ...

ninite is a simple autoupdate tool that even helps you to ignore ugly spam from updates like java. You can also choose what set of software you want to install and let ninite install it for you automatically.

[2013-06-19] yummly

Yumly has a nice way to search for recipes.

[2013-03-24] virtuelenvwrapper

install

$ pip install virtualenvwrapper

create env

$ mkvirtualenv env1

enable env

$ workon env1

You can find more information on readthedocs.org.

[2013-03-22] China nutzt Ubuntu

So cool das auch sein mag, aber wenn China jetzt Ubuntu as Standard nehmen, dann wird die USA viel Geld in die Hand nehmen um im Cyberwar diese Rechner anzugreifen. Je nach dem wer Tronjaner für solche Systeme baut, verkauft diese dann auch an Staaten die damit Ihrer Bevölkerung auflauern. Das wars dann mit der Zuversicht, mit Linux vom Staatstrojaner sicher zu sein :(

http://www.theregister.co.uk/2013/03/22/china_makes_linux_os_with_canonical_help/

[2013-03-20] sed 101

remove all lines where somestring does not occour:

sed -i -n '/somestring/p' file

keep only lines wehere stringa or stringb occours:

sed -i -n -e '/stringa/p' -e '/stringb/p' file

remove all lines with somestring:

sed -i '/somestring/d' file

[2013-03-19] autojump

first install it

sudo apt-get install autojump

then you need to source it

source /usr/share/autojump/autojump.sh

and better put it in .bashrc.

echo "source /usr/share/autojump/autojump.sh" >> ~/.bashrc

After some time you could jump quickly with

j <part of directory>