Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

I just stumbled upon a nice way to enhance the bash debug trace output format (See here for the source).

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

This website unfortunately got a larger number of dead links when it was restructured. Seach engines don't like this. That's why I wrote a go program which helped me to locate the pages with dead links and also creates a sitemap.

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
I planned to describe how to install the Python plugin pydev in Eclipse. But then I found following page which has a nice and complete  description already. mysqldb can be download from here.See links below how to install mysqldb in eclipse.
 
Links:
 
Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

I just faced an issue when I tried to start a bash script which actually updates itself if there is a newer script version available and then calls itself again - but now the updated version with the same invocation parameters. This script update should happen transparently for the script user so all the time the script is invoked the latest script version is used.

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

It's very useful if your Raspberry can trigger events based on time and sunset and sunrise. That's why I did some investigations on this and finaly found two APIs in the internet which allowed me to write a Python script to calculate these values very fast. gneadr found another interesting variant which I modified a bit.

 

User Rating: 3 / 5

Star ActiveStar ActiveStar ActiveStar InactiveStar Inactive
I just faced an issue I thought should be easy to solve. I wanted to know which Linux distribution a bash script runs on. There exists a proposal of the FSB (Free Standards Group) to implement lsb_release which delivers all the info.Unfortunately it's not implemented by all Linux distributions so I installed various distributions on VMWare to get a clue how to write code to extract the Linux distribution. Finally I wrote a bash script and python script to extract the Linux distribution.

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
That's an uggly message in Eclipse when you use Pydev. In particular when the Python code runs successfull even there is this message. It took me quite a while to figure out how to get rid of this annoying message and to get context assist for the modules.That's the way I solved the issue:
Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
From time to time people ask in foren how to extract the network utilization values of fritz 7390. Some time ago I found a page of AVM where they described in detail the algorithm how to authorize with java (The description is in German but the Java code is self explanatory).
 
I used the java program code to create a prototype in python. This way you can read also other webpages of fritzbox. Use and extend the code if you want. There also exists a bash prototype with curl. If you use go just visit this page.
 
For another nice source of information about hard- and software about AVM and Fritzbox see Hemmerling: FRITZ!Box.
Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

Important data has to be backed up in professional environments and even at home where you have important photos, videos, documents, eMail etc which you don't want to loose. There exist a lot of tools on Linux (rsync, rsnapshot ...) to create backups. From time to time you should check whether the backup is identical with the original. It's uggly if you detect the backup is not complete when you actually need the backup.

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

A lot of time you have to split a string into pieces. There exist various ways to get it done. For example you can use sed or grep with a regular experssion. But there are much more efiicient ways available by using plain bash:

Question: How to extract the first and second path from the given string s="someString:/path1/path2/path3/path3/test.bin"

Solution: /path1/path2

Use cut:

echo $(cut -f 2-3 -d / <<< "$s")

Use sed:

echo $(sed -r 's/[^:]+:((\/[^/]+){2})(.*)/\1/' <<< "$s")

Use plain bash and read:

IFS=/ read x a b y <<< "$s"; echo "/$a/$b"

Use plain bash and set:

IFS=/ eval set -- \$s; echo "/$2/$3"
Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive

I manage my code on a local git repository on my desktop. But I want to access the git repository also from my local laptop or via VPN from remote. This requirement needs to convert the local repository into a remote repository. I'm running a Raspberry as my LAN server which is online all the day and is a perfect git server.

There are a lot of articles in the net how to achieve this. Finally I managed to find my way to get it done. It's not difficult but you have to know what you have to do.

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
I learn Python right now and publish here all links I find helpful to get on speed with Python.
Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
Wie lernt man eine Progammiersprache? Indem man sich in die Syntax und Semantik einliest und parallel dazu auch gleich kleine Beispiele in dieser neuen Programmiersprache schreibt.
How do you learn a new programming language the most efficient way? Read about the syntax and semantik and write in parallel small programs in the new language. I wrote the following small Javascript program for this purpose. It scrambles characters of words according some rules. The interesting point is, that you still can read the text. I implemented the same logic here with Python and CGI. You also will find there additional backgroundinfo about the used algorithm. It's written to support German and English. If the browser language is German all Text will be in German. All other visitors will get the text in English.