Time machine is not perfect! A mobile backup solution for OS X

There's this rule that drives fail and stuff must be backed up.

My main operating system is Apple's OS X. OS X has a backup infrastructure called Time Machine. Time Machine is a way to do a version control on the whole file system. In layman's terms: if you delete a file, you will have a version saved. Or if you mess up a document, you can recover an old version from the Time Machine. This is how the interface looks:

Also if you mess up the OS by installing something stupid, you can recover the whole OS to a state that was for example 1 hour ago. A week ago I had to test this option, because by accident I destroyed some virtual network interfaces and was too lazy to try to fix them manually. This requires an installation cd and then the whole hdd is restored. 120 gb in 50 minutes. I thought it could figure out what to reverse and do it faster without an installation cd, but I guess this is how stuff works. It worked perfectly however.

I have a Time Machine router from Apple. It's a router with a hdd inside it. Backup/restore happens via wi-fi. It works perfectly.

Note: when restoring the whole hdd to an old state, you should link the laptop and the router with a cable. This cuts the restore time in half (10 mb/s on wi-fi, 20 mb/s with cable).

Drawbacks: when a drive fails, I need an installation cd, new hdd, screwdrivers to change the drive and a lot of time for the restore operation (1 hour in my case). This solution is not mobile. The router is big, so I can't take it with me on the road.

Why would I want to have a mobile backup solution?

Well, I have an SSD drive. They tend to fail quite often and without warning. What would happen if I have work abroad and need a laptop and drive that sould not fail, or at least have a backup option? Should I bring a spare hdd, screwdriver, installation cd and the bulky router?

The mobile backup solution

No, there's a better option. Use a drive-cloning software that clones the whole SSD to an external HDD via usb for example. If the SSD fails, I don't even have to change the drives. OS X can boot from the USB drive easily, so I don't need a screwdriver. No downtime, no 1 hour restoration. Just reboot and the new drive kicks in. Well, it's not going to be as fast as the SSD:

I have a 120gb SSD with a 750 gb HDD for a mobile backup. The backup is 120gb, 200gb if I want some history of the most changed files (yes, the software can even do versioning and incremental backup). What should I do with the rest? Split the drive and have some extra space. Now I have a mobile backup with enough space to bring a ton of music or TED hd lectures.

The two softwares I know that can do that are Carbon Copy Cloner (ccc) and SuperDuper! (yes, the exclamation mark is part of the name). CCC is free, that's what I use. Easy to setup. I did all in an hour. I even rebooted to see whether the backup drive would work. It worked like a charm. It copies with around ~30mb/s.

I have not tested SuperDuper!, but it has great reviews, especially the support, they say, is awesome.

Review: mplayer

Mplayer is the best media player there is. It just is. One just downloads it and it just works, no codecs installation, no registry shit, nothing. It can navigate with the arrow keys (up/down, left/right, pgup/pgdn), it can open unfinished downloads, and can repair/redo their index and navigate while the file is still downloading - awesome. It's very lightweight.

It can play almost anything, no matter how broken it is. It comes with a console tool called mencoder that can encode stuff. It's very hard to use, but it works. It has a GUI for windows and mac os x.

The problem is that the development is a bit forsaken. Sometimes the GUI crashes, there a few bugs, the integration with the OS is not that perfect (I had issues with Vista effects and Mac OS X graphics cards switching)

I just found that the MplayerX (+GUI) is available in the App Store, perfect. The GUI is very slick.

Verdict: highly recommended.

Dramatically increase battery life on a Macbook Pro with 2 GPUs

There are numerous ways to increase battery life on laptops, but I'll talk for one specific issue on Macbook Pros that has a profound impact on battery life.

Some of the Macbook Pros have 2 graphics cards. Mine has one from Ati and one from Intel. The second is a slower one that should be used only when serious graphics power is not required. Unfortunately this mechanism is not that well thought up. It turns out that any application using a specific graphics library (forgot which one) triggers a switch to the more power-hungry GPU. Simple applications like Skype, Flash... are such, even though they would work fine with the Intel card. This shortens battery time.

Fortunately there's this guy Cody Krieger that made an application (<----- link) that can make this switch manual:

Do you see the applications that the switch depends on? Skype and Twitter!

It even can see whether the laptop is no battery power and take further action:

Perfect. Time on battery power increased with a couple of hours (from 3-4 to 5-6):

I'm pretty sure I can increase it further.


Installing PostgreSQL 8.4.x (8.4.8-1) and 9.x (9.0.4-1) on OS X Lion with EnterpriseDB installer (fix)

Postgres for Mac OS X has three install options:

  1. Using a package management system. Fink, MacPorts and Homebrew all have it. I've tried only MacPorts and it works fine.
  2. Manually downloading and compiling it.
  3. Using EntrepriseDB's installer. It can be found here.
