Ignoring changes to tracked files in Git

9. april 2013

This took me some time to figure out, as most results to googling “ignore committed file” sent me on a wild goose chase with most answers on StackOverflow really answering how to remove a previously committed file and ignore it.

My scenario is not like that. I have a build folder checked out along with other folders, and the files in this build folder is updated by build scripts when I develop. I am not interested in checking in these results, as these files change all the time, but I do want to keep them in the repo. Unfortunately, putting the file patterns in .gitignore does not work (which was what sent me googling in the first place).

It turns out you can modify your local index to ignore changes to tracked files in the repo by issuing a flag called “–assume-unchanged” when calling update-index. So, given that you have a file foo.exe that you want to keep unchanged on the remote repo, issue the following command

git update-index --assume-unchanged foo.exe


SNCF: France in a nutshell

10. mars 2013

To enable the SNCF to investigate your application please send a letter to:

Service relation clients SNCF
62 973 ARRAS Cedex 9
France

We hope this information will answer all your questions and that TGV-europe keeps your trust, wishing you a pleasant day.

Best Regards
Samuel TOPET

After forming a complaint letter, and managing to send it through the labyrinth of a web page SNCF keeps, this is what I got as a response. One thing is that SNCF is so hopelessly stuck in the past that they do not even accept e-mail inquiries on the service level. Another thing is that they would rather have you send snail mail into the black hole they call their service department than forward your complaint to the right person. Somehow I sense that even if I should be able to get hold of the right department (eventually), my complaint would never be read, because it is not in the right language (which would be French, of course). Les resten av dette innlegget »


Java 7/8 wreaking havoc with Java Web Start in Mountain Lion

5. mars 2013

Installing Java 7 on my shiny new MacBook Pro with Retina display made all Java Web Start programs look absolutely crap by doing some not-too-fancy scaling on the graphics. After some googling, I found that only the Apple approved Java 6 that ships with OS X is able to display Java programs correctly on the Retina displays. The following post tells you how to fix it. Les resten av dette innlegget »


Mass killing Oracle connections

4. februar 2013

If you have started to run out of connections due to some rogue program running wild, hanging your connections, you might need to kill a session or two. This is how to achieve this Les resten av dette innlegget »


When OS X refuses to remember your (Enterprise) WPA passwords

26. september 2012

Due to a password policy at work, we need to change the password for our Enterprise WPA network quite often. Unfortunately this has surfaced some weird bug in OS X, where it will prompt me for my password each time I log on the network, even though I can see it has been stored correctly in the Keychain. Got some tips from this post on the Apple Discussion forums, but it was not sufficient for me to get it working. I therefore present you the full five steps needed to fix this (at least in my case):

  1. Turn off Airport while doing this
  2. Open your Keychain (just search for “Keychain” in Spotlight) and remove the password associated with the WIFI you are having problems with
  3. Open Networks, press “Advanced” and remove your network from Airport
  4. Without closing the Advanced windows, open the tab marked “802.1X”. This was the missing (crucial) step for me to get it working.
  5. Turn on Airport again, choose your network, and type in your username and password.

Hopefully you will no longer be prompted for your network password again!


Absolute file path function for Bash shell scripts

19. juni 2012

An often wanted function when writing shell scripts is one that when given a file or directory, returns the absolute file path of the file. Googling for this will return many results, but few that are cross platform compatible. For instance will a search often bring up use of readlink, but this is not useful on BSD systems (such as Mac) and will thus only (?) work on Linux.

One solution that was both elegant, uncomplicated and works on all bash systems, was found on LinuxQuestions. This will probably only work in Bourne style shells, but is easy to read and reuse:

function abspath {
	if [[ -d "$1" ]]
	then
		pushd "$1" >/dev/null
		pwd
		popd >/dev/null
	elif [[ -e $1 ]]
	then
		pushd $(dirname $1) >/dev/null
		echo $(pwd)/$(basename $1)
		popd >/dev/null
	else
		echo $1 does not exist! >&2
		return 127
	fi
}

I have included it in my shell function library on GitHub.


Review: A Song of Ice and Fire

4. mars 2012

A Song of Ice and Fire
A Song of Ice and Fire by George R.R. Martin
My rating: 4 of 5 stars

Sum up: A complex plot with intriguing characters and unexpected twists made me race through the first book in the course ofna few days (and late nights). The formula is getting a bit repetitive by the second book, the prose somewhat limited in expression, and my willingness to spend time on the third book was nowhere near the eagerness I felt after finishing the first book. Not bad by any means, but the author has a harder time keeping my interest after 2000 pages. I would definitely recommend the first book.

This review is made on the basis of the two first books – not the entire series (which is not completed), nor the set of four books. Will read the rest as the HBO series progress beyond season two.

The author keeps us in suspense, throws unexpected twists at us when we are least expecting it, and keeps us humoured by the likes of Tyrion and Varys. I’m thoroughly entertained, quite simply. The way the characters are slowly being built up to form people we start caring for (in some way), is what sets it apart from other series. Unfortunately they never live for long…

The series/ is by no means without its flaws; the prose is awkward and feels unnatural. I believe there is ample room for a presentation of ancient worlds in a modern day language. To me it feels as if the author is leaning too much on the heritage of Tolkien. The
Going directly from book one to book two, there were also quite a few annoyances that struck me: for one, the writing style of book two differs from book one. The most nagging irritation is that Martin insists on spelling every character’s thought out for us, however simple it might be to retrieve from the context. Another thing is the constant reminders of what happened in the previous book – few would read the second volume if they never read the first.

But these are minor complaints: this is not great literature, but great entertainment it definitely is. I would recommend this series to anyone that is in need of a thrilling and entertaining read. It has a heavy page count, but other than that it is smooth sailing all the way to King’s Landing.

View all my reviews


Følg med

Få nye innlegg levert til din innboks.

Bli med 656 andre følgere