Adventurous Computing

Bitcoin wallet recovery using Photorec

without comments

Ever cried over damaged disk holding your bitcoin wallet ?
Ever formatted storage holding a perfectly valid and the only copy of your wallet.dat ?
Yes, me too.

Well, there’s Photorec, opensource file recovery software. It just skips the partition and filesystem info and scans for plain file signatures on the disk.

Unfortunately it does not recognize Bitcoin’s Wallet as a file format.

Bitcoin wiki states that wallet.dat is just a good old BerkeleyDB.
Just let me check that with the famous file command:

[cyryl@uglybook ~]$ file .bitcoin/wallet.dat
.bitcoin/wallet.dat: Berkeley DB (Btree, version 9, native byte-order)

That is right.

Photorec however, has its own file-type detection magic, for the reason unknown to me.
Let’s see whether it works on the wallet.

[cyryl@uglybook ~]$ fidentify .bitcoin/wallet.dat
.bitcoin/wallet.dat: unknown

Uhoh.

Do not abandon hope for not all is lost !
Photorec provides a way for you to add custom signatures.

The only missing ingredient appears to be the knowledge of file.
Just check your linux installation for file‘s detection signatures.
On my system these are to be found under /usr/share/misc/magic
We need file extensions, offset and some magic number for Photorec to work.
Well, extension is .dat, magics and offsets are stored in the file mentioned above.
Translate offsets from decimal-based to hexs and take care of endianess et volia

[cyryl@uglybook ~]# cat .photorec.sig
dat 0x0 0x00061561
dat 0x0 0x61150600
dat 0x0 0x00053162
dat 0x0 0x62310500
dat 0xc 0x00061561
dat 0xc 0x61150600
dat 0xc 0x00053162
dat 0xc 0x62310500
dat 0xc 0x00042253
dat 0xc 0x53220400
dat 0xc 0x00040988
dat 0xc 0x88090400
[cyryl@uglybook ~]$ fidentify .bitcoin/wallet.dat
.bitcoin/wallet.dat: dat

That is it. Happy wallet recovery.

Written by cyryl

April 1st, 2012 at 9:06 pm

Disassembling Pioneer SE-50 headphones

without comments

Today’s story is a photostory !
Here’s how to disassemble Pioneer SE-50 headphones, as I found this task quite difficult, mainly because no info available on the internet on how to open the can from the back.
As you can see Pioneer signs on the side of each can are removable. Take them off to uncover the screws.
Research made possible by kabanosy – best multitool ever.

Some more info on the headphones:
Manual scan
Produced between ’68 and ’72
Two speakers per can !

Photos taken after replacing the cable and before pots rejuvenation.

Written by cyryl

December 20th, 2011 at 11:12 am

Configuring Tor non-exit relay

without comments

I’m for privacy. I’m for cryptography. I do provide Tor relays for the good of all people.
Here’s how to configure a classic non-exit Tor relay on your machine. In my case I got it running on the VPS server, with 2 IP addresses and some bandwidth quota applied.
I wanted the Tor traffic to be easily recognizable from outside as different from the ‘normal’ traffic coming from my server. Second requirement was to make Tor not use my whole traffic quota up.

Here’s my config, with some notes

cyryl@serv:~$ cat /etc/tor/torrc
SocksPort 0 # what port to open for local application connections
SocksListenAddress 127.0.0.1 # accept connections only from localhost
RunAsDaemon 1

DataDirectory /var/lib/tor

ORPort 9001 #switches Tor to server mode
ORListenAddress tor.cyplo.net
OutboundBindAddress 91.213.195.28 #what IP address use to direct the outbound traffic
Nickname cyplonet
Address tor.cyplo.net
ExitPolicy reject *:* # no exits allowed
AccountingStart day 09:00
AccountingMax 2 GB

MyFamily cyplonethome, cyplonet

Written by cyryl

October 6th, 2011 at 3:33 pm

Posted in blog

Ubuntu 11.10 Beta1

without comments

What do I think ? Easy to install, hard to disable Unity, some programs crash sometimes and some things are weird. Despite that I have the faith in the Ubuntu guys that the system would be ready when 11.10 comes.