Options 1) and 2) require Xcode. Xcode is a large development package for OS X. It installs an IDE, compilers and unix tools. Options 1) and 2) use the unix tools.
I don't want to install Xcode, even though there is a way to limit it's memory footprint. Here's how (the question was with negative rating when I found it, but the answer is useful).
Anyway I don't want to install Xcode, and on my last OS X I only installed a couple of databases. That made the whole ports thing a bit useless.
So I tried the EnterpriseDB's installer. It failed with
Problem running post-install step. Installation may not complete correctly
The database cluster initialisation failed.
The official sites said: Lion is not yet supported: link. I didn't want to install some package management solution so I wanted a solution.
I found one here. On a poker site - kill me now. It seems to be the easiest one. Just create a postgres user using the Users & Groups preference tab. Don't create a Sharing only user, it doesn't work with it - I tried. Create a normal user. Everything works like a charm:
I tried the new postgres 9.0.4, but it failed with "invalid stream header: BB656430" when serving binary data from an import from 8.4.x. I went back to 8.4.x.
EntrepriseDB's installer creates an uninstaller, installs pgAdmin, works nice. User-friendly.

Rename Mac OS X applications

Suppose you would like to have firefox 3, 4 and now 5 simultaneously. Unfortunately renaming applications is not possible via Finder.

Suppose you have firefox3 installed. Do the following:

$ cd /Applications
$ mv Firefox.app "Firefox 3.app"

Then install firefox4 and do that

$ mv Firefox.app "Firefox 4.app"

Install firefox5 and then:

$ mv Firefox.app "Firefox 5.app"

Now you would have all three versions:

$ ls -a | grep Firefox
Firefox 3.app
Firefox 4.app
Firefox 5.app

The even show up correctly in Applications tab:

(I messed up in renaming and Firefox 4 is actually Firefox4)

Note: unfortunately you cannot launch them simultaneously since Firefox has a mechanism to check if it is already running.

Why is java development so windows oriented?!

I'm using a macbook. Obviously I'm using Mac OS. Not so obviously actually - recently I saw a few people using Windows 7 on a macbook.

JDK. Developing java applications on a Mac OS is not so straightforward as it is on windows. When you start on Windows, the first thing you do is download the JDK - that's easy. On Mac OS you don't have a real JDK, you have Java for Mac OS X. It's not the same. It's always late. Using SoyLatte they made a darwin port called openjdk6 that is a lot more like a real JDK. With JavaSE 7 it's even worse - there are binaries for Windows, on Mac OS one has to build it manually which is not that easy.

Eclipse. Then there's Eclipse. Thank god - there's an Eclipse.dmg that is pretty easy to install. But (there's always a but), the shortcuts are a bit changed. Alt+Shift+X becomes ⌘+⌥+X. There's also the speed issue - Eclipse is not as fast on Mac OS as it seems on a Windows machine.

Browsers. One major setback is that if one does front-end, one needs Internet Explorer to test. Otherwise QAs come and kick one's ass because something doesn't work on IE6 for example. I hate Internet Explorer. Not only IE6, all of them.

Configuration. In my project I have:

File file = new File(element.replace("file:", ""));

my Windows-using colleagues have

File file = new File(element.replace("file:/", ""));

The good thing is that since Mac OS is unix-based I have the settings that are closer to the Ubuntu we deploy our production on.

I don't know - maybe I should buy a new Macbook with a fast SSD with a lot more juice into it than the one I have now (a two-year-old one that hasn't been reinstalled since). Now there's the question - should I buy the 13" or the 15"?

P.S. The things are getting a lot better. OpenJDK6 port is pretty mature (I use it), OpenJDK7 port is coming soon. Apple donated it's JavaSE port to Oracle, so soon Java's download page would feature a .dmg file, which will be awesome.

Still I think developing java apps on a macbook is a bit harder than on a Windows machine. I wouldn't go back to Windows because of the awesome hardware and because the OS is so much better for anything else.

Review: Global Delight's Boom - boost mac's volume

Sometimes some youtube clips, movies or podcast have their audio recorded really low. My Macbooks' sound is not really strong, so when I listen to such a video I struggle to catch the speech - especially when I'm in the shower.

Global Delight has created Boom. It costs $4.99. A software solution to such a problem - it can boost the volume up to 400% and has a system-wide equalizer:

Here's an indian presenting it: http://www.youtube.com/watch?v=MMiv-qHHeNw&feature=player_embedded#at=197.

Проблем с Infonotary Configurator 1.3.4

Репортнах следния проблем на инфонотари:

Плугинът Infonotary Configurator 1.3.4 ви за Firefox създава проблеми с Firefox за Mac OS X. Проблмът се изразява в тотално irresponsive (не мога да преведа) интерфейс браузър. Страниците не се зареждат адекватно, на линкове трябва да се цъка по няколко пъти и въпреки всичко не се зареждат. Пробвах изключване на всички плугини на firefox - открих, че проблемът е във вашия плугин.

firefox with infonotary plugin
firefox with infonotary plugin
firefox without infonotary plugin
firefox without infonotary plugin
firefox error probably related to infonotary plugin
firefox error probably related to infonotary plugin

Update: Ето комуникацията ми с Васил Бъдев (представи се като разработчик на въпросното нещо):


Плугинът Infonotary Configurator 1.3.4 ви за Firefox създава проблеми с Firefox за Mac OS X. Проблмът се изразява в тотално irresponsive (не мога да преведа) интерфейс браузър. Страниците не се зареждат адекватно, на линкове трябва да се цъка по няколко пъти и въпреки всичко не се зареждат. Пробвах изключване на всички плугини на firefox - открих, че проблемът е във вашия плугин.
Версия на firefox: 3.6.10
Версия на Mac OS : 10.6.6.
Скрйншот с включен плугин (без пуснати други плугини):
Скийншот без
Грешка, която може би е свързана с плугина
firefox with infonotary plugin firefox without infonotary pluginfirefox error probably related to infonotary plugin
firefox error probably related to infonotary plugin
Date: Fri, 18 Feb 2011 12:44:39 +0200
From: Vasil Badev <v_badev_AT_infonotary.com>

