Archive | linux RSS for this section

Ubuntu 10.10 and grub menu

I just upgraded one my Ubuntu server from 10.04 to 10.10 (works flawlessly) and realized that I was prompted with the grub menu during a reboot. Since this is a cloud server and it being managed over SSH, I surely wanted that Grub automatically selects the latest kernel and does not wait for an input.

To be honest, I don’t know why this changed (well the only grief with the move from 10.04 to 10.10). Luckily, this is a easy task. All there is to do is to change a value in one of the grub conf files. Edit the file “/etc/grub.d/00_header” and search for “recordfail”. This should bring you to the line;

if [ \${recordfail} = 1 ]; then
  set timeout=-1
else
  set timeout=${GRUB_TIMEOUT}
fi

Now, all there is to change is the value “-1″. The value 0 will bypass the menu and any greater value is the time of countdown after a unsuccessful boot. (I changed it to 3).

After you saved the change you need to run “sudo update-grub2″ to apply the change. If all goes well, you should boot directly with the configured kernel during next reboot.

From iPhone to Android – Samsung Galaxy i9000

Ok, so I did it. I went from my truly lovely iPhone (3G) to a Android phone. My choice is the Samsung Galaxy i9000 (some call it GT-9000). So, how is the experience so far?

Actually, I can say nothing else then just good thing about it. The Android OS feels just like…. natural. You realize quickly, that Google has put in a lot of efforts into this system. Actually, they put in a lot of efforts in their latest products (Chrome, Picasa, etc.). In any case, I could get everything running in short time.

If you have a Google (or Google Apps) account then synching and setting up the phone is a breeze. All you have to do is to enter your eMail address and password and your phone pulls all the eMail, Calendar and Contacts from Google. Nothing else to do there. I actually had a funny thing with Contact synching. That is, that one contact wouldn’t sync at all and I also received a lot of “sync has a problem right now” with the Contacts. In the end I removed the contact in question and entered it again. But otherwise, everything runs fine.

You can feel that Android was build for working with Google Apps. eMails come in almost as instantly as on any desktop app. GTalk is integrated also and you get notification going all over the place. One thing that Android has definitely gotten right, are the notification in general. They don’t only work for some applications, but work for about everything. This is especially useful if you are on Twitter (who isn’t? btw: follow me at @thenitai) and someone mentions you or is sending you a message. This works with Seesmic or Hootsuite and any other app. Very nice.

Another thing is the geo location functionality. Google Maps with direction just blows aways about everything you have seen before. Did you ever try to use Directions on the iPhone? The last time in London, I ended up in a total different place. Anyhow, all I’m saying is that Android is really a good system and if they continue like this, they will give everyone a run for their money (yes, Apple I mean you).

Not being a “game” guy, I did not play one game on it yet, but can imagine that the Galaxy screen just screams for it :-) Talking about the screen. WOW. This Super Alomed screen is just marvelous. The phone itself is bigger then the iPhone (3g and 4G) but just a little. Since it is lighter then the iPhone 4G you actually don’t feel a difference at all. Actually, you won’t even notice a big difference between the iPhone and the Samsung, until you start working with it and realize that Android is not just a “Linux” and “Geek” system, but a grown up operating system for the phone. And a fun one as well. Turn on “Live Wallpaper” and you know what I mean…

At the end, I recommend the phone wholeheartedly to everyone who is thinking of switching from the iPhone.

Below are some tips for connecting to MacOS X and setting up the phone with Swisscom.

Mounting the phone in MacOS X

The good thing is that you can simply hook up the phone by USB to the Mac and it starts charging the battery. Of course, there is no iTunes synching or alike, but if you need that you can get “The Missing Sync for Android” application. I haven’t used it but heard good things about it, especially since you can use it over Wi-FI and Bluetooth.

But if you want to simply mount the phone and the HSDC card (if any) then you have to go trough some setting. There are somehow “hidden”, so here they are:

1. Go to “Settings”, then to “About Phone” and click on “USB settings”. Since the default is set to Samsung Kies it will never connect to a Mac. So choose either “mass storage” or “Ask on connection” (my choice).

