Monday, December 17, 2012

yoni 0.8.1

Here is first bug-fix release for alpha yoni release :)
No much changes here.
  1. I've discovered that my Arch Linux's python 2 binary is 'python2', while it is 'python' in my Sabayon. So, I added ability to configure path for python 2 binary. Just edit bin/yoni and update "PYTHON" variable accordingly.
  2. yoni 0.8.0 did not closed vpn connection on exit. I believe this was wrong, because once the application established the connection it is supposed to close it on exit. Kind of clean-up. yoni 0.8.1 has no such problem any more.

Thursday, December 6, 2012

yoni 0.8.0

So, here it is: yoni 0.8.0!
I consider it alpha right now. Nevertheless yoni is fully functional tool.
The package contains usage instructions and list of required packages. No installation is needed - just unpack and run. The launcher is (unsurprisingly) in bin folder :)

Further plans. I plan to release 0.9.0 (beta) in January, 2013. Then in February 1.0.0 should see the light of the day.
There might be also bug-fix releases in this period.

Any questions/suggestions are welcomed :)

Wednesday, December 5, 2012

Introducing yoni

The sad truth is that majority of people of the world are living in totalitarian countries now. This includes not only my beloved Ukraine, its neighbour Russia and a few remaining communist states. This also includes US, Australia and most of EU countries.
As the government tumour grows the space for privacy and anonymity shrinks. 
Luckily, we still have the generic computer. And technology advances very rapidly. And greedy politics are too stupid to keep the pace :)
One example of technology that defends privacy and anonymity is vpn. It's cheap and easy to use. But it has a caveat: sometimes vpn connection breaks. Starting from that moment the privacy and anonymity of vpn user might be compromised.
Until now Linux users had 2 solutions: play around with TCP/IP routes of use VPNCheck. This software is free, but has multiple limitations comparing to paid version, requires Mono and is closed-source.
So, I decided to provide a 3-rd option for Linux folks. It's a very simple open-source software. I called it yoni. It requires puthon, dbus and networkmanager. Yoni is available on sourceforge in git repository (no package yet!) along with a little howto right now. And I'm going to make an alpha release soon.
How it works? It connects to vpn (of user choice) and launches application(s) (of user choice). In case vpn connection is lost, yoni kills the application(s) and tries to connect again. Once connected it launches the application(s) again. And so on. Until user stops it.
Try it out! But be warned: this is my second python application. The first was hello world :)

Monday, April 23, 2012

Do not buy Intel's Ivy Bridge CPU!

Intel just launched new CPU line - Ivy Bridge family. There is a problem however. With shiny new CPU you will buy a back-door for your PC. Intel calls the back-door "Intel Insider". 
Intel Insider is DRM. More precisely it allows third-parties to remotely control your PC when the third-parties wish to.
This anti-feature first arose in Sandy Bridge family. It was warmly greeted by Intel customers. In fact it was so warm that many Intel customers become AMD customers.
Returning to Ivy Bridge. Intel listened to MAFFIA and not to its customers. Intel Insider is still present in those new CPUs.
So, If you want to control your PC, do not buy Ivy Bridge!

Wednesday, April 4, 2012

Aligning partitions, lvm and encrypted volumes on SSD

The disk: OCZ Vertex3 120GB
The goals:
  • partition disk with GPT
  • prepare disk to host multiple Linux-es (multiboot)
  • setup an LVM
  • make a few encrypted logical volumes
  • make the whole stack work fast, namely align all :)
The tool: sysresccd (on USB stick)

The main idea is to make sure every layer aligns to SSD erase block.
If there is any error on any level the whole work is probably wasted. I'm not an expert, so, I can be wrong :)

Erase block size is probably 2 MiB. The post on forum states 2 MB, but I assume they actually mean 2 MiB. This is very important number. Every step must take it into account. As extra caution measure I would align everything to 4 MiB.

1. Creating GPT partition table
Warning! This destroys all data on the drive!
Boot from our sysresccd, and load gui.
Start GRparted.
Device > Create Partition table... > Advanced > select "gpt" > Apply