As whining itself never got anybody anywhere, I’ve reported all of these here:

#855901
#834425
#855945
#855917
#855919

I’ve even got one OOPS. However, since I’m writing this post under 11.10, it seems usable, even the OOPS was not of disturbance as it got nice GUI window displayed and no system crash then.

Written by cyryl

September 22nd, 2011 at 9:40 am

More RouterBoard debugging

without comments

I just wanted to install OpenWRT on Routerboard 433UAH. And as usual I ended up having lots of cables. And yes, awful soldering, I know ;)

Written by cyryl

August 15th, 2011 at 11:11 am

Posted in hardware

Tagged with , ,

Having fun on weekend

with one comment

Written by cyryl

July 30th, 2011 at 7:45 pm

Posted in hardware

Tagged with , ,

How to hire a programmer, a.k.a. tech recruitment explained

with 3 comments

Today’s post is not a recipe at all. Maybe a little. More of viewpoint than a recipe.

How to get the right people for the tech jobs employed ?  The most common way nowadays seems to be the one of paying lots of cash to the recruitment company to do this for you. How it ends ? There are few things that annoy me more than the people from the recruitment companies. I am not saying that all of them are annoying, no. Just the very most of the ones who contacted me. I find questions they ask fundamentally flawed. They appear to more like a pattern-matching mechanisms than the actual people. Maybe it’s because I am biased, I don’t quite get the idea of hiring non-programmer to hire a programmer.

Here’s what I think the tech recruitment should look like. It won’t be cheap. And yes, I conducted a lot of interviews in my life.

Start by describing the position. Who are you looking for, what would they do for you, how would they bring money to your company. Use words, not techie talk. I found most of the job descriptions online do not match the real expectations of the employer. You just want a good programmer, a person who thinks about what her does. It really doesn’t matter if they know Haskell and you write in Erlang. I doesn’t matter if they think in asm when you’re looking for Forth. I doesn’t matter if they are Linux nerds and you’re Windows-only, if they know how a computer works. As long as they think about what they do and know what’s that for and agree with your goals that’s perfectly fine. If you translate your desire for a good programmer into a bulletpoint list of tech words you dehumanize it. Don’t look for skillsets, look for people I say.

How to check whether someone is a good programmer then ? How to score people against such a vague job description ? You don’t score people I say, you just sort the set of people.
I start by a rather loose conversation. Tell me about the point in life you’re in, tell me something about what fascinates you in the programming job and finally what’s your motivation for changing the job and why do you want to work with us ? Somewhere in the middle I ask about the projects, what technologies you do like what not, why not. Do you feel comfortable teaching others ?

Then the talk gets momentum. We do focus on computers finally, why should it slow down, really ? If someone is fascinated by The Machines you should already noticed that, to be honest. Same with boring people or annoying people. If you do not want to work with them then do not hire them. Even if they’re brilliant.

How does the computer work then ? How does this happen that I have this text file full of strange writings and suddenly they make the computer do stuff ? Why it’s not a good idea to get the modern pc to fly a space shuttle ? What’s a stack and what’s a heap ? Is the stack memory really different from the heap memory ? Why so.

And the WHY. The most important question for me is the mighty why. Not only should they understand how something works, but more importantly why it works like that. I really enjoy working with people who are microwave-curious than the hex-feared ones. How does the microwave oven heat things ? Does the DEADBEEF scare your ? Maybe it needs some heat treatment then.

Talk with people, make notes. What annoys you, what impresses you. Do the exercises with them. Ask them how would they solve a simple but a real life problem. Design the solution with them. The more lifelike the work scenario the better. Do the things you’d normally do with your work colleague.
And order the set of candidates. Work as the simple max function. Take the first one and the second one,. Decide which one seems better suited for you. Then take the next one and compare her to the current max.

And please hire people only when you’re ready to hire them.

UPDATE.
After writing this post I’ve stumbled upon this 37signal’s art . Worth reading.

Written by cyryl

July 24th, 2011 at 8:31 pm

Posted in social

Tagged with

Speeding up Eclipse/Aptana

with 2 comments

