Back to Ireland

We’ve just returned from our second trip to Ireland. Last year was great, but we felt that we missed so many things that we just had to return. The return trip was twice as long and just great! I can’t drive on the left, so my girlfriend drove me more than 3000 kilometers around the whole island.

This time, we’ve seen almost all the best attractions, ranging from scenery landscapes and castles to old cities. There were so many things to see and do, but I probably most enjoyed the Bogside history tours. Our guide Paul has been living in Derry his whole life and had seen the Troubles first hand. Sadly, his father was one of the people murdered in Bloody Sunday. He took us on a walk through Derry and explained the meanings of beautiful murals, pointed out where innocent protesters were shot and answered all our questions. Sad story but well worth hearing it told by Paul. A must do if you’re in Derry!

I’ve been in several museums, but Cobh Titanic Museum is a bit different. You get a ticket from a real passenger that boarded the Titanic. It displays the person’s name, class and other details. Then they take you on a tour and tell you lots of unknown facts. All the time you’re wondering – what happened to my passenger? Well, in the end, you can see for yourself. By typing in your passenger’s name, you see if this person was able to get out alive or not.

The nicest surprise was Smithwicks brewery in Kilkenny. I was not expecting such a nice guided tour and I did not think I’d fall for their beer. Their tour has a hologram of sorts, that explains how the brewery started. It’s first owner John Smithwick was not allowed to own a company, so he had to get help from an Englishman who officially owned the brewery. Several decades later the laws changed and his one of his descendants could finally officially own the brewery. I just hope I can get a hold of some Smithwicks Red here in Slovenia. Great stuff!

I skipped loads of other sights that we visited like Cork Gaol, Newgrange, Dublin Gaol and many many many others. You just have to go see for yourself!

 

Raspberry Pi backup – easy and efficient

Creating Raspberry Pi backups is extremely important, have you backed up your Raspberry Pi lately? No? Well, that are you waiting for! I admit, I have messed up my Raspbian system several times and had to start fresh. It was not a problem in the beginning because I was able to learn lots of new things. As time went on, my Pi had more and more features (security camera, web server, flight radar, Raspberry Pi Weather station, etc). It would take a really long time to set everything again. That’s why it’s really important to do regular backups.

Everyone recommends that you use Win32 disk manager. Don’t get me wrong, it is a great tool for making backups. Some time ago I had bought a new SD card, and tried to restore the image, created by Win32 disk manager. It did not work, because the SD cards were not exactly the same size, although both were marked as 32GB cards. I got a message “Not enough disk space”. The second disadvantage is the image size, which is exactly the same as the SD card.

paragon backup

The solution is: Paragon Backup and recovery free. The free version does exactly what is needed. With it you can create incremental versions of the SD card. The file size is greatly reduced, in my case from 32GB to 8GB! The best thing – this backup can be restored to any SD card. Once a month I power down my Pi and replace the SD card with an old backup. That way I get very little down time. Meanwhile, Paragon takes care of creating a new backup. The files for your Raspberry Pi backup are neatly arranged in a specified folder. After the original SD card is inserted into its place, I immediately restore the created backup to my second SD card.

Granted, the process has a few extra steps compared to Win32 disk manager. But the extra clicks are worth it, the process itself is so simple and straightforward that I’m not even going to write a detailed how-to with loads of screenshots. Install it and give it a go, you will never look back!

Visiting Ireland

I have just returned from Ireland after a nice 10 day long trip. We rented a car for 6 days and stayed the last few days in Dublin. The only thing I hated over there was the driving on the left. Luckily my girlfriend got used to driving on the other side of the road very quickly. She drove more than 1300 kilometres all over the upper half of the Ireland from Dublin, Dundalk, Belfast, Derry, Donegal, down to Sligo, Westport, Galway and Ennis before returning back to Dublin.

