geistreicher Papierkorb

Donnerstag, 16. Februar 2012

etckeeper-ng: Taking the distributed version control to the next level

Update:
A lot has changed since the last time i wrote about this project. First i moved the project to a different github.
Since the project and the code has gotten more complex. i separated etckeepr-ng completely from bashtools and spited up the functions in modularized files. Each function lives in his own file now.
So far i announced version 0.2.1 which is still to buggy for use in a productive environment although i fixed most known bugs i found.
I do have speakable commands now because they are more flexible to add than - options. Type "etckepper-ng help" to view all commands known for etckeeper-ng. There are however some new commands as you might have noticed already. With "reset" at least you are able to reset /etc to the last backed up commit. A smaller command is the "list-excludes" command which simply does a cat on your $EXCLUDEFILE.
Also i wrote etckkerper-ng it is able to parse Variables from the configuration file /etc/keeper.conf
There is a lot todo for now. So if you are a programmer and able to help to hack on etckeeper-ng you are welcome to check out the git repository and ask back for a push request. Also report bugs to me whenever you might find one.

Update:
Santas Hacking night :D
I got the -f option working for backup one single file. I strongly recommend using this for doing backups now every time you change a configuration file. It's a lot faster to backup just one file instead of doing this for the whole /etc all the time. Also this might be more secure since you only need to backup files which you are sure about. Before doing a backup use -c option to verify what has changed After verifying these changes add those files to the backup and be certain this changes are ok.

Update:
fixed some bugs in the Script today. Also the Script detects a change with the -c Option, the diff is logged to a logfile. So you can see what has changed.
I have completely disabled the -r Option though since this was highly unusa
ble.

Hi girls and guys,

today i present you with a new incarnation of the etckeeper. My Script etckeeper-ng rsyncs the /etc directory into a backup directory. As usual you can find the etckeeper-ng in my github directory and get it from there.

By default the Script syncs the /etc to /root/.etcbackup/. You can change this by editing the $BACKUPDIR variable in the script.

After initializing the Script with -i option it saves a copy of /etc to /root/.etcbackup/etc and a file /root/.etcbackup/content.bak which contains the permissions user and owner of every file in the original /etc directory. All files under $BACKUPDIR than gets under version control by git.

Whenever you have done some changes in the configuration files, you can check them in and commit them to git by using the -b option to etckeeper-ng. The Backup function takes a little bit longer though, since the script also tests whether any permission or ownership or groupship has changed. In this case the Script will ask you, if you would like to restore the original permissions or commit the changed permissions and store them in the content.bak file.

You can list your commits by using the -l option.

However you will be notified that you should define some files like /etc/passwd or /etc/shadow that should not be included in the backup. You can define the /etc/passwd
file from being backed up by issuing the Script etckeeper-ng -e passwd. You have to give the relative path from /etc to say which files you wish to exlclude from being backed up. This will create a file /root/.etcbackup/excludes which will be read by the rsync programm with the --exclude-from option.

Checking if someone has something changed can be archived by using the -c option. This will create a second copy of the backup directory and will rsync the /etc to this particular second copy. The directory can be set by editing the variable $COMPAREDIR. The script will use git status -s and a check function for the permissions to check against content.bak if the user, the group and the permissions of all files are genuine.

If someone or yourself by accident change the permissions of a particular file you can reset this by using the -C option. Note: It's a capital C.

And finaly restoring the /etc directory can be archived by using the -r
were you can use HEAD restoring from the latest commit or the md5sum which is listed after "commit" when you using -l

Hope this script makes the live a little bit easier for you.

And please tell me if you find any bugs.


That's all folks.

Dienstag, 7. Februar 2012

Sind wir jetzt per Sie?

Gut dass sich ein Laden der sich hauptsächlich von Arbeitslosen ernährt ironischer Weise "PerZukunft" nennt kann man vielleicht noch irgendwie verstehen. Drinnen kann man, ganz nebenbei gesagt auch meinen Namen nicht korrekt aussprechen. Werde abwechselnd von den Damen Herr Prumps, Herr Prost oder auch gerne mal Herr Ropst gennannt.

