Wednesday, November 25, 2015

Source management tool

Recently I got Linux From Scratch book in my hands and I've built my own distribution. It was a great experience and I've learned a lot about core Linux system. Either way one simple question came to my mind: how can I manage all those packages from source archives?

This topic is mentioned in the book where a few methods are briefly described. Based on this knowledge, I've created a simple package manager.

Creating a self-signed certificate with own CA

This post is a short howto for creating own certification authority (CA) and generating and signing certificate with this CA.

Sunday, May 3, 2015

Clonezilla UEFI boot

Clonezilla is awesome tool to backup your data. It has also released images able to boot from UEFI loader. This post shows how to create bootable USB from iso.

Friday, May 1, 2015

Howto: join mp4 files

To join two or more mp4 video files you can use ffmpeg utility, just follow this simple steps:
  1. convert mp4 to ts (transport stream) format
  2. ffmpeg -i file.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts file1.ts
  3. join several ts files into one mp4
  4. ffmpeg -i "concat:file1.ts|file2.ts" -c copy -bsf:a aac_adtstoasc file12.mp4
  •  conversion from other formats to mp4
  • ffmpeg -i fileOLD.webm -strict -2 fileNEW.mp4

Tuesday, January 27, 2015

Dynamic shell prompt

Dynamic shell prompt can change it's form according to some events going on on terminal. It can change e.g. color, if the previous command execution was unsuccessful, or it can display various information.
In this post, there is an example of such a prompt. It displays information, when you enter specified working directory.

The picture below shows my configuration:

This is achieved with setting a variable PROMPT_COMMAND which is evaluated every time you run a command. In my case, there is a condition, which looks for matching path.



# dynamic PS prompt
export PROMPT_COMMAND='PS1="$(if [ "$(pwd | grep /mnt/storage/backup_git)" ]; then echo "\\[\\033[32m\\]backup_git "; fi;)\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] "'