The most memorable sights were in Belfast and Derry, because of the political tension that is still present even today. To anyone visiting Belfast, I’d recommend booking a tour with the local Black Taxi Tours. They take tourist trough the Catholic and Protestant areas, showing the murals on the houses. The guide told us all the background stories about the men portrayed, about the life back then. He mentioned helicopters being airborne all the time, patrolling the city. After the peace treaty, the helicopters were put down and lots of people had trouble adjusting to life without their noise. The most surprising thing is the wall that is still being used today to separate two communities. As the guide said several times – the wall is used to keep the peace.

Another pleasant surprise was the Leap Castle (pronounced Lep Castle). It was featured on lots of ghost documentaries and is mentioned in the Lonely Planet book. Its current owner Sean Ryan accepted us to his own castle and told us several stories about it, while we sat at the fireplace. Because of its bloody history, there are certain spirits present at the castle. Almost every weekend spiritualists come to the castle with instruments, doing various experiments. Luckily we did not stumble upon any spirits, but I did feel a bit uneasy while walking on the dark stairway and standing at the top level named Bloody Chapel. To anyone interested – book a visit by calling Sean at +353 868 690 547. In the end he was kind enough to play us some Irish tunes on his fiddle.

The Moher cliffs are really a sight to behold. Especially if walking from the nearby city called Doolin. It’s a nice 8 kilometre trek to get there and you get to see so much more than by driving to the spot. To any fan of such sites, the Slieve league cliffs is also a must see. After climbing stone steps you get to see a magnificent view over the sea. Well worth the climb!

Disable LED lights on Raspberry Pi

Raspberry Pi provides two LED lights – a green and red one. If anything goes wrong you can identify most of the problems by their status – blinking, always turned on etc. My Pi is working perfectly, so I’ve decided to rid myself of these two bright lights. It might even lower the power consumption a little bit. Anyway, the process is really simple. Type in sudo crontab -e and start editing the cron. You need to paste in the following:

@reboot echo 0 >/sys/class/leds/led0/brightness
@reboot echo 0 >/sys/class/leds/led1/brightness

 

Save changes and reboot in order to try out the new additions. These two commands are run after the Pi boots up, after each restart. The names led0 and led1 are the green and red LED. They still blink during boot, but power off completely when the system is up and running.

Developer console scraping, part two

I wrote a post about scraping Google’s Developer Console a year ago. A site visitor told me about his problems with this solution so I decided to help him out with a different option – a simple python script. It requires less prerequesites to be installed – only mechanize (sudo easy_install mechanize or sudo pip install mechanize).

In case you did not notice, when you log in to the Developer console, you can click on the Reports option and then statistics. There you have to write the name of your application and you will be presenteed with the statistics in zip files. I’m only interested in number of downloads and how many people actually use my application. Right click on Latest monthy install report and copy its url, we will be needing it shortly. For example, in my case the url would look something similar to https://play.google.com/apps/publish/bulkreports/download?period=2015_07&report_type=STATS_INSTALLS&package=com.example.application&dev_acc=0358642832969076833.

As you can see from the url, it contains a time period. The zip file also contains several csv files, that display daily statistics. I’ve made a simple script that downloads current months statistics in a zip file, extracts it and outputs the very last entry. That way I get the number of downloads and how many people have my app installed on their device. The script is available over here.

Before running it, you will need to do a few things first though. As stated before, install mechanize first. Get a hold of your dev_acc – it should be in the url you copied before. Take a look at the line that starts with result=br.open (should be number 22). Replace my dev_acc id with yours. Also replace the example package name with your application package name. Definitively replace the email and password with an account that has access to the developer console. I’m using /home/peter/production/scrape/ folder to hold  the downloaded zip and csv files. Change that according to your needs.

Now you can give it a go! The script first opens the url to the zip file that contains all of the statistics for the current month. It cannot, because it’s not authorised – it then logs in to the Developer console. In a moment the zip file is saved to the path you want. The file that ends with overview.csv is opened, because it’s the only one that contains the neeeded statistics. With the help of tail and cut, the needed information is parsed out. Then you can do what you want with it.

Sardinia in May

I have just returned from a nice little vacation from Sardinia. The tourist season does not start until June, so the timing was great. There were almost no people, no crowds at sights and the parking meters were also not yet installed. It was pretty windy though for a few days, otherwise the weather was great.

