top_menu – Page 12 – jozefmares.com
Home top_menu
Category:

top_menu

My Macbook Air mid 2011 was one of the best buys in my life. I love this piece of hardware. I have been using GNU/Linux on desktop for more than 10 years. But changes in recent years like KDE 4, Gnome 3, systemd made me think about switching.

On the other side I have been using Mac in parallel for two years in 2003. I had iBook G3 and it was also beautiful piece of hardware and great system. Many of my knowledge was born working in internet cafe on this device (funny is that I have been doing best job with no money, with only 12.1 inch screen – but this should be subject of other post).

So, this experience made me thing that it might be time to switch on desktop. To describe reasons briefly – simplified workflow (Mac Linux sync), consistent GUI and apps, no more tuning keyboard shortcuts to work same way on both platforms.

Cons was only that Mac Pro is expensive as hell and I have a pretty new desktop home. I do not like to spend that much of money (e.g. 120 000 CZK) for just a computer. Time to build Hack Pro!

If this decision came few months ago when I was building my computer i would go way of buying components based on this guide.

But I already had my hardware so let’s try it. These are my hardware specs (links to shop I bought hardware):

I’m very lucky guy – this setup was created for Linux (to work like a charm), but when I made decision about switching to hackintosh all seemed great. Building a hackintosh is always (at least according to how-to’s) about supported motherboard and graphic adapter. After quick googling hardware hardware has been looking good.

Next part will cover basic setup of my hackintosh – creating of install media, and USB installation.

Today, one guy I know called and asked if I can help him with accounting system in his restaurant. There was cryptic message from accounting software with some sort of DB error.

I saw system like this first time in my life so I started to investigate DB backend and I found Firebird / InterBase. Actually I saw Firebird in production for first time in my life. I started to think about fixing database from command line and i googled a lot ’till found solution. I should verify DB, prepare for dump and then restore.

This is how I achieved task:
1. disconnect users – in my case accounting software;
2. create backup copy of database file;
3. run gfix to validate database;

gfix -v dbname

4. I prefer full validation;

gfix -v -f dbname

5. prepare corrupted database for backup;

gfix -mend dbname

6. backup database – -g switch disables garbage collection;

gbak -g -b dbname.backup

7. restore database -r replaces existing database (remember that part about copy?);

gbak -v -c -r dbname.backup dbname

If you are lucky enough you have now working database. I wasn’t. During restore there was problem with primary key on one of the tables. I “fixed” (i mean – it worked for me) it running this:

gbak -v -c -r -i dbname.backup dbname

-i switch creates indexes as inactive which worked for me.

People were happy today and my introduction to Firebird was only one hour long. ;)

Having two machines for work has a lot of advantages but there are few disadvantages. I have covered file synchronisation issue in my previous post.

Today issue is sharing screen – e.g. I hate two separate sets of input devices. Solutions is called Synergy and I am using this project for years. Yet, even developers and admins who work with separate (not virtual) machines on their physical desktops do not know this beautiful piece of software. Time to change this!

Synergy basically works this way: one computer acts as a server (this is the computer with main input device – keyboard and mouse for example). Clients connects to this server which have stored configuration with physical position of clients. One picture worth thousand words, check this (image courtesy of Synergy project):synergy scheme

 

My setup is based on Fedora box with two screens in the middle and right (second screen) and OS X box on the left. I’m using pretty basic setup (no special Synergy hacks) and server configuration file looks like this:

section: screens
fedora_box:
os_x_box:
alt = meta
meta = alt
end

section: links
fedora_box:
left = os_x_box
os_x_box:
right = fedora_box
end

Name this file .synergy.conf and run Synergy to check if it works:

synergys -f

I would like to mention only one speciality compared to “extremely basic setup” and it is:

alt = meta
meta = alt

This configuration options are switching meta (win) key on IBM keyboard with alt key. I have this setup because Mac keyboard I’m using all day when I’m away from my home office has CMD key left of space followed by alt key from right to left. This way I’m not making typos in keyboard shortcuts. Productivity on!

You can download on project page binaries for your favourite distributions and OS X. Be careful – version in Fedora 18 repositories is 1.3.X and version downloaded from project page will be likely 1.4.X – server will return error about incompatible client.

Finally you should automate somehow startup of binaries but way how to achieve is up to you. I have server always started (binary started after Gnome 3 startup) and on OS X box I’m starting binary on demand. In future post I might write how to start applications and change network profile on OS X based on location.