Tag Archives: ubuntu

Link

[puppet forge] proletaryo-supervisor v0.4.0 now supports Ubuntu

Necessity is the great motivator.

I wrote this puppet module almost a year ago. The first version up to the last one only supports RedHat-based distros. Amazon Web Services is the primary platform that I use so the module is heavily tested and used in AWS Linux environments.

I was planning to support Ubuntu since day one but I managed to procrastinate because it’s not really needed in our deployments. That changed today though because we’re rolling out a few Ubuntu instances in AWS 🙂

I hope some people will find this module useful. It’s always open for contributions. Just fork it in GitHub:

https://github.com/proletaryo/puppet-supervisor

If you have an existing Puppet installation, just install it in your Puppet Server:

puppet module install proletaryo-supervisor –version 0.4.0

Send / Receive SMS messages using Wammu and a Huawei e160 dongle in Ubuntu 10.04

The same case as most hardware vendors, Huawei’s support for Linux is disappointing. It doesn’t have an out-of-the-box application that you can use right away for Linux if you want to send/receive SMS through your dongle. For Windows? yes. For Mac? yes. Linux? just a plain simple NO.

I’m having these frustrations because I’ve been using a prepaid Globe Tattoo for the past few weeks. I use Ubuntu as my main OS and I only switch to Windows if (and only IF) there’s a task that I can’t accomplish on Ubuntu.

If you’re familiar with Globe Tattoo’s SUPERSURF service, then you know that you can only subscribe to it by sending an SMS message (e.g. SUPERSURF50 to 8888).  Switching to Windows just to activate SUPERSURF then switching back to Ubuntu to really connect to the internet became an annoyance after doing it for a few times. Besides, Globe Tattoo has currently a bandwidth cap and you’ll only be notified that you’ve reached it through an SMS!

There has to be a better way and most of the time, the Linux community provides it. After a little Google search, I saw this site and it lead me to Wammu.

Now, Wammu isn’t perfect. If you’re expecting an application that will notify you right away if your dongle received an SMS, Wammu’s not it. But, it can send and receive SMS, you just have to be patient with it 🙂

To install it, just run this in your terminal:

$ sudo apt-get install wammu

Or, search for Wammu in Ubuntu Software Center (Applications -> Ubuntu Software Center)

Once you’ve done installing it, plug in your dongle and run Wammu. You can find it in: Applications -> Accessories -> Wammu

main application window

To let Wammu detect your dongle, run the phone wizard and just follow the on-screen instructions, click on: Wammu -> Phone Wizard

my setting for my Huawei e160 dongle after running the phone wizard

To connect to your dongle, click on: Phone -> Connect

waiting screen

Once you’re connected, you can retrieve the SMS messages in your dongle by clicking: Retrieve -> Messages

my messages a few days back, don’t be surprised by the date in the bottom 🙂

Note: As far as I know, Wammu won’t retrieve new messages automatically. In my case, I have to check for messages manually, the shortcut Alt + R, M comes in handy.

To send an SMS, click on: Create -> Message or Ctrl + M

make sure you’ve checked the “Send message” checkbox before clicking OK

And this is how I send / receive SMS in Ubuntu using Wammu. It’s not perfect, but it works 🙂

Gmail with Offline enabled with Firefox 3.6.12 in Ubuntu 10.04

A couple of months ago, I switched from Firefox to Google Chrome because the fox is eating a lot of memory. And to free that up, I have to quit Firefox with all the opened tabs (unlike in Chrome) and just run it again, which is pretty annoying if you have a lot of tabs opened.

So, I decided to switch to Google Chrome. Then, I found out that Google Chrome for Linux doesn’t support Gmail’s Offline feature, one feature that I really find quite handy. Still, I stayed with Chrome, hoping for the best that eventually, Offline will be supported in the next releases. Ironic that Gmail Offline is not supported in Google Chrome…

After months of hoping and waiting… still no Gmail Offline support. *sigh*

I decided to switch back to Firefox. The last time I installed Google Gears, it’s not supported yet in 64-bit, that’s why I looked for ways on how to do it.  I was using Ubuntu 9.04 back then. Since I already upgraded to Ubuntu 10.04, I figured that I’ll just have to retrace the steps that I did back then.

Apparently, I don’t have to. Google Gears installs fine in 64-bit nowadays 🙂

How-To: Enable bluetooth internet using Ubuntu Karmic 9.10 + Sony Ericsson K770i

Long before USB 3G modems and mobile broadband became ubiquitous, most phones can already be used as modems a few years back. It can either be by USB cable or Bluetooth. A good friend of mine even created a detailed guide on how to enable Bluetooth internet three years ago. It’s a series of steps, has a lot of manual tasks, but it’s the only option during that time.

Using a phone to connect to the internet via Bluetooth may not be practical in a sense, but the holiday season is here, a long vacation awaits for me, so I have to keep this option open. Besides, I’ll be out of the metro, so my Sun Broadband Wireless is quite useless.

