SS08 approaching

RWTHThe next semester is approaching (in fact: it starts tomorrow). I just recently finished all my exams for the last semester and was really happy with the 4 days of not having to worry about learning for the next one ;). Anyway, I’m glad the lectures start again since I’ll have much more freedom now regarding which lectures I’d like to attend/be tested in and also when to take the exams (which for students of CS are oral exams).

Another reason for this entry is that I wanted to test the new WordPress 2.5 Admin-Interface. It’s quite different but I think I’ll get used to it. Also I installed a plugin called “WassUp” which gives you a rough overview over your site’s visitors (if, like me, you don’t have access to the apache logs).

Backing up a git repository with git bundle

I have a git repository called ~/devel/ which is where all my development effort in various languages is stored (you can see that it’s not that much, otherwise I’d have separate repositories ;). I also occasionally merge projects that started in their own repositories into this one.

Anyway, while backing ~/devel/ to my new USB-drive i noticed that 1. the FAT32 partition seemed to mess with git, as git status showed _all_ of the files as changed and 2. i also backed up files which were in ~/devel/ but not in the repository (which is not what I want). I could have done something like git-archive or just backed it up without .git, but I want to keep the history.

In this case git bundle is what you want. git bundle was designed to allow transfer of git commits when there is no direct connection between repositories (i.e.: offline) but using patches is not an option because of the large number of commits and multiple branches. A git bundle is just one file which can be very easily created and again imported as it can be treated like another remote. A quick example:

jojo@dualtron:~/devel$ git bundle create ~/devel.bdl master test and a bundle is saved under ~/devel.bdl containing my master and test branches. If I am now at repository B I just use jojo@dualtron:~$ git ls-remote devel.bdl which shows me the branches stored in the bundle. To use the bundle I simple treat it like a remote, using git fetch (for example) jojo@dualtron:~/git/repoB$ git fetch ~/devel.bdl refs/heads/\*:refs/remotes/bundle/\*

If all of this doesn’t make any sense, git help bundle is your friend, as usual. If you still not get it afterwards you haven’t really understood how git works.

P.S.: If there is an easier way to accomplish this, or if there are any factual errors, please leave a comment!

OpenOffice / git tips

If nothing else I can at least give you the occasional tips about things I stumbled over.

OpenOffice/sqlite3 or: Spreadsheet -> SQLite3

Ok, someone gave you a spreadsheet (i.e.: XLS or ODS-file). That certain someone managed to sneak a lot of whitespaces into the cells which are not needed. Of course this table has been in use for some years and no-one paid attention because OpenOffice doesn’t really care about the spaces and you can only see them when selecting the text of the cell. The trouble starts if some random nerd (me) wants to export the table as a CSV (Comma-separated-values). The first thing that comes to mind is “if only I had regular expressions I would be done in two minutes”. Believe it or, OpenOffice supports POSIX-compatible regexes (not as pretty as Perl regexps, but it will do).

  • Select the offending cells
  • Use Edit->Search&Replace
  • Make it display more options and activate “Regular Expression”
  • Put in [:space:]+> and hit “Replace all”
  • Search for “Regular Expression” in the OOffice help and be happy

Then you can save your spreadsheet as csv (pay attention to the separator depending on your cell cotents). The cool thing is that sqlite3 can import csv-files (guess MySQL can do the same, haven’t yet looked into it though). You just have to create a table that matches your csv (meaning the number of columns and the type). After that use .separator and .import.

Git: Creating and deleting remote branches

This isn’t really a “tip” or something cool I found, I just haven’t used it before. If you have a remote repository that you push to then git push $remote $localbranch will create that branch in the remote repository if it doesn’t exist yet (otherwise it does an update). Now, if you want to delete that branch again just do git push $remote :$remotebranch

Conclusion:

Now that I mentioned OOffice and git I won’t forget to mention how to diff OOffice-files in git somewhat better: GitWiki

Zwischenstand

Exzellenz RWTHDie ersten Klausuren sind gelaufen, die nächsten stehen noch an. Ich dachte ich erheiter oder informiere euch in der Zwischenzeit mal ein bisschen.

Flo hat beim Matheplanet einen Artikel über den Rubiks Cube vom gruppentheoretischen Standpunkt gesehen geschrieben, sehr lesenswert. Ausserdem hat er noch seine Homepage mit nützlichen Links zum Infostudium erweitert.

Ich habe endlich meine Western Digital Passport 160GB wieder, bzw. ein Austauschmodell, nachdem ich an Weihnachten eins gekriegt hatte was genau einen Abend lang funktioniert hat. Meine Empfehlung: Nicht kaufen. Die Ersatzplatte jetzt funktioniert allerdings einwandfrei und gefällt mir.

Mein Gentoo geht mir in letzter Zeit erheblich auf die Nerven und sollte ich irgendwann gezwungen sein das System neu zu installieren wird es wohl wieder Debian werden.

Das war es auch schon fast, falls ihr mal Langeweile kriegt kann ich zwei Sachen empfehlen: 1. Einfach mal mit User Mode Linux rumspielen oder 2. einfach mal UrbanTerror runterladen und spielen.

subscribe via RSS