2. After you have set the above you need enable USB debugging (strange but true or else you can’t connect to the Mac). Go to “Settings” again and choose “Applications”. Then click on “Development” and enable “USB debugging”.

Once you have done the above two steps you can connect your phone per USB to the Mac. The phone and if any SDHC card installed will show up as hard disk drives.

Setup GPRS and MMS for Swisscom network

If you, like me, have not bought the phone from Swisscom directly you have to setup the phone manually to be able to connect to any Internet service on 3G. Swisscom offers a “setup your device” website which will send you a SMS and will automatically configure the phone, but unfortunately the Samsung Galaxy can not be configured this way. Thus we have to do some hand work here.

Go to “Settings”, click on “Wireless and network” and then on “Mobile networks”. Within click on “Access Point Names”. You will probably see a black screen. Thus we will have to add a APN now. Click on the menu key and “New APN” (do it once for GPRS and one time for MMS). Then simply enter all the required paramaters according to the list below:

For GPRS:
Name: Swisscom GPRS
APN: gprs.swisscom.ch
Proxy:
Port:
User name: gprs
Password: gprs
Server:
MMSC:
MMS-Proxy:
MMS-Port:
MCC: 228
MNC: 01
Authentication type:
APN-Typ: Internet + MMS

For GPRS:
Name: Swisscom MMS
APN: event.swisscom.ch
Proxy:
Port:
User name:
Password:
Server:
MMSC: http://mms.natel.ch:8079
MMS-Proxy: 192.168.210.2
MMS-Port: 8080
MCC: 228
MNC: 01
Authentication type:
APN-Typ: MMS

That’s it. Now you should be able to see the “3G” sign in the upper menu bar and will be able to connect to Twitter et all on your mobile network.

Hope this helps anyone. If you have questions or want to know something just leave a comment.

On my way to Linux – Part One

Right, so here is the scope. I’ve been a MacOS X user for many years, not that I have been a fanatic one but I simply used what works best for me. In any case, I own 3 Mac Mini’s and mostly got a new MacBook Pro every year. I also converted quite a lot of people over the Mac. Recently, I’ve even got a iPhone (well, 1 1/2 years ago) after many years of using a BlackBerry. I have to say, the “Apple way” has worked very well for me.

That being said, I have always followed how Linux has been developing, especially on the desktop side (all of our servers run Linux). Actually, with Ubuntu 8, I seriously was thinking of using Linux on the desktop, but back then some application were missing. Later with Ubuntu 9, I took another try, but it still wasn’t ready for me. Now, with Ubuntu 10, the distro is not only very mature, but also, the applications I need are mostly up to date and work well for me.

So, today I set out to see if I will be able to replace my workplace which is based on MacOS X to Linux Ubuntu. My current setup is a MacBook Pro 15″ as my main machine hooked up to a 23″ Cinema screen. I was thinking to replace this setup with a desktop machine and have a netbook (the Asus EeePC 1201PN looks very sweat) as well. Since I still have a older MacMini lying around I set out to get Ubuntu 10 running on it.

Installing Ubuntu on a MacMini

Installing Ubuntu 10 on the MacMini was easy and surprisingly Ubuntu found every bit of hardware, it even found my Bluetooth Logitech Mouse within seconds.WIFI, Ethernet and external hard drives were also found without problems. For those wondering how to install Ubuntu on MacMini all you have to do is to partition your drives with BootCamp, insert the Ubuntu CD and then reboot the Mac (hold down the ALT key). Select the “Window” partition and it will start up from the Ubuntu CD and will start to install it.

So, how is it working with Ubuntu 10?

What can I say, except that the people over at Canonical (the company behind Ubuntu) has fulfilled the promise to bring the best Linux experience to the desktop. I have had no driver problems, could immediately connect to the WIFI network and installing new software even easier then on the Mac.

But we already knew that Ubuntu is good, right? So the real thing for me is to see if I can get my workspace going under Ubuntu. In short, this means that all my applications and workflow will be available and doable with Ubuntu. Thus the rest of this blog post and part two and maybe even part three will be about finding and using the equalivant of of the Linux app to the Mac ones.