So, I was revisiting the steps in how to enable Bluetooth internet in Karmic and it turned out to be a breeze… (proves the point things are improving in the Linux community)

Here’s how I did it in Ubuntu Karmic 9.10, using a Sony Ericsson K770i phone:

Note: Before anything else, I enabled Bluetooth in my K770i and made sure that it’s visible.

1. I made sure first that Bluetooth is enabled in my laptop (of course!).

2. I clicked on the Bluetooth icon, then clicked on Set up new device… It gave me this window, Bluetooth New Device Setup


3. I clicked on Forward, then, it searched for Bluetooth devices…


4. I selected my phone, jhayem-k770i, then clicked on Forward, then it gave me the PIN window.


5. The k770i detected that a device wants to pair, it asked for the PIN and I entered the PIN provided above. The phone inquired if I want to enable the following:
    – add to pro-ubuntu-0 to my Devices? – Yes
    – allow pro-ubuntu-0 to use the phone as modem? Yes, Allow always
    – allow pro-ubuntu-0 to use your phone as remote control? – Yes
    – start remote control now? – No

6. After all those inquiries, the Bluetooth New Device Setup has this last window

7. I checked Access the Internet using your mobile phone, then clicked on Close

That ends the set-up part, now, how to connect?

Once your done with the set up, If you click on the Network Manager icon, you now should have a PANU in your list of networks…

Just click on that to connect to the internet via Bluetooth through your phone :p

How-To: Install printer driver for Brother DCP-150c in Ubuntu 9.10

OK, I have a confession to make, I keep on using Windows just to print my documents… I know, I know…

Against my will, I woke up early today (5:30am). To make use of the time, I started downloading a series of TED talks videos (if you have the time, I suggest you watch TED videos, you’ll learn a lot, at the same time it can give you some tips in how to present your idea well). While I’m in the middle of my second download, I remembered that I have to print some documents. I don’t want to disrupt my downloads so I decided to install my printer, a Brother DCP-150c, in Ubuntu 9.10

A little googling led me to Ubuntu’s wiki about Brother printers, here.

Note: don’t connect your printer just yet.

According to the guide, the DCP-150c belongs to the bh7 group. That’s pretty straightforward and quite easy to install, hmmm… (I was quite skeptic about this, looks easy)

I ran this command to install the said package:

    sudo apt-get install brother-cups-wrapper-bh7

Once that’s done, I plugged-in the printer. Ubuntu detected the new printer then the Printer configuration application popped up, then it gave me a list of drivers.

Brother is already selected so I just clicked on Forward.

Then, it gave me a list of specific printers. There’s no Brother DCP-150c in the list, the closest one is DCP-130c. I clicked on that because it says [recommended], then I clicked on Forward.

The next window asked me for some additional information, it’s filled up already, so I just clicked on OK. Once that’s done, it asked me if I want to print a test page, I clicked on Yes.

I crossed my finges… then I heard that familiar noise, the printer is cleaning it’s head, then it started printing, haha!

It worked!

How-To: Sync folders, local to remote (and vice versa), using Ubuntu 9.10 + Samba + Conduit

I have, temporarily, two workstations at work, a laptop and a desktop. Since I’m not sure yet if what to do with the desktop one, I’m temporarily using both. The problem with that is my files are scattered on these two stations as I continually use it both – the reason why I have to find a way to sync my files somehow…

This is the plan that I came up with:

in the laptop

  • create a shared folder with authentication

in the desktop

  • mount the shared folder (this should be easy to do, no mounting using mount command)
  • run an app that automatically syncs the folders

Both stations are running Ubuntu 9.10, by the way.

Creating the shared folder using Samba

I use Samba in sharing files and I know it supports authentication. Just run this command to install Samba,

sudo apt-get install samba

I did a little googling to enable authentication and it led me to this site. It’s a pretty straight forward tutorial. Just execute how-to-add-a-user step and how-to-enable-the-share-step.

Following the tutorial, I registered my user name in Samba using smbpasswd and I added these lines in laptop’s /etc/samba/smb.conf

    [pros-home]
path = /home/pro
read only = no
force user = pro

I restarted the samba daemon after that:

    pro@ops-laptop:~$ sudo /etc/init.d/samba restart
* Stopping Samba daemons                                             [ OK ]
* Starting Samba daemons                                             [ OK ]


Mounting the share

To verify that the laptop’s shared folder is really shared, I ran nautilus in the desktop and pointed it to laptop’s samba share:

Double-clicking on the shared folder will open an authentication window, I supplied the user name and password and selected the “Remember forever” option. In this way, I don’t have to type the credentials again every time I mount the shared folder.

Note: If you want to look up the user name/password that you’ve saved, go to Applications -> Accessories -> Passwords and Encryption Keys

To mount the shared folder easily and give other applications access to it, I added this line to the desktop’s /etc/fstab

    # my home in ops-laptop