We stayed for a week, travelling around the top half of the island, visiting major and less known sights. Thanks to my personal travel guide and her copy of Lonely planet book, we had no problems navigating and deciding on which places to see. In some aspects, Sardinia is similar to Slovenia. In an hour or two, you can go from a nice beach to a pretty high mountain or a canyon. Lots of options for different people – biking, hiking, swimming, kiting or laying about on beaches.

We stayed at several hotels/hostels. All of them were booked via booking.com, which is a really good site for finding places to stay. One of our hosts gave us a nice tip for saving money when booking places. The site booking.com takes around 15% provision, so the prices are a bit higher than usually. The site displays all possible contacts, so if you contact the providers directly you can avoid booking.com and save some money.

A few pictures are available on my Google+ album.

 

 

Cmder in TotalCommander

My co-worker recently stumbled upon Cmder. It’s a replacement for the default command prompt in Windows. Cmder itself is based on ConEmu, but has some extra features and is much better looking. One of the integrated tools is git, tail, grep, etc. It has other things as well, but this is one tools that I used most.

main

I have been trying to integrate it with TotalCommander in order to completely replace the default cmd. I was successful to a certain point. By following the next steps, you will add a button to TotalCommander. When pressed, it opens a new window of Cmder with the current path. Its okay, but I still need to figure out how to do the same by typing cmd in command line.

Download Cmder, extract it somewhere and put its path to the environmental variables. That way you can run Cmder from anywhere (make sure it works before continuing). In Cmder folder, find the map vendor and edit init.bat. Scroll down to the end and paste cd “%p%” > nul. This command tells cmder to cd to the directory saved in the %p% argument. All output is sent to nul.

On top of TotalCommander (below Start) right click and select Change. Click add and add %p to the parameters field. For command type in cmder. If you want, you can also add Cmder icon by clicking on >> next to icon field. Navigate to Cmder folder and click on exe file. That’s it, you are done. Test by clicking the newly created icon and see where it takes you.

Developer console scraping

Google Play has a nice Developer console, which displays various information ranging from download stats to crash reports. It provides a great insight how the app is used. I wanted to automate getting the most important information from the apps I have published. I’m mostly interested in download stats and ratings. Tried several tools and even tried to make a simple python script. Because the site uses lots of javascript, there was no luck in creating my own solution. After some googling, I did stumble upon Google Dev scraper. It has been running on my Raspberry Pi for almost 4 months and it is truly working great!

google_play_store_logo

It needs some prerequisites such as Ruby and RubyGems. After these two are installed, clone the latest version from github. Because I want to get these information on a daily basis I’m using a cronjob that runs a bash script. Upon completion it creates a php file that displays the results in a simple manner. To start using the scraper, you need to get your developer Id. Visit the console and copy the numers after “dev_acc=”. Afterwards you need to get the package name for the stats that you want to get. You need to limit the search for the stats, get the publish date and latest displayed date in the statistics displayed in the console. When you have all of this information, issue the following command googleplay_dev_scraper -u [email protected] -p yourPassword -a yourDeveloperID app.package.name 20130227 20140106 >results.zip (replace the last two numbers with the starting and ending date in the same format!).

If you replaced all the data with your own login information, package name and correct dates, you should end up with a zip file. It contains lots and lots of statistics in csv format. Now it’s all upon you to decide which information you need and automate it with a bash script.  In general, my script does the following. Everyday at noon the starting command is issued to get statistics in a zip file. This file is then unpacked and removed.  Then the app.package.name_overall_installs.csv is read for the latest download number and ratings. Afterwards you can simply email them or display them in your website. Truly an amazing tool!

Android device as a security camera

I have a really old android phone sitting in my drawer. Its high time my Galaxy Spica got a new job and so can your old device.