Aber diese Per-siflage geht draußen auch weiter. Als Alternative sehe ich auf einem Plakat dass vor allem ein "Erfolg per Hochschulstudium" gebraucht wird, während ich in einem U-Bahnhofe "per Kamera" überwacht werde.

Schnell fahre ich mit der U-Bahn in die Bibliothek wo man mich fragt, als ich ein Buch vorbestelle, ob ich denn "per E-Mail" darüber Bescheid bekommen möchte wenn dieses aus dem Magazin verfügbar ist. Es ginge auch "per SMS" sagt man mir, während ich mich frage ob es nicht schöner klingt, wenn man mir dieses auch mittels einer E-Mail mitteilen könnte.

Das Buch unterm Arm komme ich noch einer Zahlungsaufforderung eines größeren Onlinehauses nach, welche ich"per Rechnung" erhielt und bin froh darüber das die Überweisung "per Sofort" geschieht. Das dass "per" hier sogar völlig sinnlos ist, sei nur nebenbei erwähnt. Danach trinke ich einen Kaffee am Stand eines Bäckers "per Tasse" . (Kein Witz) 2 Anrufe in Abwesenheit von jemanden der mir sowie so schon längere Zeit auf den Keks geht. Er erklärt mir er hätte mich nun schon die ganze Zeit über versucht "per Handy" zu erreichen. Ich antworte: "Na dann ist ja gut. Und ich habe gedacht, du hättest versucht mich auf dem Handy zu erreichen."

Mein Freund der gerade ein Reise per äh entschulden Sie mich nach Indien macht schreibt mir:
dass er nun per Boot auf einem Fluss zu Monkey Island fahre. Ich korrigiere seine Grammatik und ernte von jemanden dafür ein +1. Wenigstens etwas.

Samstag, 28. Januar 2012

Todo List in a Nut Shell

Update: Now just type todo to see your todo list. The old -s Option is still there. I also fixed a Bug which causes the marking more than one line to fail when you use the last line of your todo list as the last argument or rather specific when you use the n-1 last lines of n marked entries as arguments. Thanks to my friend sebastian who gave the crucial hint for fixing that issue.

Update:
I fixed some bugs in the script. Entries which are marked as done are moved to the bottom of the $TODO_LIST_FILE. The Script checks if arguments to -u or -x or -m are valid integers and if these lines really exists in the $TODO_LIST_FILE. It should now be impossible to give line 23 as argument when such line does not exist. The Script will exit with exit status 1 if one of the arguments is not valid. This feature will give you more protection from destroying your todolist.
Some rather minor options; the -B Option (backup your todolist) and the -R (restore your todolist from backup); have been added.

Update:
I spend a little time in the train to implement new features in the todo.sh Script.
1) With -m (modify) you are able to edit or correct entries. You need read and gawk
to get this working.
2) With -p you are clearing the todo list. All(!) Entries getting lost. And with -pp you even remove
the $TODO_LIST_FILE.

Update:
The newest version does'nt need a new entry enclosed in "". I fixed this issue on weekends.

Update:
You also can unmark and mark more than one entry at a time. Just list them as arguments separated by spaces.

Hi girls and guys,

on weekend i have had a little bit time to clean up my github repository and work on new scripts. so i manged beginning one of my most usefull scripts.

When i had the idea i was writing my things i had to do in a simple textfile using the editor of my choice (vim). so i was wondering whether i could maintain a simple todo list on my machine without having firing up an editor every time. So i came up with the idea to write a small script using sed and grep which would accomplish this task.

Simply download the script or clone my github repository. I recommend putitng the script to /usr/local/bin and link the script to /usr/local/bin/todo.

And this is how it works: You simply add a new entry to your todo list by typing:

todo
-a My new task

Since you don't have a file for your todo list yet you will be asked creating a new one. This is just my way of doing things, because i think that no actions should be taken without the user knowing whats going on.

More entries can be added the same way:

todo -a just an other task
todo -a oh no not again