As some of you know Aptana is Eclipse. And Eclipse is a Java-based IDE which means it’s not particularly a speedy one. However if you have a decent amount of ram, like 4gb, it’s fairly easy to speed the Eclipse up.

Go ahead and find eclipse.ini or aptana.ini or other file which contents look similar.

These settings are from my Linux box, I know that MacOS might be kinda scared by so high values, try lowering the Xmx and/or others in such a case.
[gist id=1129400]
These settings are for the 4gb ram box, try to find the ones which suit you best.
MaxPermSize stands for the maximum amount of the memory to be used by the Java internals, Xms gives the amount of heap allocated on the VM start and Xmx is the heap size limit. Start with upping Xms value as it’s often too small which causes the Java VM to make lots of heap resizes on the app start.

Written by cyryl

May 23rd, 2011 at 12:29 pm

Posted in open source

Tagged with , , , , , ,

Installing MacOSX Server 10.6 on VirtualBox

without comments

It all started with my work assignment of installing MacOSX Server 10.6 on the XServe rack. Of course nothing went really well. The universe keeps on picking up the most faulty scenarios for me, I think it’s just less boring. Briefly speaking, after debugging some hardware problem with the CPU temperature meter I managed to install the base OSX server system there. Hardware boy inside me is not amused with Apple’s ideas there.

After that I needed to set up VMs with 10.6 64bit and 10.4 32bit on top of that. Why so if already having 10.6 as the base system ? Simply I wanted to avoid constant reinstallation of the base system, as the machines are meant to be used for development and testing. Also the XServe hardware was needed instead of classic blade system to meet Apple license requirements.

Having the internet read twice I decided to give VirtualBox a try. My way of thinking was that I am already familliar with that piece of software and know it as a easy to use one. In addition to being pretty idiot-proof it also enables more enterprisely features like operating from the commandline only.

So what’s the deal ? Bring up VirtualBox GUI, click on new virtual machine creation button, choose MacOSXServer, insert the iso file made from the installation dvd and volia ? Not even remotely close. It appears that Apple has embedded some kind of valid processors db into the system and checks the processors present against it on every boot. Fine. But I am running this thing on the Apple hardware. The only configuration I managed to install and launch was single-core. Both 32 and 64bit guests seem to be working fine. But what’s the point of having many cores there if only one can be used per a VM ?

As with many other interesting problems I took it home. Some time after that I found brilliant blog pair by prasys and nawcom. It seems that the latter one produces what’s called ModCD which allows booting with the processor checks disabled.

Recipe for amd64:

  • create new MacOSX vm in VirtualBox
  • change it to non-EFI type
  • boot ModCD
  • swap iso image for the one with the MacOS install
  • press f5
  • type -force64
  • press enter

For me the installer crashed on the last step before reboot, but then it rebooted successfully and continued on with the installation.

Don’t forget to donate to nawcom if you can.

Written by cyryl

May 7th, 2011 at 2:23 pm

How not to blog

with one comment

Today’s post is definitely not a tech one. Or maybe just a bit. It’s about blogging, from the other side of the keyboard. PEBKAC-style. Fun-fact: Did you know that ‘kac’ in Polish means ‘hangover’ ?

To the point. I realised that I have dozens of posts in the state of started but definitely not finished. Why is that so ? Is it that I am superbusy with my new work ? Kinda. Is that that I am the guy responsible for the installation of the sound system in one of the new Wrocław’s clubs ? Sounds pretty serious but still not a perfect excuse.

The thing is that there is no right excuse for not doing something you want to do. Do it or don’t. Don’t pretend to.

The funny thing is that the smallest possible posts, like this, brought me the most views. I don’t wanna loose you guys because I don’t feel like blogging recently.

Mine unfinished tech posts won’t probably make it because I just don’t remember what were these small tech tricks I used to solve that problems. Not even wrote them down as I was so enlightened by the superiority of my solutions.

Don’t do that. Take notes about everything which you would possibly need and start working on the sentences and wording. Rigth now. Go. Hit publish and let the world know.

Thanks go to TC & Mark Suster.

Written by cyryl

March 27th, 2011 at 10:25 pm

Posted in blog

WordPress Appliance - Powered by TurnKey Linux