• My website is going hacker - switching from Blogger.com to Jekyll
    Jan 12, 2015

    This weekend I finally decided to re-build my website with Jekyll, and move away from Blogger.com! When I found about static site generators, I immediately liked the idea and decided to learn them. After doing a project with Jekyll, I thought it's time to switch my website to it. Static site generators are gaining popularity and they definitely have a market, so it's a good idea to learn using at least one of them!

    Old blog

    While I was quite satisfied with blogger.com, I missed the following features:

    • Syntax highlighting - getting it right wasn't straightforward.

    • Uploading files - Sometimes I just wanted to upload pdf or other files, and I had to resort to hacks like hosting them on Google Drive

    I also just wanted more control over layout and content of my website. When I saw Jekyll, and found out that GitHub Pages hosts websites for free and allows custom domains, something clicked in me!


    For those who can code, the following features of Jekyll I think make it a good solution for personal blogs:

    • Architecture of Jekyll allows to have enough automation of website building, yet not to loose control and customize easily wherever I want it.

    • Static generation for blogs and websites is indeed an awesome idea - why do dynamically load something which is updated once per week/month on average.

    • I like the idea of writing posts in Markdown on a Git repository, rather than custom-build web WYSIWYG editors. Syntax is just much cleaner, and including code samples is very straightforward. Having Markdown on Git also means that I could blog from my Chromebook and not worry about internet connection.

    • Jekyll has a nice importer tool which can import posts from different blogging platforms.

    While I also considered Octopress, I decided against it, for the reasons highlighted here.


    Switching from Blogger involved following steps:

    • Design the Jekyll website.

    • Imports posts; this did not go as smooth. I had a few import errors, which I had to fix manually by removing some elements from Blogger's exported xml file.

    • While I imported posts, I also didn't want to loose comments on them. Disqus came to help - not only it enables Jekyll website to have comments section, it also allows importing comments from existing blog.

      • To make Disqus recognize posts, I had to change permalink layout of Jekyll website to match Blogger.com
    • Though not necessary, I decided to change HTML formatted posts to Markdown.

    • I generated sitemap.xml through jekyll-sitemap plugin, and also manually put Google Analytics code.

    • Github Pages do not support custom plugins, so I created a separate repository for Jekyll sources, and I generate results to the repository which hosts the website.

    While my website is mostly operational, I still have few things to do:

    • Tag cloud and post archive view. Though post archive may not be so useful because I don't have many posts, I like the idea of having a tag cloud.

    • Most of the files to which my posts link are still located in different locations such as Box.net or Google Drive. I need to consolidate them in one place to not depend on different services.

  • I now have German citizenship!
    Nov 21, 2014

    This May I finally completed something I've been on for last 2.5 years - I'm finally holding a burgundy-red German passport with my name and picture in it!

    Swiss documents pile Left: Temporary passport which I got the same day as the certificate of naturalization. Right: Germany allows having several passports to circumvent certain travel restrictions.

    I learned that I could be qualified for naturalization in Germany from my alma mater's alumni magazine where one of our alumni said that the years you spend in Germany as a student (on a student residence permit) fully count towards citizenship. I was so surprised, since before I only knew about US immigration where the time you spend on student visa doesn't count towards anything. Also, naturalization and residence permits in Germany are done by completely different entities, and therefore it's a different set of laws!

    I then had to complete German language requirements (level B2 for me, since I wanted to qualify for a fast-track naturalization through special integration), and also pass the citizenship test. The citizenship test was honestly a joke - I expected to learn much more about German history and culture, but I passed it with full points even without speaking good German.

    Ideally I wanted to keep my Azerbaijani citizenship because, well, why should something I have be taken away from me? It may also take around a year to renounce it, and since I wanted to move to US, my goal was to get German passport as soon as possible. Besides, dealing with Azerbaijani authorities wasn't exactly something I was very excited about, and I also wasn't excited about having to get a tourist visa every time I visit Azerbaijan (visa-on-arrival in Azerbaijan was canceled in 2010).

    Things however aren't ideal. All my attempts to convince German authorities to let me have dual citizenship failed badly (thank you Roland Koch), and I had to renounce my Azerbaijani nationality. Having had some other issues, I ended up being stateless for half a year.

    Overall, I understood that I had to be pushy and it was solely my job to ensure that the process was moving forward. Cases sometimes get lost or forgotten, and just being in waiting rooms I've witnessed many cases where authorities did not respond for as long as a year. Also the letter confirming that I don't have the Azerbaijani citizenship anymore was lost in the mail, and I wouldn't find out about it if I didn't have a habit of calling the embassy every now and then to inquire about my case.

    Benefits I have? Well, now I can live and work in any EU country, and I have much less travel restrictions compared to Azerbaijani passport. I can travel to 181 countries visa-free, and as someone who loves traveling this gives me a travel-gasm. I got a 5-year F1 visa for US, instead of 1-year one given to Azerbaijanis. I also got lucky that starting starting 1st September 2014 there's a visa facilitation agreement between Azerbaijan and EU, so having family in Azerbaijan, I get free one-year visas.

    Whether it was worth all the trouble, especially considering that I live in US now? I don't know. But I'm proud that I did not give up and got through this.

  • Pre-Exam Warm Up
    Oct 17, 2012

    It's been a while since I have blogged! A lot has happened to me in last year. I was admitted into Goethe Universitaet Frankfurt to Master's program in Wirtschaftsinformatik (Business informatics), with extreme luck I'd say, since they did not see that I don't have required DSH. Then I had to learn German, and eventually got DSH 3. And I also went and still going through legal troubles to get German passport.

    Last semester went pretty tough for me. Not that I managed to switch from full-time job to part-time job only in the middle of the semester, due to possibility of losing work permit and consequently ability to apply for German passport, but I also had to pass all the preparatory economics courses during that semester (because of a mistake of my academic adviser, not telling me that I have to be done with them in first 2 semesters). Oh, and all of that was in German, which I still had troubles with.

    But it all went pretty well. In the beginning of June I finally got permanent residence, which enabled me to switch to part-time job, and then after a short vacation I was day and night in the library, when not at work or in the lectures. I knew I had to work hard: first, I had to catch up with the material, second, I had to spend more time on material, because it was in German, and third, I had to pass all the exams not to be kicked out. And since usually in German universities the grade for the course comes from a single final exam at the end of the semester, I also needed concentration during finals' period. So I came up with something I call the pre-exam warm-up technique.

    Most of exams in Uni Frankfurt last 1.5 hours, which is pretty short, so you don't want to loose any time. What I noticed before from exams, is that when you go in, it may take up to 10 minutes until your brain becomes fully focused on material. It's like the warm-up phase that athletes need to catch their "second wind". In 1.5 hour exam that is a lot of time, it's most likely the time you don't want to loose. So I did what I learned in Thai Boxing, that when you have a fight, you warm-up BEFORE entering the ring, so that in the ring your body is already warm and on its top performance. I warmed up my brain BEFORE entering the exam, so that I start the exam with my brain fully concentrated on the subject. I usually did this by coming around half an hour earlier to university, and repeating exam material, either by last-minute memorization, or just solving/skimming over practice problems. If the exam is early in the morning, I have to mention the importance of right sleeping: it's best if the night before the exam you sleep and then wake up 1-2 hours earlier than usual. The only break that you get is when you have to remove your books/materials right before the exam, but that is negligible, your brain is already awake enough to be on its top performance, but still has energy for 1.5 hours of exam.

    This especially helped me a lot with one exam, where there are a lot of question, and there is barely time to finish them all. I finished it in the last minute right before I had to give it in, and consequently not only passed, but also got a pretty good grade from it. Overall, I passed all the exams in last semester, even thought not all of them with good grades, but I still feel good about it :) A month after the finals were over, I had to take DSH exam, which I also passed, so now I can continue my master's studies without any hindrance.

    A new semester started now, and I am really looking forward it, I have a lot of interesting courses this semester. Good luck to all fellow students!

  • Transferring Glassfish 2.1 Server
    Jul 18, 2012

    I needed to set-up a new Glassfish server, but because it was heavily customized and configured because of the project I am working on, it was better to transfer it - that is to pack it in old location, and unpack in new one. After a bit of tweaking, I made it run, however it would not start due to following error:

    [#|2012-07-18T17:19:52.818+0200|WARNING|sun-appserver2.1|javax.enterprise.system.stream.err|_ThreadID=10;_ThreadName=main;_RequestID=e0307780-d207-48c1-81ba-0be61d2f1037;|java.lang.RuntimeException: EMBEDDED Broker start failure:code = 1

    This happened because the Glassfish on the other computer was packed while running, thus some lock file was there. ( Lesson: shut down the server before transferring)

    So what you have to do is remove the following file {domain_folder}\imq\instances\imqbroker\lock, and the server will work just fine.


  • Recursively deleting .svn folders.
    May 4, 2012

    In Windows, create a clearSvn.cmd file and put following contents in it:

    for /f "tokens=* delims=" %%i in ('dir /s /b /a:d *svn') do (
        rd /s /q "%%i"

    Running it should do the job. Alternatively .cvs or any other recursively occurring folders can be deleted by this script.

    For MacOS, Linux and other Unix-compatible systems, the command would be even simpler:

    rm -rf `find . -type d -name .svn`

    However when you check out the project for the first time and want to later delete svn dependencies, it is better to use svn export.

  • Removing Glassfish 3 Windows Service
    Apr 19, 2012

    I've recently tried removing the Glassfish 3.1 server that I had installed long ago, and came into the problem that even after uninstalling the Glassfish from the system, there was still a windows service that was starting the server on startup. So I needed to get rid of the windows service. Its a pretty straightforward task, achieved simply by the command

    sc delete <service_name>

    run in the command prompt with administrator right (right-click -> "Run as Administrator"). However its pretty much irreversible, which means you have to be sure that you will not want it anytime soon. I am managing my application server runtimes through eclipse anyway, so its not the desired way of things for me.

    The Glassfish server is usually stored under the name glassfish, so executing sc delete glassfish should do the task. However to be sure, you can open the list of services, and find the Glassfish service, and copy the value from "Service Name" (do not confuse with "Display Name").

  • Think Business
    Jan 19, 2012

    Its not a new discovery that priorities in commercial and scientific/academic software development are different. For example, if you need to delete an arbitrary record, but keep its data in the database, you just add "delete" attribute to the record, and set it to true when the record has been deleted. Straightforward, right?

    Not really - believe it or not, most likely a deleted or canceled record will want to have at least a "comment" and a "timestamp" section. Maybe also the username of the one, who deleted/canceled the record. It may not be in the specification, so many programmers are likely to apply YAGNI principle. However sooner or later the change request is likely to come in any more or less serious project, especially if it is an agile project, with no hard-written specification. The last time I had such an issue, we decided to go with "deleted flag" option, and the change request came in 2 weeks.

    So this was my small experience to expect changes. I guess that is where the industrial experience is about: being able to correctly predict the changes, and thinking about business value of a feature from the user perspective.


subscribe via RSS