You now have three open tasks in your todo list which can be seen by typing:

todo -s

1 new task --> [o]
2 just an other taks --> [o]
3 oh no not again --> [o]

if you have finished one task you can mark this particular task as being done using the line number and the -x option:

todo -x 2

You can reveal this by using the -s option again:

todo -s

1 new task --> [o]
2 just an other taks --> [x]
3 oh no not again --> [o]


--> [x]
indicates for you that the task with line #2 has been marked as one you managed to finish.

You can inspect only those tasks which are open by using the -o option and those which you have marked as being done by using the -d option.

Lets say the task has come available again and you need to do this task again. You can readd this task to your open task by using the -u #N option, where the parameter #N is the number of the line you want to readd.

And finaly todo -r clears all (!) task you have marked as finished.

Although i will improve this script and will add more features it works pretty well in this early stage and i welcome you to comment and improve my work.

that's all folks

Dienstag, 17. Januar 2012

Testing and ranting openSUSE 12.1 RC1

Update: openSUSE 12.1 has now been stable since a while. Works perfect on my Thinkpad. Filed a Bugreport on systemd. To disable the tracker daemon use Alt+F2 and type gnome-session-properties. Here you can disable the tracker daemon.


Update:
Filed a bug about high RAM consummation for 12.1. Will not upgrade to 12.1 on my main machine.

First things first SuSE 12.1 is still not ready and i just tested it out on my Desktop PC still having
a backup of my old 11.4 version. I am yet unsure whether i want to change or not. At least on my Main Thinkpad Machine i will still use the older 11.4.

There is a bug affecting Software changes and keeps the Yast-installer crashing if you use version 12.1 rc1. But as long as you keep going with the default installation everything else will go fine. In fact finally i don't have to manage my external encrypted devices setup after i finished the installation. This all goes fine in the current installation procedure.

Yast doesn't look much different from the previous versions but they changed it in the details. For example during the installation when showing how much GB are going to be installed they changed to 4 digits after the "," so you dont stare at 2,0 gb to install for like 2 minutes and you actually can see more details when it says: "2,0423 to install".

But there are some bugs in the packages. When you install a package you often
get a message like this:

"/usr/bin/desktop-database --defaults-list unknown option"

Also i found a couple of new Yast modules which are looking pretty interesting and you are able to add sax3, the reborn sax. Since Sax3 is still under development you shouldn't install it if your monitor settings are fine anyway. For example the Snappper module to create filesystem snapshots for ext4 and btrfs seems interesting but did not load correctly.

The first time i tried opensuse 12.1 rc1 i was confronted with the fact that they now have a lot of new stuff that has changed in 12.1. Well what was the reason for there is no .0 release any more? Right so people don't believe that there is a major change here.

Changing from sys-V-init to systemd is in fact a big change. And the best documentation i found about this is here . The startup of the computer is very fast. My pc boots up in notime now and so is the change to an other runlevel. But however this doesn't bother me since i usually do not reboot often or change runlevels. You do this mostly for maintenance reasons, right? However changing to systemd was not the best choice. In the description it says its backwarts compatible to sys-V-Init. Well its not. For one reason there is no shutdown -F any more. which forces the
check of your filesystem when you boot up next time in sys-V-init shutdown. I think this is not acceptable. A workaround for this would be setting the check interval to 1 with tune2fs like this:

tune2fs -c 1 /dev/sda1

and set it back to normal after rebooting like this:

tune2fs -c 60 /dev/sda1

For an other reason, this might be only affecting 12.1 RC1 switching from runlevel 5 to runlevel 1 will freeze the system at least if you are using gnome3 with proprietary driver like described at the bottom.

It still uses the patched Version of Grub1 which i am fine with since this is easier to administer.