това вече го прочетох на вашият блог. Както писах и там, проблема според мен не е в Infonotary Configurator for Mozilla. До колкото си спомням по телефона ви обясних, че единственото което прави той след първоначалната инсталация, е да проверява стойността на extensions.infonotary-mozilla-setup.lastVersion, при всяко отваряне на нов прозорец, и ако тя съвпада с текущата му версия спира работа. Не можете да ме убедите че по този начин се чупи зареждането на всякакви станици, както и SSL връзките. Понеже при забраняване или деинсталиране на разширението не се премахват настройките които то прави, теорията че точно това чупи Firefox ми се струва още по-невероятна. Не случайно бях предложил да дойдете до офиса за да се опитам да намеря проблема, но Вие не дойдохте.

Най-вероятно проблема е във лошо работеща версия на софтуер за смарт карти или лошо настроен pcscd демон, но това не се вижда от снимките които сте дали. В самият конфигуратор има изключително малко специфичен за Mac OS X код и той се изпълнява само при първоначална инсталация. Ако имаше проблем като описаният от вас той щеше да се прояви при всичките ни клиенти, както и на нашите компютри. След като проблема е само при вас явно е някъде другаде.

Mac-a на който реално се тества всичкият ни софтуер е с Firefox 3.6.12 и Mac OS X 10.6.6, но разширението е тествано и на Firefox 3.6.10.

Date: Fri, 18 Feb 2011 12:51:20 +0200
From: Vasil Badev <v_badev_AT_infonotary.com>

Здравейте отново,
чак сега прочетох какво сте коментирали в блога си, явно вече сте двама клиенти са точно същият проблем, но според мен той не е следствие от инсталацията на нашият add-on. Ако можете се обадете на телефона от подписа ми за да се опитам да локализирам проблема.

Date: Fri, 18 Feb 2011 13:14:29 +0200
From: mihail stoynov
Още веднъж: имайте предвид, че не желая да ви убеждавам в каквото и да било. Грешката наистина може да е във всичко и вероятно сте прав, тъй като познавате съответния плугин, но е непрофесионално да отричате грешка без анализ.
Вчера свалих файърфокс 3.6.13 и сега изтествах с включен плугин. Проблемът не се наблюдава, което може би показва, че сте прав. pcscd демона го включвам само като работя със сертификата, иначе ми държи по 10-20 процента от cpu-то постоянно и се принудих да включвам/изключвам ръчно, което е досадно. Надявам се няма да кажете сега, че това също се наблюдава само при мен 🙂 Ако проблемът се появи, ще ви пиша допълнително.
Отново с най-добри намерения,
Михаил Стойнов
Date: Fri, 18 Feb 2011 15:36:40 +0200
From: Mihail Stoynov

Отново се случи - виж атачмънта. Вече не съм сигурен в това каква е причината.

Date: Fri, 18 Feb 2011 16:08:57 +0200
From: Vasil Badev <v_badev_AT_infonotary.com>

