Python: How to convert a list to a string

There must already exist a gazillion articles about how to do this; but one more won’t hurt, right? Suppose you have a list, called alist, as the following: In [2]: alist Out[2]: ['apple', 'banana', 'pear'] To create a string from “alist” with a comma separator, we can do this: In [3]: ','.join(alist) Out[3]: 'apple,banana,pear' Basically, you can place a desired separator in the ',' or omit it totally. Reference: http://www.decalage.info/en/python/print_list

August 2, 2014 · 1 min · 70 words · kenno

Set Timezone in Fedora 20

While looking at the log file on my Raspberry Pi (running Fedora 20 Remix), I noticed that the date/time didn’t look right. EDT is a North American Eastern Daylight Time, which is 4 hours behind UTC. You can read more about it here. In my case, I prefer the time zone set to AEST (Australian Eastern Standard Time), which is 10 hour ahead of UTC. Here’s how it can be done....

July 21, 2014 · 1 min · 93 words · kenno

systemd - start, status, enable example

This is just a quick note to remind myself how to enable or disable services using Systemd. In this example, I’m using denyhosts service. Check if a service is running. # systemctl status denyhosts denyhosts.service - SSH log watcher Loaded: loaded (/usr/lib/systemd/system/denyhosts.service; disabled) Active: inactive (dead) Start a service and verify its running status: # systemctl start denyhosts # systemctl status denyhosts denyhosts.service - SSH log watcher Loaded: loaded (/usr/lib/systemd/system/denyhosts.service; disabled) Active: active (running) since Thu 2014-07-17 01:44:29 EDT; 1min 25s ago Process: 15722 ExecStart=/usr/bin/denyhosts....

July 17, 2014 · 1 min · 162 words · kenno

Managing LVM

LVM stands for Logical Volume Manager. It is a tool for logical volume management allowing us to allocate disks, strip, mirror and resize logical volumes. With LVM, we can manage partitions dynamically. Recently at work, we opted to use LVM to create logical partitions instead of physical partition on Linux desktop. This post is just a note to remind me of some common used commands. If you want to learn more about LVM, hit this link instead....

July 4, 2014 · 2 min · 394 words · kenno

Eclipse ADT Fatal Error on Linux

The Eclipse IDE that comes bundle with Android Development Tools (ADT) crashes when run on my laptop running Fedora. The error message which logged to console is: Fortunately, there’s a way to fix this problem by opening ‘eclipse.ini’ file, in my case: and added this line to the end of that file: Credit: Android – Solución Fatal Error del IDE Eclipse (ADT)

July 2, 2014 · 1 min · 62 words · kenno

Running Kompare from command line

Recently I started to use Kompare a lot to compare the differences between two files. The way I compare two files is to open both files from the menu (File -> Compare Files). This is annoying and how I wish there were a way to just run Kompare from the command line passing 2 files as options. Well, it looks like my wish has been granted. I found the information here on how to do just that:...

June 11, 2014 · 1 min · 79 words · kenno

New P&E OpenSDA Firmware v115 for K20D50M

Having trouble uploading compiled code to K20D50M board? There’s a new firmware that (should) fix this. A few weeks ago, I’ve updated the OpenSDA firmware on my Freescale FRDM-K20D50M to v114 only to find out that it no longer let me uploading any compiled files to the board. At first I thought my board was faulty, but felt relieved to hear that Erich Styger, an mbed expert, confirming this v114 firwmare also affected his K20D50M....

June 3, 2014 · 1 min · 139 words · kenno

MongoDB warning: Failed to connect

After upgrading MongoDB from version 2.4 to 2.6, I am not able to connect to it from another machine. The firewall has been checked to ensure that port 27017 is opened for the machine that I want to connect from. So what else could go wrong? Well, I was impatient and turned to you know what… Google search. According to this link: https://groups.google.com/forum/#!msg/mongodb-user/yhf05AW-hK8/YqES0cVIXlUJ, the problem is due to the database is bound to only local IP....

May 22, 2014 · 1 min · 130 words · kenno

FreeBSD 10: Shared object 'libstdc++.so.6' not found

Today while I was updating py27-m2crypto package on FreeBSD 10 using portmaster, the following error message was displayed: Shared object "libstdc++.so.6" not found, required by "swig" Fortunately, someone else has found the problem and solution before me. According this blog post, FreeBSD 10 includes a new C++ stack and gcc, including libstdc++, is not installed by default. Therefore, to fix the missing this libstdc++.so.6 issue, we need to install lang/gcc....

April 25, 2014 · 1 min · 85 words · kenno

moserial - a serial terminal for Linux

The real tag line for moserial is “a serial terminal for the GNOME desktop”. However, since it’s installed just fine on my KDE desktop, I titled this post as “moserial - a serial terminal for Linux”. (Well, it probably works on servers as well, not just desktop.) So what is this moserial? It’s a terminal which allows you to connect to view or send data to a serial port. For example, a lot of mbed device or micro controllers, such as Arduino, can be configured to send/receive data via serial port....

April 22, 2014 · 1 min · 146 words · kenno