Start with the easy part. Install SSH Server on your device, its totally free. This app will help you remotely reboot your device, so you do not have to touch the device, after you set it up. Make sure you enable auto start of the app on boot. When creating a new server for SSH make sure you enable auto boot as well and memorize the connection port. On users tab, add a user with the password. Try to connect to the device with putty if on Windows. Type in the IP of the device (set a static IP), port and user name. Now you should be able to issue commands such as restart for restarting or restart -p for powering off. In order to do this, you have to be superuser, so type in su first.android security camera

 The important app for streaming video is IP Webcam, free again. Just like SSH server, make sure you enable the setting that runs this app on boot. You can play around with other settings to fit your needs (such as lowering FPS, which helps with your device not overheating). Otherwise this app is ready to go from the start. Check out the stream by visiting 192.168.X.XXX:8080 (IP of the device along with :8080). Click on Flash tabs so you can see the video and audio stream. Really nice! Now you need to read this stream and get email notifications when a change is detected.

Last part is a bit longer, because you need to find the right settings for your camera, so you do not get too many false notifications. Install a nice application named Motion with apt-get install motion. You need to modify a few things in the configuration file with nano /etc/motion/motion.conf. Change daemon off to daemon on, which will start motion on startup. Now search for netcam_url and add  http://192.168.X.XXX:8080/video. This setting tells motion where the video source is.  The last of the mandatory settings is on_picture_save, which sets the action that occurs after motion is detected.  Change it to something like on_picture_save echo ‘Webcam alert’ | mail -a %f -s “Webcam Alert” [email protected]  Save the file, move your hand in front of the phone and hope for the best. You should get an email that has a picture attached. These pictures are saved locally, you can change the path by altering the setting target_dir.

This should be all there is to it. You can now fine tune the settings – which parts of the screen can trigger the motion detection, how many changed pixels trigger motion detection, video recording and much much more. Have fun!

Galaxy Ace S5830 flashing

There are loads and loads of tutorials for flashing custom ROMs to S5830 Galaxy Ace smartphone. I know, because I’ve read several of them. But there are a few main reasons for this post that has content, which already exists on lots of pages. I’m always a little bit afraid of flashing zip files from unknown sources. I never know if the ROM will be any good. I’m always afraid of botching up the flashing project. Lots of files needed for flashing are no present on hosting sites. These three reasons convinced me to write a tutorial that will contain 100% working files, the 100% correct flashing process and a really good custom ROM. All the files will remain on my Dropbox as long as I have one. This whole process has been tested myself and I can guarantee that you will not brick your phone if you follow this tutorial step by step.

If you never connected your Ace to the PC, you need to install Samsung Kies. It’s needed because it has various drivers bundled in its package. I had to install Visual C++ fix because I was getting an error concerning an dll error. Download ClockWorkMod 5, latest official firmware and Odin. Optionally you can also download root updater and Myth ROM. You will read about those two later on. Place all of these files, except the Odin package, on your SD card but do not insert it just yet.

It’s useful if your phone is charged over 50% just in case before beginning. If you press power button, volume down and home you will enter downloading mode. Fire up Odin,select OPS and find your ops file. Tick the One package option and connect your phone. Take a look at the screenshot to see how it looks when the process is finished. Double check everything and press start. Your phone will be rebooted several times, but do not worry.tutorial

Congrats, you have the most recent official firmware for this phone. If you want reliability and stability, stop here. But if you want some extra space and other cool features, then install a custom ROM. I recommend Myth ROM mod. The rest of the steps are not hard to follow so do not be afraid to keep reading. Power off phone, press power and hold it with home button. When the screen appears, stop holding the power button but keep pressing home button. Welcome to stock recovery mode. First you will install ClockWork Mod 5 that will replace the current recovery that you see. Select apply update from sdcard. Select upd_1 which will give you root access. Repeat the process but this time choose  Clockworkmod package. Reboot and return to the new and improved recovery mode. Navigate to Advanced, Partition, select at least 1024 (if your SD card has such space) and 32 for swap space. Now you can install the ROM. Run it the same way you ran upd_1. You will be presented with a really nice installation process. Select such options as you see fit. Select reboot and wait for the system to boot. It will take a several minutes for first boot but it is worth the wait! That is all, enjoy your your Galaxy Ace on steroids.

Page 1 of 3 123