Apple ползват много стара версия на pcscd, която проверява какви четци са включени пет пъти в секунда (подробности тук -http://ludovicrousseau.blogspot.com/2010/08/ram-and-cpu-improvements-in-pcsc-lite.html). На това се дължи и натоварването.

Проблема само при включено устройство ли се наблюдава?
Може ли да ми изпратите изхода от следните команди в терминал с включен четец:
ps ax | grep pcscd | grep -v "grep pcscd"
ls -l /usr/libexec/SmartCardServices/drivers
ls -l /etc/readers.conf
ls -l /Library/LaunchDaemons/org.opensc.pcscd.autostart
/Library/OpenSC/bin/opensc-tool -i
/Library/OpenSC/bin/opensc-tool -l
/Library/OpenSC/bin/opensc-tool -n
/Library/OpenSC/bin/pkcs15-tool -D

Терминала се намира в Application/Utilites. Всяка команда трябва да я копирате и да я поставите в терминал и след това да натиснете Enter.

Date: Sat, 19 Feb 2011 22:16:55 +0200
From: mihail stoynov

Проблемът го има и с изключен четец.

Забележка: спирам пускам pcscd със launchctl:

launchctl (un)load -w /Library/LaunchDaemons/org.opensc.pcscd.autostart

Резултати от командите в атачмънта
Date: Mon, 21 Feb 2011 12:55:49 +0200
From: Vasil Badev <v_badevA_AT_infonotary.com>

Ако при изключен add-on проблема не се проявява не знам какво да предложа освен да дойдете до нашият офис с компютъра и тук да се опитам да намеря къде е проблема.

Ако се прояви и при изключен add-on може ли да пробвате да обновите софтуера за картата и четеца.
За смарт картата първо ще трябва да деинсталирате SCA със sudo /Library/OpenSC/bin/opensc-uninstall след това инсталирайте последната версия от http://www.opensc-project.org/files/opensc/OpenSC-0.12.0-10.6.dmg. За четеца си инсталирайте актуалният драйвер на HID Global от http://www.hidglobal.com/drivers/omnikey/ifdokccid_mac_10.6_i386-3.0.2.dmg.

В новата версия на opensc няма файл /Library/LaunchDaemons/org.opensc.pcscd.autostart, така че няма да можете да спирате и пускате ръчно по същият начин.

Date: Mon, 21 Feb 2011 15:08:13 +0200
From: mihail stoynov

Ще изчакам да видя дали проблемът ще се окаже хроничен.
Ако не мога да спирам и пускам ръчно pcscd, не бих ъпдейтнал, защото понякога тъпия демон скача до 50% cpu и си стои така. Имам нужда да мога да спирам/пускам ръчно.

Още нещо: другите ползватели на тоя демон как свикват с натоварването? Ако това нещо стои постоянно, лаптопът ми постоянно ще върти вентилатора на 6000 оборота и ще е доста горещ

Date: Mon, 21 Feb 2011 17:44:41 +0200
From: Vasil Badev <v_badev_AT_infonotary.com>

По принцип демона се стартира в момента в който включите четеца. Повечето ни клиенти не са се оплаквали от подобен проблем, така че или не са забелязали или не се проявява при всички. На нашата тестова машина pcscd не натоварва процесора повече от 1-2%, но до преди малко на него нямаше инсталиран четец на OmniKey. Сложих му техният драйвер и един четец с карта и ще го наблюдавам тези дни.

Ако не искате да обновите OpenSC (стартовият скрипт е от него), може да сложете новата версия на драйвера на OmniKey. В момента сте с 2.6.4, а актуалната версия е 3.0.2.

How do you run windows when your primary OS is not Windows (need help)

My laptop is a Macbook. It runs Mac OS X. While the OS is awesome, it's not the most popular one. This would mean that there's software that is only made for Windows. And it's software that is custom, specific and generally cannot be changed for another software [running on OS X].

There is however one piece of software which even though it runs on OS X, I want on Windows. And that is Microsoft Office. MS Office for Mac OS X sucks. The ribbon interface is so ugly on Mac, the menus so different. And it deleted one of my presentations (while presenting it !!!). Don't even get me started on OpenOffice, iWork and all the copycats. When everyone around you is using MS Office, you have to use it too. Period.

So we agreed that I need Windows

The most common thing to do is get a virtual machine. I was using VMWare Fusion with one Windows XP and one Windows 7 installation for quite a while. The problem is the HDD. It just can't keep up with both machines (the host and the virtual). While stopping the swapping in the virtual machine can help, it doesn't fix the problem. And I have the fastest plate hdd available - 7200 rpm, a lot of cache. Also getting a lot of RAM also helps considerably - I have 4GB but the issue with the HDD remains.

I went to the competition

People said that VirtualBox and Parallels would do the job better. I tried VirtualBox for a day. Importing failed due to hardware inconsistencies and even while loading it just made the host os unresponsive. So I guess the competition doesn't do the thing better. What next?

What about remoting?

Using a dedicated machine that stays somewhere and logging on it only when needing windows could do the job. This means I have to buy an extra machine. Remoting would mean that I would need net constantly. And Remote Desktop for Mac is pretty bad. I could always switch to TeamViewer (also available for my phone), but it is not the best either. Also copying stuff while using my phone's 3G is not viable if the stuff is in the hundreds of megabytes scale.

What about SSD?

While the classic HDDs are good for working on serial pieces of data, SSDs shouldn't have the problem working in parallel with 2 streams of data. I have a friend who bought 50GB OCZ drive and he says his machine now went supersonic (a lot faster). The drive was like 130 euros. I can't work with 50GB. 128GB could maybe do the job but it's going to be tough. And buying a bigger one would be very expensive. Also I haven't asked how does this drive behave with a VM. It's important to do so.

And no I would NOT install Windows

...or get a Windows laptop. No way. No BootCamp either.

Conclusion: I need help

This problem would be relevant for everyone using any OS that is not Windows. So, people-not-using-windows, PLEASE HELP ME decide what to do.


Few days ago I opened The Pirate Bay and was astonished to find it full of ads. Sometime later it happened with another site. Finally, I found the problem. AdBlock was stopped. AdBlock is the plugin that must come preinstalled with every browser. It kills (removes) almost all ads from sites. It's easy to use and to customize (add more sites or ads to the block list).

Georgi said he found something that could accessorize AdBlock even further. Ghostery

sees the invisible web - tags, web bugs, pixels and beacons. Ghostery tracks the trackers and gives you a roll-call of the ad networks, behavioral data providers, web publishers, and other companies interested in your activity.

Since Firefox for Mac is awful. I'm using Chrome which is quite poor on the plugin front. But this one is available for Chrome and works pretty nice:

Mac OS X finally with a real Java

A quote from a newsletter from Oracle.

Oracle and Apple Announce OpenJDK Project for OSX; Java SE 7 and 8 JSRs Approved

Good news all around! Oracle and Apple announced the OpenJDK project for Mac OS X. Apple will contribute most of the key components, tools and technology required for a Java SE 7 implementation on Mac OS X, including a 32-bit and 64-bit HotSpot-based Java virtual machine, class libraries, a networking stack and the foundation for a new graphical client. OpenJDK will make Apple's Java technology available to open source developers so you can access and contribute to the effort.

Furthermore, the JCP Executive Committe has approved the JSR "quartet" for Java SE 7 and Java SE 8. With this ratification, the Java standard will progress through the JCP while the open source reference implementation will be delivered through the OpenJDK project. See you on OpenJDK!

-The Oracle Technology Network Team (See Team Blog)

This means Java SE 7 woud be available for Mac OS X too and that Apple users will receive Java as soon as other platforms dog. Also the four JSRs for Java SE 7, Java SE 8, Project Coin and Lambda Expressions.

Как да гледаме iptv.bg на iPhone/iPad

Това е ръководство за гледане на телевизии и слушане на радиа от iptv.bg чрез iPhone/iPad. Ръководството е тествано на iPhone 4G, iOS 4.1.

Важно е да се обележи, че ако не можете да гледате iptv.bg от компютъра, няма да можете да го гледате и от телефона - трябва ви wi-fi свързаност от провайдер, който е клиент на iptv.bg (Мтел не е клиент на iptv.bg и дори и радио не може да се слуша).

Необходими програми

Необходимо е телефонът, с който ще се гледа телевизия, да е jailbrеaked (споко, законно е).

  • iFile (има я в Cydia, платена)
    - файлов мениджър
    - има вграден текстов редактор (за отваряне на asx файловете)
  • iPhone Safari Download Manager (има я в Cydia, платена)
    - позволява сваляне на файлове от Safari
  • OPlayer (платена, 2.39€)
    - видео плеър - да плейва WMV8 енкоднати ASF стриймове (iptv.bg ползва такива)

За съжаление и трите програми са платени. С изключение на първата, другите две вероятно могат да бъдат заменени с други, които имат подобна функционалност (FStream успешно беше използван за слушане на радио).

Необходими стъпки

  1. Отворете iptv.bg в Safari и се логнете (създайте си потребител ако нямате):
  2. Изберете си телевизия или радио и изберете разделителна способност (hi-res и lo-res). Гледането на телевизиявисоко качество дори и на iPhone 4G е с насичане, въпреки че разделителната способност се "събира" в екрана на 4G. Ниското качество работи гладко на същия телефон.
  3. Задръжте пръст на тази иконка,  за да се отвори контекстното меню и, след като то се отвори, натиснете "Download Target...", което е част от Safari Download Manager (показано по-долу). Без Safari Download Manager няма да имате червения бутон:
  4. Изберете си папка, в която да запазите asx файла (папката няма никакво значение):
  5. Отворете iFile и намерете папката, в която сте свалили asx файловете:
  6. Цъкнете на синята стрелка вдясно от файла и ще се отвори следното меню:
  7. Изберете "Open with..." и ще се отвори следното меню:
  8. Изберете "Text Viewer" и asx файлът ще бъде отворен с текстов редактор. Asx файловете са мета файлове и всъщност стриймът за гледане на телевизия е този, който е трябва да се копира.
  9. Копирайте избраният адрес:
  10. Отворете OPlayer и изберете "Open URL":
  11. Ще се отвори следната страница, цъкнете на адрес бара:
  12. Изберете пейст, за да копирате адреса от asx файла:
  13. Сега адресът за гледане е зареден и остава само да натиснем бутона Done, за да го заредим:
  14. Voila, вече гледаме телевизия. Това е високо качество и насича сериозно дори и при "избити" други приложения.
  15. Ето и други скрийншоти (ниско качество):
  16. Ръчното вадене на url-тата е адски досадно, но OPlayer помага като запазва последните използвани адреси, а линковете дори и след няколко дни все още са активни (не знам кога expire-ват):

    (Плейлисти не знам как се правят, накрая ме домързя)


Качеството на гледаната телевизия е добро, няма насичане. Може да се слуша радио на фонов режим и да се работи с други програми. Аз започнах тази идилия, защото исках да слушам радио Витоша, а те стриймват само през iptv.bg и така стигнах до гореописаното решение.

Допълнителна информация: https://mihail.stoynov.com/2010/12/07/iptv-bg-on-iphone/.

Изпробвано и работи на iPhone 4G, iOS 4.1. Не съм тествал на iPad, защото нямам такъв под ръка, но смятам, че ще стане. Ако някой друг тества на друго устройство или с други програми, ще се радвам да сподели мнение в коментарите.

Вероятно същото решение може да се приложи и на Android телефони или Windows Mobile, Symbian, Blackberry като се използва същото вадене на стрийма, но не съм пробвал. Всеки споделен опит е добре дошъл.

По-удобно би било ако iptv.bg предлагаха директен линк към asf стрийма. Не пречи да се пита.

iptv.bg on iPhone

(Ръководство на Български за гледане на телевизия от iptv.bg на iPhone/iPad)

iptv.bg is a streaming service for mostly Bulgarian tv and radio stations. The good thing about it is that it's integrated tightly with most ISPs (mine too) so the speed is impeccable. iptv.bg offers paid plans for even more stations.

I don't own a tv set and don't have a cable subscription, so usually don't watch tv. Rarely though, I want to watch a formula 1 race or a football game. Then I use iptv.bg.

iptv.bg offers the following options:

The first two expect browser plugins that allow watching inside a browser window. Since I use Mac OS X with Chrome both these options are not suitable. The third is an ASX file that could be opened with a suitable player.

VLC opens such files directly, but I prefer Mplayer. I personally thing Mplayer is the best player there is, because:

  • it can open everything. Very rarely will there be a file that Mplayer can open and something else can
  • it's the fastest and lightest player I've tried.
  • It has the best controls I've ever seen: arrows and pgup/pgdn can fast-forward/rewind with 10 sec., 1 min., 10 min. respectively.
  • It can open files that are still downloading and even index them (-i option) so that fast-forward and rewind are possible.
  • Can open URLs, user can specify buffer size.
  • Comes bundled with mencoder - an application that can encode/decode video.
  • Has multiple GUIs for different platforms - MPUI and native for Windows, Mplayer OSX for Mac.

The ASX files are meta files and look like this:

<ASX version = "3.0">
        <TITLE>bTV - test live (368x294)</TITLE>
        <AUTHOR>bTV - test</AUTHOR>
        <COPYRIGHT>bTV - test</COPYRIGHT>
        <REF HREF = "http://medicom1.hdtvbg.com:8080/.../btv.asf" />

(Medicom is my ISP)

The problem with Mplayer and iptv.bg is that Mplayer cannot open ASX files and in order to play it, the ASF url in the ASX must be manually extracted and opened in Mplayer which is very annoying.

iPhone and iptv.bg

Where does the iPhone come in the picture? Well, I tried to find whether Mplayer could run on iPhone and found an app (oplayer) that can open streaming asf files. Oplayer successfully opened asf urls from iptv.bg:

Some tips: even on iPhone4 the hi-res streaming is too processor-heavy to run smoothly. the lo-res streaming run very nice.

Oplayer too cannot open asx files directly so the url has to be manually extracted from the asx file which on an iPhone is even more cumbersome and annoying.

All streams that iptv.bg suppies are asf, so I guess any player that supports asf containers and can decode wmv streams can play iptv.bg.

So running iptv.bg on iPhone is possible, but can be made a lot more user-friendly.

Android phones vs. iPhone

The Android chains are now broken. Android is supposed to be open source but most google apps are not, as are the drivers. I was using HTC Magic for a year and I was sick of it. The phone came with Android 1.5. I changed that with Android 1.6 wih SenseUI taken from xda developers' forums.

HTC does not supply new versions of Android for its older phones. I was running on a customized OS done by some guy just to be able to enjoy new features. The most used app was 'killall' just so I can pick up when someone called.

Virtual machines and the HDD issue

There’s this common issue with virtual machines – the HDD deficiency (I may have coined a new term). You see contemporary processors are so fast and allow virtualization that they can easily handle the load. The harddrives in contrast cannot handle load coming from different entities, that is, harddrives are bad in multitasking. It’s just to expensive to switch between tasks.

Most modern operating systems have a mechanism called commonly paging. It refers to the process of moving data from the limited main memory (ram) to a special (most often) file on the disk. The main memory is gazillion  times faster than a harddrive, but limited, ergo the need for more virtual memory. Weirdly enough most contemporary OSes start using the page file way before they reach the limit of the physical memory (actual ram).

Contemporary machines can handle a lot of memory (2 or 4 gb for example). So why use a page file?

Switching the page file can be done like this:

then do that:


This is the memory print of my vm:

idle:vm.memory.print with 3 browsers, outlook, word:


I think the handling of my machine (host os)  is better now. Let’s see if the impression persists…

How is it that all laptops are with DDR2, only Apple goes to DDR3?

Most currently sold laptops are with DDR2 memory. Even the high-end ones, like Sony Vaio. It would seem that only Apple sells its current line of laptops (the aluminum body ones) with DDR3.

Why is that? Why isn’t there other high-end laptop with DDR3? It would only make sense to make it faster with DDR3. Or maybe it wouldn’t make it faster? I checked it out.

This is an excerpt from a post in the forum of macrumors.com

The polymac has 2gb of DDR2 @667mhz much like it's predecessors. The aluminum mac has 2gb of DDR3 @1067mhz. At first glance you might say WOW! 1067 is a lot more megahertz than 667! I gotta have that.

This doesn't figure in 3 things.

1. DDR3 increases speed at the penalty of higher latency. In real life terms, lets simplify it a lot and say that DDR2 and DDR3 are cars, and that the top speed of DDR2 in this case is 66 mph and the top speed of DDR3 is 106mph. But DDR2 has lower latency than DDR3, so lets say DDR2 only has to drive 5 miles and DDR3 has to drive 8 miles. So if the speed were the same it would take DDR3 longer cause it has a longer way to drive. DDR3 makes up for it by driving faster, and as you can see the faster you can get DDR3 the less difference the latency makes (i.e. that 3 miles makes less over all difference when you drive 160mph i.e. DDR3 1600mhz (no not available on macbook)) What this does mean though is that at lower speeds of DDR3, there isn't much benefit as the extra latency makes the performance very similar.

2. According to others you can upgrade your ram to DDR2 800mhz

Now let's go back to point 1. Now if DDR2 can go 80mph over 5 miles vs. DDR3 going 106mph over 8 miles, there's probably even less of a difference.

3. The last and most important thing to remember is that computer performance is tied to all the hardware, and is bottlenecked by some things far more than others. In some benchmarking between DDR2 800mhz and DDR3 1067mhz on a PC with virtually identical hardware otherwise, the bandwidth increased from 6146 to 6613... or about 10%. Which sounds alot faster. But then they performed other benchmarks, such as super pi, which showed that
the DDR2 800mhz finished in 46.08 seconds and the DDR3 1067mhz finished in 45.11 seconds. The difference is 0.97 seconds or a whopping 2.1% performance boost.

The guy even supplied a lot of benchmarks:

To further illustrate this here are some benchmarks with the old polymacbook vs the new aluminum macbook


To better demostrate apples to apples, (no pun intended we'll look at the 2.4 ghz macbook aluminum vs the 2.4ghz polycarbonate) in photoshop CS3

Lower time is better
Macbook Aluminum 2GB ram 99.34
Polucarbonate macbook 2GB ram 107.63

which shows that the macbook aluminum is faster 1067 vs 667 here.

But what happens when you upgrade to a 320gb 7200 rpm drive?

Macbook aluminum 2gb ram stock 99.34
Macbook aluminum 2gb ram 320gb 92.28

how about when we upgrade the ram?

Macbook aluminum 4gb ram stock 79.06
Macbook aluminum 4gb ram 320gb 77.19
Polycarbonate macbook 4gb 78.41

Then the guy continues with comparing prices of the two macbooks.

Source: http://forums.macrumors.com/archive/index.php/t-654277.html

Since this is a forum post, one has to check the validity of the statements. So I went to wikipedia. This is what I found out:

CAS (column address strobe) latency (CL) is the delay time which elapses between the moment a memory controller tells the memory module to access a particular column of memory on a DRAM memory module, and the moment the data from given array location is available on the module's output pins.

In asynchronous DRAM, the interval is specified in nanoseconds. In synchronous DRAM, the interval is specified in clock cycles, and must be multiplied by the cycle time (i.e. divided by the clock frequency in GHz) to convert to nanoseconds.


Because they have multiple internal banks, and data can be output from one during access latency for another, the output pins can be kept 100% busy regardless of the CAS latency; the maximum attainable bandwidth is determined solely by the clock speed. However, that only applies if the data to be read is known long enough in advance; if the data being accessed is not predictable, the latency matters. For a completely unknown memory access, the relevant latency is the time to close any open row, plus the time to open the desired row, followed by the CAS latency to read data from it. Due to spatial locality, however, it is common to access several words in the same row. In this case, the CAS latency alone determines the elapsed time.

[…] Note that memory rated for a certain maximum speed can always be operated at a lower clock rate. The CAS latency can be set lower in such a case. […]

[Then there’s a table showing how DDR3@1066Mhz has a CAS latency of 7 cycles and DD2@666Mhz – of 5 cycles]

Source: http://en.wikipedia.org/wiki/Memory_latency

So the guy in the forum seems to be correct.

One thing remains unfolded though – why is the latency higher with higher speed? This is not explained in either the wiki, or the forum post. And unfortunately I don’t have the time to investigate.

If someone knows, please share.

This brings me to the reason I investigated all that - I have a spare 2x 1GB DDR@1066 Mhz:


(I guess no one will want them because only Macbook guys have machines with DDR3 and the minimum for them is 2GB)

I have high hopes for the 160GB-5400rpm-Hitachi harddrive though.


If someone is interested, please let me know.

Install Snow Leopard (Mac OS X 10.6) from USB and restore only user files from Time Machine

Install Mac OS X 10.6 from a USB memory stick.

Here’s a tutorial on how to install Mac OS X from a USB stick.

Restore only user data from Time Machine

So now comes the restoring. I wanted a clean install – the last installation was pretty messed up.

Now is the time to say that I have a Time Machine for backing up stuff. I didn’t want to restore any system stuff, neither I wanted to restore users and their settings. I just wanted to restore ~/Desktop, ~/Documents, ~/Downloads, ~/MyFiles.

This came out to be VERY HARD.

When installing the OS, the installer asks for a Time Machine, but I said NO, cause I was afraid that it would restore more than I wanted it to.

After the installation was complete I launched Time Machine and tried to go back. I had the snapshots but couldn’t restore them because the owner of the files no longer existed.

With a lot of manual copying I managed to move the data back to my harddrive. Now I had to fix the permissions. Using Mac OS X for that could prove to be impossible.

The console

Going to the console helped a lot.

First to change the owner of a directory:

$ sudo chown -R mstoynov Desktop/
$ sudo chown -R mstoynov Documents/
$ sudo chown -R mstoynov Downloads/
$ sudo chown -R mstoynov MyFiles/

Some of the operations may fail with:

chown: Desktop/web/UC.class: Operation not permitted

The problem most probably resides in some flags being set up. Most probably uchg.

To see whether any files have uchg anywhere in a directory, I did:

$ ls -lOR Desktop/ | grep uchg
-rwxrwxr-x  1 502   staff  uchg   4228 29 Мар  2003 GrandeProjecto.jpx
-rwxrwxr-x  1 502   staff  uchg   1676 18 Авг  2003 GrandeProjecto.jpx.local
-rwxrwxr-x  1 502   staff  uchg    832 29 Мар  2003 GrandeProjecto.jpx.local~

To fix the uchg flag, I did:

sudo chflags -R nouchg Desktop/

Then again chown is required.

That’s it. Now my data is once more mine.

Chown the data on the time machine

The same problem with permissions exists in the time machine. There fixing them is not so easy – to many symlinks and too many directories owned by root. Also I don’t know whether I should remove uchg from anywhere. So fixing all that is not that simple. If I figure it out – I’ll share the knowledge.

Install Snow Leopard (Mac OS X 10.6) from a USB

Mac OS X 10.6 image is 6.3 GB. Using a normal DVD does not work.

Since I’m lazy to go out and buy a dual-layer dvd (8.5 GB max), I decided to use a USB flash to install the new OS.

This is a good guide on how to do that: http://www.maciverse.com/install-os-x-snow-leopard-from-usb-flash-drive.html.

The only problem is that I didn’t actually use a USB stick, but this:

Kingston MicroSD HC 8GB. It comes with 2 different SD adapters, and what is very cool – a very tiny USB adapter. It’s the smallest USB I’ve ever seen.

I bought this for my phone, but came out to be very handy. By the way I highly recommend this Kingston memory.

So the problem with this memory is that it took roughly 2 hours for the Mac OS X 10.6 image to burn (I can’t say burn in this case, right?), while in the tutorial they say it took them only 20 minutes. The memory went pretty hot also – it was working hard for a couple of hours.

I wanted a clean install so I erased the hdd first.

Everything else went like a charm.

iReport 3.0.0 on Mac OS. How to make it work?

iReport is a gui for designing jrxml (the actual reports) files for JasperReports. It is supposed to work on any platform.

We’re using 3.0 instead of 3.5 because 3.5 is based on Netbeans.

I’m trying to work with it on Mac OS (it was extremely slow in the virtual machine, something to do with java I guess).


chmod u+x iReport.sh

…because it’s not executable.

But then it gave me a weird error:

comp:iReport-3.0.0 user$ ./iReport.sh
-bash: ./iReport.sh: /bin/bash^M: bad interpreter: No such file or directory

Google said it’s because of the problem with newline in different platforms. In linux it’s LF (\n)(line feed). In windows it’s CRLF (\r\n) (carriage return, line feed).

So this ^M character appearing in the error is actually the left-out CR.

How to fix it? Wikipedia says:

tr -d '\r' < inputfile > outputfile

This works. But then the next error. iReport.sh calls bin/startup.sh.

The same thing for it.

That’s it. Why was the shell script in a dos format only god can tell.

Note that iReport on a Mac should be in a place whose path does not involve spaces. Here’s a solution for that too.

Macbook, the mac way of doing things.

After having a Dell Inspiron for a year (search ‘dell’ in the blog) and having issues with stability (battery died in less than a year, the power charger blew up, it started falling apart, heating up) I decided it’s time for a change. I wanted something very sturdy and then saw the new aluminum body Macbook. So I thought this was it.

I now have it for 6 months and I’m pretty happy with it. Battery takes up to 4 hours, usually 2.5h. The body is exceptionally strong. It' doesn’t heat as much although when Firefox goes berserk (100% processor time) it does heat up.

Switching to Mac OS took some time, but still a lot less than expected. There’s always a windows on a virtual machine, but I rarely use it. Mac OS is really nice to play with. And a lot faster than the vista I had on the dell (search vista in the blog).

I’m not an Apple fan for so many reasons, but they made a pretty stable and usable laptop. That’s my initial experience.

While in the states I saw the new one, with the only major difference being a battery they claim could support the laptop for 7 hours. I don’t believe it, but even 5 would be very nice. Especially for 9-hour over-Atlantic-ocean flights.

How to set up networks and dhcp on vmware (on Mac and other OSs)

How to do networking with VMWare Workstation or VMWare Fusion?

For clarity, let's assume that the host (the machine running vmware fusion or vmware workstation) has the ip of

On every virtual machine there are three options:
Bridged (VM becomes visible to other machines beside the host. It has an IP like
Nat (VM is visible only to the host, there is internet).
Host only (VM is visible only to the host, but no internet).

Do ipconfig or ifconfig.
vmnet8 is for NAT.
vmnet1 is for host-only.
These are whole networks for virtual machines. If nat is chosen, then the VM would be supplied an IP from the vmnet8 pool.

If 'bridged' is chosen, then the administrator of must assign an address to the VM.
if 'nat' or 'host-only' is chosen, then:
(I'll describe how to do this on a mac):


$cd /Library/Application Support/VMware Fusion

stop vmware networking:

$sudo ./boot.sh --stop

Let's suppose vmnet8 is and vmnet1 is

I would like to change the network from to and I would like to specify a virtual machine with a specific IP.

We're still in /Library/Application Support/VMware Fusion

Then:$ grep 172.16.57 *locations:answer VNET_8_HOSTONLY_HOSTADDR

Then all files in the list must be changed.Then we go into /Library/Application Support/VMware Fusion/vmnet8/

Then the same: 

$ grep 172.16.57 *dhcpd.conf:subnet netmask {dhcpd.conf:    range;dhcpd.conf:    option broadcast-address;dhcpd.conf:    option domain-name-servers;dhcpd.conf:    option netbios-name-servers;dhcpd.conf:    option routers;nat.conf:ip = or ip =

All of them must be changed.

If a specific VM must have a specific IP we go to:/Library/Application Support/VMware Fusion/vmnet8/dhcpd.conf and we add the following:(get the mac from the VM (ipconfig, ifconfig eth0))

host myhost {    hardware ethernet 00:0C:29:B2:C9:69;    fixed-address;}

Then to renew the ip (ipconfig /release, ipconfig /renew for windows):sudo ifconfig vmnet downsudo ifconfig vmnet up

The last thing is to start the vmware networking:sudo ./boot.sh --start

Then to renew the ip inside the VM (ipconfig /release, ipconfig /renew for windows):sudo ifconfig vmnet downsudo ifconfig vmnet up