- Details
- Category: Programming
- Hits: 6885
I just stumbled upon a nice way to enhance the bash debug trace output format (See here for the source).
Read more: bash - Nice way to enhance and prettify execution trace enabled with -x
- Details
- Category: Programming
-
Also available:
- Hits: 2348
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.
Read more: Offline website crawler creates a sitemap and detects invalid links
- Details
- Category: Programming
-
Also available:
- Hits: 6108
- Details
- Category: Programming
-
Also available:
- Hits: 4804
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.
- Details
- Category: Programming
-
Also available:
- Hits: 9415
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.
Read more: Calculate geolocation (Longitude and latitude) and local sunrise and sunset time
- Details
- Category: Programming
- Hits: 31534
Read more: How to find out which Linux distribution a script runs on
- Details
- Category: Programming
- Hits: 21566
- Details
- Category: Programming
-
Also available:
- Hits: 8363
- Details
- Category: Programming
-
Also available:
- Hits: 5583
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.
Read more: Which tools help to find differences in directories
- Details
- Category: Programming
- Hits: 8270
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"
- Details
- Category: Programming
-
Also available:
- Hits: 7062
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.
Read more: How to convert a local git repository into a remote git repository
- Details
- Category: Programming
- Hits: 5688
- Details
- Category: Programming
- Hits: 5252
Page 1 of 2