2. Creating aligned partitions
We are still using GParted.
2.1. Unallocated space at the beginning of the drive. The purpose of this space is to hold partition table. I'm giving it 8 MiB (dividable by 4 MiB). To create such space you need to create the first partition which starts at 8 MiB. I'm not sure if this step is need, I've read different opinions about this. But I don't worry too much about this, it's just 8 MiB after all :)
2.2. Bios boot partition. 32 MiB (dividable by 4 MiB), fat32, flagged as "bios_grub" (this is important). Wikipedia article states a few MiBs should be fine, but Sabayon howto recommends 32MiB. I'm not greedy, so I choose the latter. Again, it must be flagged as "bios_grub". It might be good idea to add labels to partitions. I named this one "groob_boot".
2.3. Multiple partitions for /boot volumes of multiple Linux-es (each Linux will have its own /boot). 400 MiB (dividable by 4 MiB), ext2 each. This is where grub2 will put its staff. I'm labeling them like "ubuntu_boot", "sabayon_boot", etc. I created 5 such partitions, which is probably a little bit overkill. But who knows :)

3. Creating physical volumes (which will host my logical volume group)
Physical volume contains metadata  area at the beginning of the volume followed by actual data area. Here it's important to start your data area aligned. So, we use --dataalignment option with value 4m (which is 4 MiB):
pvcreate --dataalignment 4m /dev/sda7
--dataalignment option means that data area will start to a multiple of its value. 
Following command will show you where the data area starts.
pvs -o +pe_start

4. Creating logical volume group
Due to physical volumes were created with  --dataalignment option, we need set physical extent size for volume group. To do so we pass -s option to vgcreate. As you can see I'm passing the same 4 MiB:
vgcreate -s 4m vg_main /dev/sda7

5. Creating logical volumes
Nothing special here. E.g.:
lvcreate -L 10G -n lv_ubuntu_root vg_main

6. Creating encrypted containers
Next we setup an encrypted volume above logical volume. According to this mail the encrypted container also should be aligned. To do so we pass --align-payload option which value is in 512 bytes sectors. To align to 4 MiB we do:
cryptsetup luksFormat --align-payload=8192 /dev/vg_main/lv_ubuntu

7. Creating file systems
The post in OCZ  forum states that tuning ext3 and ext4 "probably won't effect performance". One of benchmarks I've found shows questionable effect from such tuning. Arch wiki page omits the tuning also. So, I'm not using it :)

Monday, March 26, 2012

Idea 11 does not supprot TestNG 6.4

In one of my project I've started using TestNG as unit testing framework. The project itself is Maven based. So, obviously I added appropriate dependency to my pom file:
As you can see I've used the latest TestNG version available at this time, which is 6.4.
But when I was trying to run any test from Idea, I saw following error: Broken pipe
    at Method)
    at org.testng.remote.strprotocol.SerializedMessageSender.sendMessage(
    at org.testng.remote.strprotocol.MessageHub.sendMessage(
    at org.testng.remote.RemoteTestNG$RemoteSuiteListener.onFinish(
    at org.testng.SuiteRunner.invokeListeners(
    at org.testng.SuiteRunnerWorker.runSuite(
    at org.testng.TestNG.runSuitesSequentially(
    at org.testng.TestNG.runSuitesLocally(
    at org.testng.remote.RemoteTestNG.initAndRun(
    at org.testng.remote.RemoteTestNG.main(
    at org.testng.RemoteTestNGStarter.main(
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(
    at java.lang.reflect.Method.invoke(
    at com.intellij.rt.execution.application.AppMain.main(
The error is strange and there is no my code in the stack trace. Also, test was finishing fine if run by maven. This hints that there is something wrong. And this something is IDE-related.
I used a linux answering machine to find out what is wrong. The answer was found very quickly: Idea 11 does not support TestNG 6.4. The workaround is to downgrade TestNG version to 6.3.1. I did just that and the problem vanished :)

P.S. I'm still confident that Idea is the best java IDE :p

Friday, January 27, 2012

Downgrade svn from 1.6 to 1.7

I'm using a Sabayon as my primary OS now. It's a rolling distro. And it fairly quickly incorporates latest changes from mainline projects.
Few weeks ago among other updates subversion was upgraded from 1.6 to 1.7. At first there were no problems, because I mainly used command line svn client. I upgraded my working copies to 1.7 and was happy.
The problem started to arise when I tried to work with upgraded working copy from my IDE - Idea. The first problem was that Idea does not support subversion 1.7. And will not support it for a few more month. 
So, I tried to downgrade subversion package on my OS. This failed, because 1.6 was removed from repository. 
There was a chance to build 1.6 from sources. But I prefer not to mix binary and compiled from sources packages. 
I ended up with solution suggested on stackoverflow. I used another OS (Ubuntu) on my multi-boot machine which still has subversion 1.6. From there I deleted a subversion folders from my projects. Which is easy in subversion 1.7 ;) Then I made a checkout to existing projects. This allowed me to not loose any changes. Then I rebooted to my primary OS and used subversion from IDE only.