//192.168.0.153/pros-home   /media/remote_home  cifs    credentials=/home/pro/configs/smb_credential,user,noauto,gid=pro,uid=pro  0   0

UPDATE: You need to have the smbfs package installed to mount SMB/CIFS shares, you can install it by running this command, (thanks to MRivera for bringing this up),

sudo apt-get install smbfs

I created a credentials file that contains the user name and password.

    pro@pro-desktop:~$ cat /home/pro/configs/smb_credential
username=pro
password=************
domain=WORKGROUP

I set the permissions also in such a way that it’s not readable by other logged-in users.

    pro@pro-desktop:~$ ls -lh /home/pro/configs/smb_credential
-rw——- 1 pro pro 45 2009-10-30 20:22 /home/pro/configs/smb_credential

I also made sure that the mount point does exists and it’s owned by me.

    pro@pro-desktop:~$ ls -lh /media/ | grep remote
drwxr-xr-x 42 pro  pro     0 2009-11-04 15:05 remote_home

Once the /etc/fstab is configured properly, I can now mount/unmount the shared folder using nautilus. All I have to do now is just click on remote_home to mount it, then click the “eject” icon to unmont it =)

Sync folders using Conduit

Conduit is fairly new application, it’s still in development stage. One thing that I like about it is it’s easy to use. I won’t discuss how exactly I configured it here, you can read the manual online. The example is pretty straight forward.

It’s included in Ubuntu 9.10’s repository, to install it just run:

sudo apt-get install conduit

Here’s a screenshot of my setup in conduit.

For instance, I want to sync my Tomboy notes so I keep these two folders in-sync:
    /home/pro/.tomboy <—> /media/remote_home/.tomboy/

So, that’s it. This the set-up that I’m using right now. So far, things are going well =)

MySQL: Ubuntu Server 9.04, moving the data directory to a different location

I recently deployed a “custom” server, will be used primarily as a MySQL server, using software RAID 5 for storage reliability.

I’ll try to explain in the future how I deployed the software RAID…

Anyway, my RAID partition is mounted in /data, I’m planning to store all MySQL files in sub-directory inside it, /data/mysql/

After changing the relevant MySQL variables in /etc/mysql/my.cnf,

[mysqld]
port            = 3306
datadir         = /data/mysql
socket          = /var/run/mysqld/mysqld.sock
<<< … truncated data … >>>
innodb_data_home_dir = /data/mysql/
innodb_data_file_path = ibdata1:500M;ibdata2:10M:autoextend
innodb_log_group_home_dir = /data/mysql/
innodb_log_arch_dir = /data/mysql/
innodb_buffer_pool_size = 4000M

I attempted to start MySQL but all I have is this,

root@****:~# /etc/init.d/mysql start
 * Starting MySQL database server mysqld
   …fail!


I am more familiar with RHEL/CentOS, been using it in our servers for years now, so the first thing that comes to mind is SELinux. This is the first time that I’m going to deploy an Ubuntu Server, in short, I’m a newbie.

Note: Realization came later that Ubuntu’s server deployment doesn’t use SELinux, it’s using a counterpart called AppArmor.

Looking at /var/log/messages, I got these messages,

May 10 13:52:38 ****server kernel: [ 9495.640883] type=1503 audit(1241934758.732:11): operation=”inode_create” requested_mask=”a::” denied_mask=”a::” fsuid=0 name=”/data/mysql/****server.lower-test” pid=18791 profile=”/usr/sbin/mysqld”
May 10 13:52:38 ****server kernel: [ 9495.640944] type=1503 audit(1241934758.732:12): operation=”inode_create” requested_mask=”a::” denied_mask=”a::” fsuid=0 name=”/data/mysql/****server.lower-test” pid=18791 profile=”/usr/sbin/mysqld”

These messages are not from SELinux at all, something is preventing /usr/sbin/mysqld from writing in /data/mysql/

A little googling led me to this blog [neodon.blogspot.com] and this blog [brainwreckedtech.wordpress.com].

One of the entries there said that I have to edit AppArmor’s MySQL policy (aha!, so it’s AppArmor!)

root@****:~# vi /etc/apparmor.d/usr.sbin.mysqld

Inside it, I added /data/mysql/, the blue one (don’t ask me what the line means, I don’t have the exact idea, I only assumed it has something to do with read/write permissions).

/usr/sbin/mysqld {
  #include

  #include

  #include

  #include

  #include

  <<< … truncated data … >>>

  /var/log/mysql.err rw,
  /var/lib/mysql/ r,
  /var/lib/mysql/** rwk,
  /data/mysql/** rwk,
  /var/log/mysql/ r,
  /var/log/mysql/* rw,
  /var/run/mysqld/mysqld.pid w,
  /var/run/mysqld/mysqld.sock w,
}

Then restarted AppArmor,

root@****:~# /etc/init.d/apparmor reload
 * Reloading AppArmor profiles …
   …done.


and now it’s working!

root@****:~# /etc/init.d/mysql start
 * Starting MySQL database server mysqld
   …done.