Of course i installed gnome3 and was unhappy at first but than i discovered the nice gnome-shell extensions and i loved it. But gnome3 is much more RAM consuming than the 2.x one. With 2GB RAM and 2GB Swap it uses 60% out of 800 GB RAM and nearly 500 GB Swap.
You can install the package gnome2-look-and-feel to get the gnome2 look and feel back if you don't like gnome3 with gnome-shell.
However an other problem is that Windows don't size correctly so that you are leaving with guessing what "Toog" or "Men" could mean. And how do you change the icon theme? You have to install a tool that allows you to access the "Advanced Settings" And if you don't know that the menueditor is called alacrte its not possible to change the menu items by right klick like in gnome2. Also anyoing everytime you log in there is this message you have to clickaway multiple times for every device that gets mounted during start up. If you like me and have like 5 mounted devices this can get very annoying. And how do deactivate this tracker thing. i dont want the daemon to itch my hard drive all the time. Uninstalling it will also uninstall the whole gnome3-session. WTF!!! I am looking for a way to get this disabled on startup: All i know for now is how you can create autostart items by creating proper files in ~/.config/autostart/
and that you can disable the tracker dameon by using tracker-control -t all
Synapse program is much much better than the gnome-do program though and is called to live with the same shortcut.

I miss the Terminator Terminal which i used to monitor the system with tools like sar, htop, iotop and iftop and tail -f /var/log/messages.

An other thing which does not affect servers but does in fact the user is that it needs a little effort to get the nvidia propriatary driver running for gnome3. With the kind hint of zaitor from the irc channel #opensuse-gnome i was able to finally install it. asuming you already have downloaded the driver follow these steps will install the driver:


Nvidia driver is running

(1) Install
gcc make and kernel sources and all dependecnies like this zypper ref && zypper in kernel-source make gcc

(2) change to runlevel 3 and execute the installer like this
./NVIDIA-Linux-(arch)-255.05.09.run. You will be asked whether a file in

disable-nouveau.conf in /etc/modprobe.d should be created. answer this with yes and leave the installer for now.

(3) Disable the noeveau using cat /etc/modprobe.d/disable-nouveau.conf >> /etc/modprobe.d/50-blacklist.conf

(4) in yast or with zypper uninstall the nouveau driver.

(5) in yast --> System --> Editor for /etc/sysconfig search for kms and change the value from yes to no.


(6) restart the system. init 1 and init 3 wont work with systemd since the old driver is still loaded

(7) change in runlevel 3 and execute the installer again like in (2) this time the installation should be finished without problems. Answer with yes when you are being asked whether /etc/X11/xorg.cong should be written for you.

(8) add the group video to the system user gdm and the user you want to use. In the case the usersname is geeko:

usermod -A video gmd && usermod -A video geeko

(9) change in runelvel 5
That's it. now you can use the better nvidia driver with better perfomence at 1% cpu load instead of 20% cpu load. Remember that you have to redo this procedure every time you get a kernel update.

That's it for today. ;)

Montag, 16. Januar 2012

Alle meine Podcasts

Nach längerer Zeit mal wieder einen kurzen Artikel in meiner Muttersprache und ein Update für Podcastempfehlungen:

Hier ist nur die Liste. Einfach mal reinhören. Ich fühl mich nicht berufen, hier Bewertungen oder Empfehlungen auszusprechen. Alle Podcasts haben bei mir weitgehend TV und Radio ersetzt.

Fnordfunk (de, Audio)

CRE (de, Audio)

Quarks und Co (de,Video)

Extra3 (de, Videoo )

Linux Outlaws (en, Audio)

Raumzeit (de,Audio)

Hr2 Der Tag (de,Audio)

Elekrischer Reporter (de,Video)

Not Safe for Work (de,Audio)

Anne Will Audio (de,Audio)

Alternativlos (de,Audio)

Hoaxilla (de, Audio)

Wrint (de,Audio)

Retrozirkel (de,Audio)

Elementarfragen (de,Audio)

PaulDotCom Security Weekly (en, Audio)

MathCast (de, Video, dead)

Social-Engineer Podcast (en, Audio)

Metronaut (de,Audio)

Mythen - Michael Köhlmeier (de, Video)

WhoCast (de,Audio)

Luftpost Podcast (de, Audio)

Citizen Reporter (en,Audio)