Tools

Suche


10. February 2012

Future of this Blog

Johannes Habich, 06:35 Uhr in Allgemeines, Contact, CUDA, Home, HPC, Parallel Computing MPI/OpenMP, PRACE, Publications, SKALB, Tools, Windows HPC

Please find new posts to this blog here:

http://johanneshabich.blogspot.com/

 

There will be no more posts here

6. February 2012

GIT: DIFF working tree against some revision or branch

Johannes Habich, 07:13 Uhr in Tools

git diff  fw7e7f8wef8wef yourfile.c

 

Gives the changes between current working dir and revision  or branch: fw7e7f8wef8wef

31. January 2012

GIT: Tag particular commit

Johannes Habich, 14:20 Uhr in Tools

Simply use git tag as usual but provide a valid commit hash:

 

git tag -a v1.0  cc622186a7322713f0ee4df8d58a1adcfe2ffef6   -m”tag a particular commit”

22. December 2011

GETOPT for Windows

Johannes Habich, 11:47 Uhr in HPC, Tools, Windows HPC

The portability of programs between *nix und Windows is often limited not by the program itself but by certain helper tools. One of those is getopt which provides a fast and easy way to read in command line arguments.

Please find a windows version here: http://suacommunity.com/dictionary/getopt-entry.php

 

You will find more other useful ports here as well.

16. December 2011

GIT: git show and git describe

Johannes Habich, 06:36 Uhr in Tools

You can easily have a look at a tag with

git show  mytag

Much more powerfull and showing you all sorts of realations between tags and commits is git describe:

http://gitfu.wordpress.com/2008/05/25/git-describe-great-another-way-to-refer-to-commits/

25. November 2011

XFCE: Set volumen function keys

Johannes Habich, 06:46 Uhr in Allgemeines, Tools

Go to Settings > Keyboard > Shortcuts and add three shortcuts for your function keys. The commands should be:

amixer set Master 5%+

amixer set Master 5%-

amixer set Master toggle

This requires that the function keys are actually recognized by your system but have no command assigned till now

10. November 2011

VirtualBox: ResizeHD

Johannes Habich, 06:14 Uhr in Allgemeines, Tools

In general the following should work:

VBoxManage modifyhd MYHD.vdi –resize 20000

 

Were 20000 is more or less 20 GB.

If the command fails several reasons could be the cause.

  • The virtual disk is already larger. Till now you cannot shrink drives that way. Take a close look in the VM whether you already use that space actually. In Windows this information is under Computer Management –> Storage –> Disk Management
  • The virtual disk has the wrong type. Issue the command:

 VBoxManage showhdinfo MYHD.vdi

If the result is not:

Format variant: dynamic default

you have to migrate your disk to that dynamic system. Since this is the default container for newer versions you can simply clone your HD file and then enlarge the new one:

VBoxManage clonehd MYHD.vdi MYNEWHD.vdi

  • I did not encounter other errors, please comment if you have any problem and/or solution


 

 

 

12. July 2011

GIT: Compare/Diff working directory against server/repository state

Johannes Habich, 11:53 Uhr in Tools

git fetch –> updates your local rep but not your working Dir
git diff … origin gives you the comparison

11. July 2011

GIT: Ignore File mode/right changes

Johannes Habich, 06:00 Uhr in Tools

If you have files or directories under git control and change the rights of them, git does recognize them as changed.
To force git to ignore these changes just execute the following.

git config core.filemode false

You can reenable that after all files have a new revision because of an actual change and are comitted in the new mode anyway.

28. June 2011

LIKWID: Installation Hint

Johannes Habich, 06:50 Uhr in Tools

If you set the likwid install path in config.mk and the last character is a slash, likwid-pin will not run with the following error message:

ERROR: ld.so: object ‘~/helper/likwid-2.2-inst’ from LD_PRELOAD cannot be preloaded: ignored.

Delete the last slash and do
make clean && make && make install

and likwid-pin should work fine.

27. June 2011

GIT: Clone Repository with different branch than master

Johannes Habich, 07:52 Uhr in Tools

git clone git@someserver.com:projectname newdir -b yourbranchname

14. June 2011

GIT: Getting information about tags

Johannes Habich, 11:53 Uhr in Tools

To show the tags you made and the comments or tag messages:

git tag -l -n1

7. April 2011

EMACS: Whitespaces

Johannes Habich, 08:30 Uhr in Tools

Motivation:
Each and every editor handles whitespaces tabs etc. differently. The first step to get everyting out to the open is so show whitespaces and tabs the way the editor sees them. For me it’s emacs and the following lines in your ~/.emacs should give you a good view of whitespaces.
Look at this documentation for all references

Please be patient and drop me a comment if there are any errors or misunderstandings. I’m really no emacs pro!!!