I won’t go into the obvious applications that are the same on each operating system like browsers or file explorer systems. The good thing to know is that Firefox and Google Chrome and all their extensions work the same under any operating system. One thing I noted so far, is that Firefox does not seam to have the memory leak problems like the one on the Mac.

Eclipse

I’ve used Eclipse for a long time and recently switched to Coda on the Mac, since Eclipse just eat away all the RAM I had and even crashed many times a day. I’m happy to see that Eclipse under Linux is rock solid and I can use my favorite development environment again.

Mail / Calendar / Contacts / iCal / Address Book

This is a no brainer for me, since I have been using Google Apps for some time and thus my Mail and Calendar already resides in the cloud I can simply continue using my browser without any OS worries. I never used Mail.app (instead used the Browser or Mailplane) and used Spanning Sync for keeping iCal and my Address Book in sync with Google Apps. Since, I don’t like any Mail apps or Calendar under Linux I simply opted to use the browser for Mail, Calendar and Address Book (this will keep it in sync with the iPhone/Android).

Word / Excel / Powerpoint

Right, so much has been said, about using OpenOffice instead of iWork or Microsoft Office. In my testing I have to say that OpenOffice 3.x works fine, but maybe it is just me or does OpenOffice on Linux look like Word 98? Feels like flying back in time… I have to say, that I haven’t tested this part in depth and so I can’t really give any verdict on this.

I have some other apps I need to work with like Aperture, TextExpander, 1Password, etc. and will write on these on the second part.

I hope this helps anyone that is wanting to switch over to Ubuntu. I haven’t made up my mind, if I should switch full time to Ubuntu. At the current state, the MacOS X with its Unix root feels like the grown up Linux, just more polished and with all the apps in the right place.

Please let me know your thoughts in the comment section.

Getting SUN Java 6 JRE installed on Ubuntu 10

So far, installing SUN Java versions have always been a bit of a “pain” under Linux. Well, as I said, when you need SUN’s Java version that is. Most of the time you need to go to their intuitive (fun intended) download page and think very hard which version to download.

Ubuntu has made this step a bit easier. Actually, all there is to it, is the following:

1. Add the required partner repository

Under Ubuntu 10 you have to edit the file “/etc/apt/sources.list” and uncomment the partner entires (See screen shot below).

2. Update your repository

This is a simple one. Issue the command “apt-get update” and off you go.

3. Install Java

Now all there is for you to do is to install Java with “apt-get install sun-java6-jre”.

Now, anyone please tell me that Linux is hard to handle :-)

Nginx error with Tomcat – upstream sent too big header while reading response header from upstream

Nginx is our favorite web server currently as it is fast, lean and easy to configure. Performance is just outstanding and if you haven’t take a look at it.

One thing that I noticed while we deployed Nginx with Tomcat is that their default size for the buffers are very low. Don’t know why a 4K buffer size would be sufficient. If you keep it at their default size and might have a heavy duty Tomcat app then it could be that you will see error messages like:

upstream sent too big header while reading response header from upstream

The remedy for this error is to set the parameters for higher values for the proxy_buffer* parameters as we have done and now all is back to normal. Here are the current settings that worked well for us;

proxy_buffer_size   128k;
proxy_buffers   4 256k;
proxy_busy_buffers_size   256k;

SugarCRM: Inbound eMail

SugarCRM is a good open source CRM, but the overwhelming functions and navigation makes it “sometimes” hard to really get to the one thing you want to do. In any case, it does the job well. Apart from that, I just came upon this error message within SugarCRM:

Warnings: Inbound Email cannot function without the IMAP c-client libraries enabled/compiled with the PHP module. Please contact your administrator to resolve this issue.

This definitely means that PHP is missing some mail libraries, but the message to compile PHP is kinda scary, isn’t it? Luckily, if you are using Ubuntu all you need to do is to issue an “apt-get” command and you are rolling. So here we go:

apt-get install php5-imap

This will install everything for you, make sure to restart PHP (restart Apache or the FastCGI).

Nginx, Apache, SSL and signed by an unknown certifying authority

We just moved a whole bunch of servers to a new hosting center and moved from CentOS to Ubuntu (server) and Apache to Nginx (more on this in a later blog post).

