Quantcast
Channel: Hacking Corner
Browsing latest articles
Browse All 20 View Live

A good read on vtables

I happened to find some good reading on C++'s virtual tables, their implementation (on g++) and dynamic_cast. Nothing too special, but somehow I've always managed to neglect thinking about this. The...

View Article



How to modify author of multiple commits in git

I needed a nifty way of changing author name/e-mail in multiple commits when someone made commits with wrong authorship details.The orig branch here contains the commits to be modified, and rewrite...

View Article

CD/DVD tray stuck on Debian Sid

In case anyone has run into this peculiar bug, the problem seems to be devkit-disks-daemon (in devicekit-disks package). Debian bug #550316.Killing the daemon allows you to open the tray normally. Bad...

View Article

Sorting dicts by value in python

A couple of tips (read: notes to self:) using sorted() and lambda to sort dicts by values in python.Often you need to count occurrences of previously-unknown keys. The most usual way is to store these...

View Article

git tips/tricks

I have to admit the more I use git the more I love it. Here are some random tips of commands I have found useful.===========-p is your friend$ git add -p Hand-pick what changes to add to the next...

View Article


git status / utf-8 umlaut tip

git status and other commands display utf-8 filenames containing umlauts (äö etc) differently from the shell, eg. as escaped (\266, \303 etc). So in case you are having problems with umlauts, the...

View Article

Blocking Facebook's web history tracking

Now that Facebook is providing a "service" for sites to allow showing an iframe that allows you to like any URL (and see friends who have liked it as well), it is coincidentally collecting data on your...

View Article

How to upgrade all dependencies of a debian package

Sometimes Debian Unstable users may find it useful to upgrade all dependencies of a package (missing version dependencies etc). The following command can be used to do it:$ aptitude safe-upgrade...

View Article


Python: sort two lists - second in the same order as first

[python] labels = [ 'third', 'first', 'second' ] values = [ 30, 10, 20 ] z = sorted(zip(values,labels)) # z # [(10, 'first'), (20, 'second'), (30, 'third')] labels_sorted, values_sorted = zip(*z) #...

View Article


Python GIL & multicore thread performance

I was linked to an interesting presentation about Python GIL (slides only) & why threads don't really work on multicore systems. The performance issues are really peculiar and unexpected, and even...

View Article

My firefox userContent.css tweaks

My \~/.mozilla/firefox/\<profile>/chrome/userContent.css:/* Change cursor for links that open in new window...

View Article

Debian unstable: "PHP Fatal error: PCRE is not compiled with UTF-8 support"

After recently upgrading php5 in Debian Sid, I started getting this problem (in phpBB3 and MantisBT, etc):PHP Fatal error:  PCRE is not compiled with UTF-8 support in (...)It seems the cause was wrong...

View Article

Firefox 4 not visible on remote desktop

I can't be the first one to suffer from this problem...My bet is on hardware acceleration causing the issue, luckily there is a way to disable it.

View Article


How to prevent CherryPy from logging after logging.basicConfig()

For some time, I've wondered how to disable the ill effects of running this in a CherryPy application:[code language="python"]logging.basicConfig(level=logging.DEBUG, stream=sys.stdout)[/code]Finally I...

View Article

Eclipse + m2e = "Launching : Verifying launch attributes" stuck on 57%

I recently came across a really weird Eclipse + Maven problem. Whenever I launched something, the launcher was not only consuming a lot of CPU, but also stuck on "Launching : Verifying launch...

View Article


dhclient + nsupdate = dynamic updating of IP to a private DNS server

For future reference: Jeff Garzik has written really good blog posts about using nsupdate:http://linux.yyz.us/nsupdate/http://linux.yyz.us/dns/ddns-server.htmlI should get around to scripting something...

View Article

Linux: SATA disk manipulation, hot-swapping using /sys/

Linux has a nifty way of allowing disk state modification via /sys/ interface. Very useful when debugging LVM mirroring, disk disaster recovery etc.To put a SATA disk offline/running: echo offline >...

View Article


rdiff-backup: "Warning: Extended Attributes file not found"

My backup cronjobs suddenly started mailing me weird rdiff-backup warnings, like...

View Article

How to downgrade Google Hangouts to Google Talk

Like many other unfortunate users, I went ahead and installed Google Hangouts android app right away when it became available on Google Play. Unfortunately, I did not realize it overwrites Google Talk...

View Article

Simplest init script ever

I ran into a problem of having to write a script with similar functionality to traditional linux init scripts, and I figured there has to be a simple "coreutils" solution for such an everyday task....

View Article
Browsing latest articles
Browse All 20 View Live




Latest Images