January 5th, 2011
I’m going to document how I did this so that I don’t have to look this up again in the future. I’m sure there is a better way to compile things once as both 32 and 64 bit, but this worked for me and was easy enough. The issue I had was that gpg requires 32-bit version of libgpg-error and libgcrypt, however I was doing some work with otr-python and since python is 64-bit I wanted to have libotr be 64-bit and thus the conflict with 32-bit libgpg-error and libgcrypt. What I did was essentially download the libgpg-error and libgcrypt source and then the following:
- For libgpg-error do a normal ./configure ; make ; sudo make install
- For libgcrypt do a normal ./configure ; make ; sudo make install
This should have built and installed the 64-bit versions of libgpg-error and libgcrypt. Now I’m going to rebuild them for 32-bit only using:
- For libgpg-error do LDFLAGS=”-arch i386 -m32″ CFLAGS=”-arch i386 -m32″ ./configure –host=i386-apple-darwin10.5.0 ; make
- For libgcrypt do LDFLAGS=”-arch i386 -m32″ CFLAGS=”-arch i386 -m32″ ./configure –host=i386-apple-darwin10.5.0 ; make
NOTE: Do not do a sudo make install
Now you need to combine the 64-bit and 32-bit libraries into one. Macs come with the tool you need called lipo. For libgpg-error do the following from the libgpg-error source directory:
# lipo -create src/.libs/libgpg-error.0.dylib /usr/local/lib/libgpg-error.0.dylib -output /tmp/libgpg-error.0.dylib
# sudo mv /tmp/libgpg-error.0.dylib /usr/local/lib/libgpg-error.0.dylib
And from the libgcrypt source directory:
# lipo -create src/.libs/libgcrypt.11.6.0.dylib /usr/local/lib/libgcrypt.11.6.0.dylib -output /tmp/libgcrypt.11.6.0.dylib
# sudo mv /tmp/libgcrypt-11.6.0.dylib /usr/local/lib/libgcrypt-11.6.0.dylib
January 21st, 2010
My new favorite IP phone is the Polycom 650, which supports wideband audio (G.722 codec). Asterisk has pass through support in the 1.4 branches, however they can’t transcode between other codecs, which makes checking voicemail. hearing ringing, and other things not audible. I noticed they have full codec support in the head repository, so I back ported the code and created the attached patch for those that want G.722 support in Asterisk 1.4.11 (it was originally written for Asterisk 220.127.116.11, but works with 1.4.11 so far). To load this patch you need to do the following from inside of the Asterisk source code directory:
# patch -p0 < asterisk-1.4-g722.patch
This patch was last tested on asterisk 1.4.11 (by me at least).
January 1st, 2010
So I haven’t used my blog to write editorial posts before, but as we ring in the new year I thought I’d express my views on Apple and Microsoft. This is not the standard “I love X, and Y sucks” comparison. I have become a big fan of Apple over the last 12 months (having gone from zero Macs to three in my house in that time). I don’t understand why both Apple and Microsoft continue to really go after each other, when, fundamentally, each is not a competitor to the other. Apple is a hardware company and Microsoft is a software company (except for the XBox).
Apple makes laptops, desktops, phones, MP3 players, keyboard, mice (and maybe soon a tablet), and software. The software is roughly there to encourage you to buy their hardware. This is the primary reason Apple has never pursued selling their OS X operating system for generic PC’s even though everyone knows it will run on them. My opinion is that they make really nice hardware and is fairly close enough in price to equivalent PC’s (where you get quality parts underneath). The only exception is the Mac Pro desktop, which I still find overpriced.
Microsoft on the other hand makes Microsoft Windows (Desktop and Server), Microsoft Office, Microsoft Communications Server, Windows Mobile, mice, keyboards, and cameras (I’m sure some other hardware as well, but not the actual PC). Microsoft is more than happy to sell you their software without any hardware. In fact, I know a lot of people that run Windows on their Mac (I do with Bootcamp).
Given these complimentary stances, I’m surprised that Microsoft hasn’t chosen to embrace the Macintosh and Apple. There is much money to be gained for Microsoft to create iPhone/iTouch apps (a quick search today shows only 2, Bing and Seadragon Mobile) that more tightly integrate with their other software products. Marketing that fact that you can run Windows on the Macintosh (instead of trying to show how cheap PC hardware can undercut their bottom line) to get the best of both worlds would be a much better strategy. Microsoft makes a version of Office for the Mac, but it isn’t as full featured as it is for the PC. Imagine if Microsoft embraced the Mac so much that end users could comfortably buy their software whether they were on a PC or a Mac? That would only increase their sales and bottom line and maybe keep their foothold on that #1 slot.
December 3rd, 2009
The original directions for this came from here. I’ve only modified them for a clean build of a Fedora based server or box. They should work for Ubuntu, SUSE, etc if you have created a Certificate Authority already.
- Make sure you’ve installed postfix and removed sendmail:
# yum install postfix
# yum remove sendmail
- Make sure postfix has been built with the necessary dependencies (both commands below should return something, if not, then you will need a different version of postfix):
# ldd `which postfix` | grep libsasl
# ldd `which postfix` | grep libssl
- Make sure openssl and openssl-perl are installed so we can generate certificates and create SSL connections to GMail
# yum install openssl openssl-perl
- Need to create a Certificate Authority (if you don’t already have one):
# cd /etc/pki/tls/misc
# ./CA.pl -newca
You will be prompted for the file name (just hit Enter). Then you will be asked for a PEM pass phrase, which you need to remember. You can fill out the Country Name, State or Province Name, Locality Name, Organization Name, and Organizational Unit Name to your liking (or take the defaults). You need to remember the Organization Name (if you changed it) as it must match one in a key we create later. For the Common Name, fill in “CA” (without quotes). Take defaults for everything else and when prompted to enter the pass phrase you need to enter the same one you did above.
- Create a client key that is sent to GMail to start the SSL encryption:
# cd /etc/pki/tls
# mkdir gmail_relay
# cd gmail_relay
# openssl genrsa -out server.key 1024
# openssl req -new -key server.key -out server.csr
# openssl ca -out server.pem -infiles server.csr
The second openssl command above will prompt you for the Country, State, Locality, etc parameters again. The only value that has to match what was entered for the Certificate Authority is the Organization Name. For the Common Name you should put your server name (fully qualified preferred, but does not really matter). The last command will prompt you for your CA pass phrase that you used earlier. When asked if you want to Sign the certificate, say yes. also when asked if you should commit it, say yes.
- Add the following to the bottom of the file /etc/postfix/main.cf. The last setting for any option is the one that is saved, so anything above this will not be affect these final settings:
#### GMail SSL SMTP Relay
relayhost = [smtp.gmail.com]:587
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_use_tls = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous
smtp_tls_note_starttls_offer = yes
tls_random_source = dev:/dev/urandom
smtp_tls_scert_verifydepth = 5
smtpd_tls_ask_ccert = yes
smtp_tls_enforce_peername = no
- Create /etc/postfix/sasl_passwd file with your GMail login credentials that looks like below:
Obviously, you need to change user to your username and password to your gmail password.
- Protect the files with your GMail login data:
# chmod o-r /etc/postfix/sasl_passwd
# chmod o-r /etc/postfix/sasl_passwd.db
# chown postfix /etc/postfix/sasl_passwd
# chown postfix /etc/postfix/sasl_passwd.db
- Restart Postfix and enjoy having your email from your server sent through your GMail account:
# /etc/init.d/postfix restart
December 2nd, 2009
So I’ve been working on getting everything running with Snow Leopard (64 bit kernel mode) as I did with Leopard. The last remaining piece of software that was not working correctly was the GPGMail plugin. The plugin uses undocumented API’s for Mail.app and with the change over to 64 bit for all applications it seemed to have broken. I was searching around google and found someone that had updated it to work with SL (the original author does not have the time to do it), however with the 10.6.2 update it broke again. The fix was simply to add the new UUID’s that 10.6.2 changed and it worked again. As I can’t seem to find the original link, I’ve included the fixed zip file here if anyone would like to use it. All you have to do is unzip this file, then move the GPGMail.mailbundle folder to your ~/Library/Mail/Bundles directory (make sure Mail.app isn’t running first). When you start Mail.app your GPG plugin will work again and have all the options in the preferences menus. You may need to also enable bundles support for mail (if you aren’t using any plugins currently, or it’s a fresh install). To do this open a Terminal and type:
defaults write com.apple.mail EnableBundles 1
June 24th, 2009
So I run an internal CentOS server that contains a complete mirror of the CentOS repositories that we use for all our servers at work. This saves a lot of time/bandwidth as the local mirror syncs itself with the outside world once a day (around midnight) and all the local servers point at the local mirror for installs or updates. Well, we also have a lot of Ubuntu desktops so I wanted to use the same machine to also create a local Ubuntu repository. The tool of choice for this job is apt-mirror. I couldn’t find an RPM (and my initial attempt at downloading the source and building was missing some prerequisites and had issues) so I figured, why not use Ubuntu to create an Ubuntu repository. I didn’t want to have a machine dedicated to this purpose, so in comes my favorite tool for Debian/Ubuntu systems: debootstrap. Fortunately, there is an RPM for debootstrap for FC10, but since it only relies on Python it can be downloaded and installed directly into CentOS 5.2. So to get a base Ubuntu install created do the following steps (at this time the highest release in Fedora’s RPM is intrepid, but that will work for our purposes):
- Download debootstrap RPM it is the same for i386 and X86_64 systems.
- # rpm -ivh debootstrap-1.0.10-1.fc10.noarch.rpm
- # mkdir /chroot
- # deboostrap --arch (amd64 or i386) intrepid /chroot/ubuntu-8.10
- # chroot /chroot/ubuntu-8.10
- (inside-chroot)# apt-get update
- #apt-get install apt-mirror
April 30th, 2009
I created a local Ubuntu repository and redirected archive.ubuntu.com, us.archive.ubuntu.com, archive.canonical.com, and packages.medibuntu.org to it so that we can do updates locally and not keep bothering the real mirrors for every desktop in our office (not to mention building thumb drives). I had a machine that kept giving me the following error after doing this, but none of the others did:
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/jaunty/Release Unable to find expected entry main/binary-i386/Packages in Meta-index file (malformed Release file?)
E: Some index files failed to download, they have been ignored, or old ones used instead.
Since it was only one machine, I figured I had some inconsistencies with my apt database so the fix was simply to remove /var/lib/apt/list directory and then rebuild it and do a new apt-get update. So if you have the same isssue here’s the steps to fix it:
# sudo rm -rf /var/lib/apt/lists
# sudo mkdir -p /var/lib/apt/lists/partial
# sudo apt-get update
March 23rd, 2009
UPDATED: March 24, 2009
I have been a long time Linux guy and have recently fallen victim to loving the MacBook Pro’s (and OS X as well). I still wanted to have a nice way to work in Linux on my MacBook Pro without some crazy repartioning/Boot Camp hack, so I tried putting Ubuntu on a USB stick and boot it with my MBP 3,2 only to find (even using rEFIt, that it didn’t work). So alot of reading later, it is general consensus that it is not going to work in any easy way on an MPB 3,2. So I got a new Aluminum MBP 5,2 recently and thought, why not give it another shot. I grabbed by Ubuntu 8.10 (created using debootstrap and some other customizations) and the latest rEFIt, 0.12) and to my surprise I got a GRUB boot screen and eventually a Gnome desktop. I was quite surprised and happy. Next step is to get rEFIt installed onto a USB hard disk and have it boot that external disk, so that I don’t need a rEFIt CD. I do not want to install rEFIt to my HD as the idea would be to have something portable for my work MacBook Pro, my wife’s MacBook Pro, my personal MacBook Pro and any other MacBook Pro (5th gen v. 2) that I came across.
It works! Can now boot Linux on an unmodified MacBook Pro (5,2) from a single USB stick (or external hard drive). I created a small 25MB partition as the first partition, formated it as Mac OS X Journaled and installed rEFIt to it, then followed that partition with a 100 MB boot partition, and then a root partition on a thumb drive (if using an external hard drive you could create swap as well, but I don’t do that on thumb drives so they don’t get worn out). Install linux normally (debootstrap is how I do it) onto the second and third partitions. Make sure Grub is installed to the MBR of the drive and points to the /boot partition as the second partition. Then take the USB drive to a MacBook Pro and insert it. Turn on the MBP and hold down the Alt/Option key until you see a boot menu offering Mac OS X or rEFIt. Choose rEFIt. After that you’ll be give a menu to choose OS X again or Linux. Here, choose Linux. Tada, now comes the Grub boot screen and then on into the Linux of your choice. Congrats and enjoy…
March 1st, 2009
So I recently swapped my Intel WiFi card in my Dell Inspiron E1705 for the Broadcom 4328 in order to have it work with my Mac OS X Leopard trial. I noticed that when I booted into Ubuntu my wireless was now broken and need some fixing. Make sure you have a wired ethernet connection that works as you might need it. I started by going to System -> Administration -> Hardware Drivers and make sure that “Broadcom STA wireless driver” is active. This will allow it to work, but there is some sort of problem with the ssb kernel module that breaks the wl driver. The fix is fairly simple, put the following in the file /usr/local/bin/fixbroadcom:
rmmod b44 wl ssb b43
From the command prompt make sure the new file is executable with:
# chmod +x /usr/local/bin/fixbroadcom
Then add the following line to /etc/rc.local right above where it says
Now when you reboot your wireless should be up and working using the wl knernel driver.
November 8th, 2008
I’ve recently had the pleasure to play with some Aastra 57i’s. I got heavily involved in creating some XML applications for these phones and found them to be very powerful in what Aastra exposes to the developer. My only problem was that Aastra has all these nice libraries in PHP, but I had a legacy Rails application that worked with Polycom phones that I wanted to add Aastra support to. So I set out to port all those PHP classes to Ruby ones and create what was needed to make it work with a rails application. I now offer these libraries up to anyone who many want to use them for their own use. They are at least 99.999999% compatible with the examples for PHP, especially when it comes to parameters. You’ll just have to change syntax to that for Ruby. To run the GD examples you’ll need to get ruby-gd (it’s available as a gem) installed. Here’s some directions to get the sample apps up and running with Rails:
- Create a rails project in a directory called aastra.
# rails aastra
- Go into the root directory of the rails application.
# cd aastra
- Unzip the aastra-ruby.zip file into the root of your rails application by running.
# unzip PATH_TO_ZIP/aastra-ruby.zip
- Start the rails server by running.
- Map one of your phone’s softkeys as XML with value of the demo application at http://yourserver:3000/aastra/aastra_sample.
- Optionally map one of your phone’s softkeys as XML with the value of the GD demo application at http://yourserver:3000/aastra/aastra_gd_sample.
I’ve created a Google Code project for it.
Download library from Google Code.
View rdoc documentation here.