(require 'whitespace)
(global-whitespace-mode t)

28. March 2011

GIT: Remote branches

Johannes Habich, 13:23 Uhr in Tools

Show remote branches:
git remote show origin

16. March 2011

GIT: Pushing a new repository to a git server the first time

Johannes Habich, 07:21 Uhr in Tools

Scenario:
You created some local repository and worked on that for a while. Now you want to have it on a server so that others can collaborate.
We want to keep the full history so we want to push the current repository to the server. In order to do this at least for the master branch you have to edit the config file at:
/.git/config
It probably looks like the following:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true

The easiest way to get everything right is to check out the empty repository from the server via git clone and diff the two config files.
Finally you see that you have to add something like:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = user@yourgitserver.com:MyNewProject
[branch "master"]
remote = origin
merge = refs/heads/master

To the existing config.

Now issue a git push origin master and the master will be pushed.
If you know whether that works with branches as well or how to get that working, please drop me a comment!?

There are other ways to just give the repository as a argument at the git push command but I like to keep my old directories.

26. January 2011

GIT: Merging changes of a branch back to master

Johannes Habich, 12:28 Uhr in Tools

You branched out for development and now it is time to get the improvements back to the master branch.
This is achieve by git merge while on the master branch.

To be sure to not mess up anything, I prefer to clone my repository first and do the merge there.
So best is if you commit all changes in master and dev branch. Do a couple of pushs and pulls so everything is in sync and then clone your repository to a new location.
You can directly clone the branch you want to merge then proceed to 2. otherwise do a

  • git checkout branchname
  • git checkout master
  • git merge branchname

You have to resolve any conflicts in any files by removing the spiky brackets in the file and of course take a close look what caused the conflict and fix it.
Then add the file via git add and commit it via git commit .
Do this for every file.

20. January 2011

CVS: Get new directories of the server

Johannes Habich, 10:09 Uhr in Tools

If you want to update your CVS working copy to get new directories from the server, a simple cvs up does not get these directories.
Try cvs up -d

14. January 2011

GIT: Creating a local Repository

Johannes Habich, 12:13 Uhr in Tools

Till now all my posts concerned repositories already created. But how to create your own git rep in the first place?
Simply execute:

mkdir new-rep-dir
cd new-rep-dir
git init-db

and the new-rep-dir is a git repository

Hint by TZ: git init is the alias for git init-db

23. December 2010

GIT: Working on Branches: Sharing files and commits

Johannes Habich, 12:59 Uhr in Tools

Motivation:
You have several development branches but basically use the same files to test or benchmark all versions. Then there is no sense in developing different code in all these branches for the same purpose.
You can easily merge single files from one branch to the other by cherry-pick.

Example:
1. First commit a file and only the file you want to share, nothing else:
git commit bench.sh -m"Newest fancy script which does all tests for all versions"
2. Save the key somewhere.
3. Go to the other branch folder or checkout the other branch in the same folder, as you like.
4. git cherry-pick 123784hash

You should now have the same file in the other branch as well.

Thanks to Markus for pointing me towards this.

22. December 2010

GIT: Tagging

Johannes Habich, 13:01 Uhr in Tools

Tags are nothing else then names for certain revision.
So called annotated tags store the status of the project at a specific point in time for future use.

Create a tag:
git tag -a v1.0 -m"Your comment for version 1.0"

Push tag to repository:
git push --tags

17. December 2010

GIT: bookmark collection

Johannes Habich, 11:02 Uhr in Tools

Just some links:
Tutorial

15. December 2010

GIT: Branching

Johannes Habich, 08:08 Uhr in Allgemeines, Tools

To create a branch for some development work in git is really easy.
First clone an existing repository like described here.

In the new directory simple execute: git branch newbranch.
However, if you execute git status you will see that you are still on the master branch or the other branch you worked before (then the question is how did you get there
??).
Execute git checkout newbranch an d git status will show you that you are now working on branch .
In order to push this information to another repository or a git server, git push per se will not do the trick. First you need to execute git push origin newbranch and now your branch is committed to the other repository.

6. November 2010

Embedding fonts in Latex / XMgrace / PDF toolchain

Johannes Habich, 11:13 Uhr in Tools

How to embed fonts in pdf files which are generated from latex and eps source under linux is nicely described here:

http://www.wkiri.com/today/?p=60

Be sure to disable the field “use device fonts” in the xmgrace printer settings when printing to eps

5. November 2010

GIT: Distributed Revision System

Johannes Habich, 07:30 Uhr in Allgemeines, Tools

Distributed Revision Systems have the advantage that a central server is not necessary in contrast to CVS or SVN. Furthermore commits and even more important diffs to other versions can be made  with a local repository only. This is an adanvantage when working offline, e.g. on journeys, on a plane etc. Furthermore a new branch for testing can quickly be made by simply cloning the repository once more and work in the new directory.

To setup up git client on your ubuntu linux just type aptitude install git-core and you’re done.

For windows you need to download 2 packages:

MSysGIT
Tortoise GIT

If you install in this order everything should be fine. If Tortoise later on complains about not finding git, you get to Tortoise’ Settings and point the git path to the directory where you installed msysgit +\bin e.g. c:\Program Files\git\bin

Working together on a project can be done like CVS and SVN. But in contrast to these central methods, you do not commit your files to the central repository but first to your local rep.

The central repository is then updated by a so called push.

To get the updates from the central server you do a pull.

Basic tasks are:

  1. Clone the repository to your local workstation: git clone git@someserver.com:projectname
  2. Add new files: git add xyz
  3. Commit the new files or changes is already added files: git commit xyz
  4. Send changes to server: git push
  5. Get changes from server to rep only: git fetch
  6. Get changes from server to rep and update checked out files: git pull

This is just for starting with git, please consult the manuals and documentation on more advanced topics.
Thanks to Thomas for this information for a quick start.

Another Distributed Revision System is mercurial where you find a small tutorial here: MercurialHG

20. May 2010

LaTex: Floatflt.sty missing on ubuntu lucid 10.04

Johannes Habich, 11:01 Uhr in Tools

The recent upgrade to the new ubuntu stable version missed installing all tex-live ressources, I thought at first.
However license of floatflt.sty has been changed, thus it is no longer in ubuntu or tex-live.

Here’s a quick guide to reenable it.

Problem:

LaTeX Error: File `floatflt.sty’ not found

Solution (to be run as root ):

sudo mkdir -p /usr/share/texmf-texlive/tex/latex/floatflt
cd /usr/share/texmf-texlive/tex/latex/floatflt
sudo rm -f floatflt.* float*.tex
sudo wget http://mirror.ctan.org/macros/latex/contrib/floatflt/floatflt.ins
sudo wget http://mirror.ctan.org/macros/latex/contrib/floatflt/floatflt.dtx
sudo latex floatflt.ins
sudo texhash /usr/share/texmf-texlive

Source of suggestion with discussion wether to use backport ……..

I would appreciate any hint to any solution which does this more automatically please drop me a comment on your solution.

6. July 2009

Taming Literature, Zotero Firefox Plugin

Johannes Habich, 15:09 Uhr in Tools

Again and again I felt the urge to have a real tool organize my literature instead of crawling inside bibtex files with every new paper or report again.

So recently I heard something about SCOPUS from the publisher ELSEVIER, Citavi is free for members of our University but all lack some features.

The largest problem however is, how to import bibliographys from webpages and similar “free form” sources.

Finally I stumbled across the Firefox extension Zotero.
Once installed its active in the background and is only visible by clicking its logo in the lower window bar. If you now visit a site which has bibliography similar input, a small icon appears in the address bar which exhibits all literature found on this page. With a selection and by hitting ok, you now import one or more books, articles aso. Into the Zotero DB. Furthermore you can search in the DB by tags and other fields. Can organize categories and subcategories and output to RTF aso. and of course bibtex files.
You can as well import bibtex files to appreciate your hard work generating these files by hand in the past :-).

Zotero is of course not free from flaws and some webpages, even that ones which Zotero has optimized parsers for, provide information with errors till the next parser release comes out.

I’ve not figured out how to efficiently use this on multiple Computers at the same time, but I’m sure there is a solution as well.

21. October 2008

Distributed Revision System Mercurial

Johannes Habich, 12:14 Uhr in Tools

Converting CVS to HG

To get hand on knowledge on the distributed revision systems like Mercurial,
just export one of your CVS Reps to a test HG Rep. Important for any repository, the history should stay intact (and hopefully will)!

A more complete guide can be found here:

Generate the repository folder and enter:
mkdir -p /path/to/hg/repo
cd /path/to/hg/repo

Generate the config file:

tailor -v –source-kind cvs –target-kind hg –repository /path/to/CVS/REP –module YourModuleName -r INITIAL >Config.tailor

for SSH access to the repository change /path/to/CVS/REP to :
:ext:USERNAME@YOURSERVER:/path/to/cvsrep

Change configfile to your needs
vi Config.tailor

Now you will at least need to change subdir from . to MODULENAME, and remove /MODULENAME from root-directory in the MODULENAME.tailor file (if it is really there).

Add the line:

patch-name-format =

Generate Mercurial project

tailor –configfile MODULENAME.tailor

Cloning repositories with ssh

To clone the repository, ssh can be used easily.
Just type the following hg clone ssh://yourlogin@yourhost/
or insert ssh://yourlogin@yourhost// in your client program as the source path.

Nach oben