Tag Archives: Ubuntu

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, hence the name. (It probably works on servers as well.)

moserial

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. Before I found out about this program, I normally open up Arduinio IDE and connect to the Arduino via Serial Monitor function. Now, I never look back after using moserial.

moserial should be available on most Linux distributions, and on Ubuntu based distros, it can be installed as easy as:

$ sudo apt-get install moserial

Puppet agent hangs after loading facts

At my current work place, we use Puppet to manage desktop machines. Recently, I need to prepare an new image based on Ubuntu 14.04 LTS.

To prepare an image, in brief, first thing is to install a fresh Ubuntu on a machine, compile and package lots of applications, and make change to configuration such as look and feels, etc. As mentioned earlier, I use Puppet to manage machine, so I store all customed configuration on the Puppet server.

While working on this image, I came across a problem with Puppet agent, the software running on each desktop. The issue is that it took very long to execute the code. Here is an example:

matht336:~# puppet agent -vt -l console
Info: Loading facts in /var/lib/puppet/lib/facter/sku.rb
Info: Loading facts in /var/lib/puppet/lib/facter/users.rb
Info: Loading facts in /var/lib/puppet/lib/facter/zid.rb
Info: Loading facts in /var/lib/puppet/lib/facter/videocard.rb
Info: Caching catalog for matht336
Info: Applying configuration version '1398116230'
Notice: Finished catalog run in 1.09 seconds

According to the above output, it only took 1.09 seconds to run the catalog. Well the truth is it took way longer than that, approximately about 20 minutes. I re-ran puppet agent with -d flag for debug, but none of the output information gave me any clues of what could possibily go wrong.

One clue that I’ve been missing and should have noticed much earlier is that puppet agent got stuck after loading the facts.

So I modified /etc/puppet/puppet.conf on the node (not the server), to not receiving custom facts from the server:

[main]
...
pluginsync=false

Then, I removed the custom facts one by one from /var/lib/puppet/facter and re-run puppet agent on the node. Suprisingly, zid.rb was the source of the puppet agent slowness. zid.rb is a fact written by my colleague to keep track of who last logged in to a machine.

I’ve been wondering why noone on the Internet has the same issue as me. At first I thought maybe Ubuntu 14.04 is too and not many people have been running puppet on it. Now I know, it the problem is unique to my environment.

So if you experience the same problem as me, I would suggest that the first thing to check out is openning up thos custom facts and see what they’re doing.

E: Internal Error, No file name for libapt-pkg4.12

When I tried to update an Ubuntu (12.04) machine with the usual apt-get command, this error message came up:

Do you want to continue [Y/n]? Y
E: Internal Error, No file name for libapt-pkg4.12

Reading this post (http://ubuntuforums.org/showthread.php?t=2045321), one way to fix it is to download liapt-pkg4.12 and re-install it:

# apt-get download libapt-pkg4.12/precise-security
# dpkg -i libapt-pkg4.12_0.8.16~exp12ubuntu10.10_amd64.deb

This seems did the trick.

បញ្ចូល C/C++ plugin (or CDT) ក្នុង Eclipse

សំណាង​ល្អ អ៊ូប៊ុនធូ មាន​កញ្ចប់មួយ​ឈ្មោះ eclipse-cdt​ ។

យើង​អាច​បញ្ចូល​វា​ដោយ ខំម៉ានដូច​នេះ

sudo apt-get install eclipse-cdt

ពេល​បើក​ Eclipse លើកក្រោយ​ ហើយ​បង្កើត project ថ្មី យើងនឹងឃើញ​ស្រដៀងនេះ

Fix: (K)ubuntu doesn’t play Audio CD

On Kubuntu 11.10, we have KsCD program installed to play audio CD. The problem I’m having is that some machines could play audio cd and some couldn’t. All machines run Kubuntu 11.10.

To fix this issue, check that /dev/cdrom is a sym link to /dev/sr0 (credit: http://www.kubuntuforums.net/archive/index.php/t-57655.html).

In my case, machines which couldn’t play audio CD don’t have ‘/dev/cdrom’:

# ls -l /dev/cd*
ls: cannot access /dev/cd*: No such file or directory

Let’s create one:

# ln -s /dev/sr0 /dev/cdrom
# ls -l /dev/cd*
lrwxrwxrwx 1 root root 8 2012-07-11 11:38 /dev/cdrom -> /dev/sr0

After this, I can play audio CD.