While we migrated mostly everything without problems we were confronted with the problem that our SSL certificate gave us an error message of the form:

“The certificate for this website was signed by an unknown certifying authority”

This was rather strange because the same certificate worked with Apache just fine. After some time and searching for a solution we found that we had to tell Nginx to use the SSL Chain file as well. The only problem is that Nginx does not have a explicit parameter like Apache has. In Apache the SSL config looks like this (we use a GoDaddy certificate):

SSLEngine On
SSLCertificateFile /etc/httpd/ssl/youcert.crt
SSLCertificateKeyFile /etc/httpd/ssl/yourkey.key
SSLCertificateChainFile /etc/httpd/ssl/gd_bundle.crt

Now, in order to get this working in Nginx you need to append the “gd_bundle.crt” to your crt file, which is quite simple with the following commands (do a backup of any files before doing this!):
cat gd_bundle.crt >> yourcert.crt

Then simply restart Ngnix and all is back to normal (but just really faster with Nginx then with anything else:-) ).

Syntactically invalid HELO argument(s)

Just been going trough a lot of reconfiguration lately and today finished configuring a new server. While testing the mail function we saw in the mail logs the following lines:

javax.mail.MessagingException - 501 Syntactically invalid HELO argument(s)

First we thought, it is the application server or sendmail/exim not being properly configured. But as we soon found out, one simply needs to have a valid hostname set for the server. In other words, this error is commonly caused by the hostname of the machine being wrong compared to what the mailserver expects. Java mail does a getHostName and uses that in the HELO.

And just in case you simply set your hostname with “hostname domain” it will not persist on the next reboot. In order to keep your new hostname you will need to change it in the hostname file itself, as in:

sudo  vi /etc/hostname

Do a reboot and all should be good.

Get the latest libraries for CentOS

CentOS, being a “legal copy” of RedHat, as good as it is, comes with some really outdated libraries. This has caused many, including myself, to find way how to bring latest code releases into CentOS. Be it by alternatives repros or compiling the packages.

Now, I don’t know how I could overlook it, but I just found out that the CentOS team offers a CentOS-Testing repro. Once installed you will get the latest library updates as well. Since it is based and supported by the CentOS guys, I figure it is the safest way to get the latest updates.

Simply add the following at /etc/yum.repos.d/centos-test.repo:

[c5-testing]
name=CentOS-5 Testing
baseurl=http://dev.centos.org/centos/5/testing/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing

Save it and do a yum check-update and you will get all the good yummies. Make sure that you don’t install something carelessly on a production server, right…

Solutions for Oracle ORA-28002 and ORA-27101

Running an Oracle database is great, because it is stable and just runs, but sometimes you are hit with unexpected errors when you restart your machine. Thought, I know Oracle quite well, I’m always surprised at some things. Here are two errors (and solution) I was just confronted with:

ORA-27101: shared memory realm does not exist

To be honest, I don’t know why I was confronted with this error, since we haven’t changed anything to the machine or to the environment variables. Metalink suggest to check that the ORACLE_HOME and ORACLE_SID are correct. Funny thing is that this system runs for over a year without a change to the path, nevertheless I checked the ORACLE_HOME path and sure enough I had trailing slash at the end.

So, the solution was to see that ORACLE_HOME does NOT have a trailing slash.

echo $ORACLE_HOME
/opt/oracle/product/11/ <--- WRONG!

echo $ORACLE_HOME
/opt/oracle/product/11 <--- CORRECT!

Remember to log out of your current shell session in order to reapply the new settings.

ORA-28002: the password has expired

Now, this error caught be even worse, because it happened right within a production environment. Also, here I was unaware of this setting. In any case, Oracle seams to want you to reset your password after one year or so. In case, you want to disable this on a user without changing the users password you need to issue the following commands in sqlplus:

alter profile {user} limit password_verify_function null;

This will set the verification for this user to null. If you want to do this for every user in your system you would use this (this is applied to the DEFAULT profile):

alter profile DEFAULT limit password_verify_function null;

Once done you can then reset the password for the user with the same password or with another one with:

alter user {user} identified by {password};

Exit sqlplus and your changes should have been applied.