Category: Snippets

  • Uninstall Python Package from OS X

    I have been using Python 3 on my OS X provided by the installation package from Python.org for some time, and recently I have decided to switch to Python installation from Homebrew for easier management. In order to uninstall the Python from package, you must remove the files and symbolic links to them. WARNING: This…

  • Creating an Instance of an Object without Calling Its Constructor in PHP

    Today, I stumbled upon an article in a local PHP developers group. It was about creating an instance of an object without calling its constructor (as mentioned in post title). At first, the idea made no sense to me. Because, constructor method is run every time an object is instantiated, this property is the whole…

  • Graphical Visualization of databases with PostgreSQL Autodoc

    When it comes to software, database systems are beneficial in many ways. They offer us to keep our data organized and a fast way to access them. However as the number of components in a software project increases, it gets harder to preserve the organized structure. In situations like this, visualizing the scheme helps to…

  • Sharing Screen Sessions

    Recently, I learned a new feature of screen, it is referred as “multi display mode” in the manual. You can attach to a screen session that is not detached and the session is simply shared. In this mode, anything you typed are transferred simultaneously to the other display(s) as well. My mentor from my Google…

  • Quick Guide to D-Bus with Python

    Recent weeks, I dealt with D-Bus for my Google Summer of Code project. I was trying to control system services, and systemd has a D-Bus interface. In the beginning, D-Bus seemed a little confusing for me, but I believe I understand it now. In this post I will try to explain it in simple terms…

  • Install LESS on Ubuntu with npm

    LESS is available on Ubuntu repositories as “node-less” package. However, as of writing this post, it is an old version (1.3.1) which contains lots of bugs, while a newer and more stable one (1.3.3) is available. And you can install latest LESS version with npm: Because the command name of the node.js is nodejs (instead…

  • VirtualBox, Shared Folders and Cache

    I have recently set up a virtual server environment using VirtualBox for quick web development. Using shared folders feature, I wanted to avoid file uploads between VM host and guest. However, when I make request to an updated a file, server responses with the old version. First, I cleared and disabled my browser cache. The…

  • Google Play Port Number for Android Devices

    An Android device contacts Google Play servers for several reasons, such as checking internet connectivity, push notifications and application installations triggered from web. These services will fail to operate if the Google Play ports are blocked in your network (mobile data, wireless, vpn). If you are using a firewall and would like to allow (or…

  • HTML5 Video Loop Support for Firefox

    You created a fancy HTML5 page with video element but guess what, Firefox 4 does not support video loop. I found a workaround for this problem with javascript.

  • Storing MAC address in a MySQL database

    Today, I encountered a problem: storing MAC address in a MySQL database. MAC addresses (something like “01:23:45:67:78:AB”) contain six hexadecimal (base 16) values. This means each hexadecimal field can store 256 (2 to the power of 8, in base 10) values. It’s 8 bits (= 1 byte) for each value. 6 field x 8 bit…