Archive for the 'General' Category

Burn a CD with only CLI

Monday, December 13th, 2010

While this is not a complete set of the commands it is a recounting of my experience burning a CD while only using a shell. The full stuff can be found here. When installing debian at one point I found myself with a minimum system and desperatly needing to have the testing install CD. I had the CD downloaded, and could see the ISO, but I needed to go forward from there.  It was pretty easy.

cdrecord -v -pad speed=1 dev=0,0,0 src.iso

After that little command it was easy. All went well and I now had a CD that I could use. On the source website it says that you may need to adjust the dev parameter.

Why I am on Twitter

Friday, October 15th, 2010

I have had this title sitting here for a long while. I can’t figure out why I am on twitter. I really don’t know. I don’t have anything going on that interesting. I think the thing that really pushed me over the edge was ping.fm which allows me to update everything at once. So, laziness has me posting in more places. So, if you want to follow me, you can. I am on twitter and identi.ca as @undertakingyou.

From Debian Testing to Ubuntu 10.10

Thursday, October 14th, 2010

A while back I was tired of ubuntu, and didn’t want to deal with the ‘issues’ of Ubuntu 9.04. I also was ready to try a different set of problems. All in all my experience with Debian was fine. The install was easy, it was other things that really made using Debian all the time a little hard. Little things really. Printing pictures was a pain. Importing pictures from my camera was difficult, maybe difficult is not the right word, but cumbersome. When you are used to just plugging something in and a cute dialog box pops up kindly inviting you to import your pictures.

Truth be told, while under the hood ubuntu and debian have everything very close to the same, ubuntu has a certain polish and ease that really makes it a great distrobution. So when Maverick became available I went ahead and got all the ISO’s that I would need.

The install was easy, and once it was done there was not a lot of updates to do. I blame this on it being just a couple of days old. There are still some of the old bugs still there. For instance, on an install with ubuntu my Sound Blaster Audigy sound card won’t work on a new install. I did not have this issue with debian. I am still not a huge fan of one notification at a time. If three people send me chats I want to know all three at one. Being notified one at a time is still in my mind a huge regression in functionality.

Some noticeable differences: a new photo manager, ShotWell, which I like better than f-spot. VLC bug fixed that would not shut off the screen saver while watching a movie (a happy change).

All in all though, I like the new Ubuntu 10.10.

OpenVPN on Android

Monday, September 13th, 2010

I have really enjoyed having a VPN so that I could remote into work. The other day though, I had to skip out on fishing because we had some computer issues and I didn’t have my laptop. It made me think, wouldn’t it be sweet if I could just use my super duper android phone to VPN into work. This is what I did. First off, an assumtion is made that you have a rooted device.

What you need is to have both busybox, and the tunnel device kernel driver, tun.ko. I am running Cyanogenmod 6 which has busybox already installed. For some reason this version of Cyanogenmod doesn’t have the tun.ko, and ones that I downloaded would not insert into the kernel. So, I installed a ChevyNO1 kernel that comes with the tun.ko driver, and we are to the races on that part. This may sound intimidating, but ROM Manager from the market makes this very easy.

Next thing to just make life easy is to install OpenVPN Installer and OpenVPN settings. They are in the market, go ahead, download it them. I will wait. OpenVPN Installer gives you the option to install all the openvpn stuff. Go ahead and run that. Unfortunately, at the time of this writing, openvpn won’t work still. The problem is a bug in the shipped OpenVPN binary noted here: http://code.google.com/p/android-openvpn-settings/issues/detail?id=26 . There is a link to get the OpenVPN binary that would work.

Once you have that use the OpenVPN Settings to establish connections. It will ask where your key files are and once it knows that and your server, you are up and going. Now I can really get to work wherever I am. Wait a second, maybe I don’t want to do that …

First Experience with Zend Framework

Friday, September 3rd, 2010

I wrote a review of Zend Enterprise PHP Patterns a while back. While I read the book, I had yet to jump into the Zend framework and really make a project that used it, or any of it for that matter. While doing a project for a client I had need of making several forms. Nothing is more tedious to me than making forms. The html tags for labels, the form input, and then the PHP on top of it to give default values. This is OK when making a short form. But I get extra sick of it when doing a form with even ten or more fields. When faced with such a situation this last week I decided to try just a piece of the Zend Framework.

This is possibly my favorite thing about the framework, the ability to use as much or as little as you would like. It gives great flexibility and allows you to include parts into a currently existing project.

To get started, you need to tell your PHP application where zend is, in addition, starting the autoloader at this time really makes life easy. The following code does just that:

  1. set_include_path(get_include_path() . PATH_SEPARATOR . ‘<wherever Zend is>’);
  2. require_once ‘<wherever Zend is>/Autoloader.php’;
  3. $autoloader = Zend_Loader_Autoloader::getInstance();

With these two items in place you can just begin to call Zend Classes and Functions without another thought about it. I put this in my included header.php file, where I have all kinds of includes. Now my functions are available to me wherever I am.

To start your form it is very easy.

  1. $form = new Zend_Form();

That is is, we have started a form. Everything else will use the newly created $form object and go forward from there.

Next, you must add attributes and elements to your form. I found certain parts of this very poorly documented. I wish there was a list of acceptable options, etc for each form addition type but there isn’t. Maybe I should just not complain and write it, but I digress. Adding attributes is rather easy

  1. $form->setAction(‘./action.php’)
  2.      ->setMethod(‘post’)
  3.      ->setAttrib(‘id’, ‘form_id’);

Now adding form fields, a couple options here, both quite easy. First is to just use the $form object and add directly:

  1. $form->addElement(‘text’, ‘text_input’, array(‘value’ => $_REQUEST[‘text_input’], ‘label’ => ‘Text Input:’));

The arguments passed to the addElement method are type, name, array of  options.

The second option is to create a Zend_Form_Element object and add that to the $form object:

  1. $select_input = new Zend_Form_Element_Select(‘select_input’);
  2. $select_input->setLabel(‘Select Input:’)
  3.      ->addMultiOptions(array(
  4.           ‘Option0′ => ‘Option0′,
  5.           ‘Option1′ => ‘Option1′,
  6.           ‘Option2′ => ‘Option2′))
  7.      ->setOptions(array(‘value’ => $_REQUEST[‘select_input’]));
  8. $form->addElement($select_input);

The last bit, actually rendering your form. Some caveats here, Zend Framework components can be used outside of the Zend MVC environment, but you still must define a view in order for the form to actually come up. If you do not, you will get an exception. It isn’t hard though, the following will do it for you:

  1. $form->setView(new Zend_View());
  2. echo $form;

Viola! The form magically appears in front of your eyes. A couple things to remember, anything that can be attribute of an HTML form of input elements can be added to the Zend_Form in the options array. This includes, value, class, specifically defined ID, etc. I will be using Zend_Form much more often. It is so easy to get forms together quickly and easily.

Lazyweb: VNC and RDP client for Android

Friday, September 3rd, 2010

I am looking for a good VNC and RDP client for android. Preferably this app would cost nothing, but if some money is needed no more than $5.00. Has anyone used anything that has been a really good VNC and RDP client? Is there suggestion of two separate ones, one for each protocol?

My experience updating ubuntu servers

Wednesday, September 1st, 2010

I had a contract to update three linux servers at various locations for my client. Each server presented a different set of issues.

Ubuntu has really made these updates easy with the do-release-upgrade command, part of the update-manager-core package. Running the command does pretty well everything for you, and all you have to do is follow a couple of on-screen instructions.

The first server to update was a public webserver. It sits in the datacenter at Xmission, and houses several websites, a database server, and some dns services. This was on ubuntu 8.04, and I was migrating it to 10.04. I logged in from my house via SSH, ran the do-release-upgrade command and we were off to the races. I rebooted afterwards, and waited about 5 minutes. Sure enough I can even SSH back into the box. Then I realize that the upgrade removed my MTA and Database server as part of cleaning up unused packages. Really seems silly to me that is would do that. Thankfully just installing the database was enough, all the databases and users, etc. were still there. Then a fight with apache to actually read the virtualhosts and serve them right. I don’t know what I changed, but it worked.

The second was a backup server onsite. It was at ubuntu 9.04, but with two release upgrades I was running strong on the LTS. Everything else just seemed to work, so that was an easy done.

Last machine was an internal webserver, running some intercompany webapps. It also served as a MTA for the office, allowing copy machines to send mail. It has been the real pain. Upgraded remotely via ssh and it never came back after the reboot. When I physically got to the machine to check it out it was saying something I have never seen before. Grub was complaining that it couldn’t find /dev/mapper/root-device and would drop me to a busybox shell. But I could see /dev/mapper/root-device from the shell. I fought with this for a while. After something like 100 restarts I got the bright idea and just typed ‘exit’ at the busybox shell. Guess what!!! The machine started fine! I have no idea what the machines damage is, but from now on I just type exit when restarting the machine. Thankfully the server doesn’t restart very often, in fact, this update was the first time in 1 1/2 years that I have restarted it. But my trial was not over then. Last large issue was the /etc/network/interfaces file. It kept the old file, but then would not work right. Weirdest symptoms, I could get to the machine fine from 2 of our 5 subnets and the computer could not get to the outside world. I fought with it a while and finally just disabled one of the interfaces and renamed some of the alias’ and away we ran.

I guess the moral of the story is, no server update ever goes smooth. Thankfully I am done for two years.

Fixing Windows MBR with Linux LiveCD

Monday, August 30th, 2010

I ran into an interesting snag the other day. I had a hard drive that was not showing up and therefore the system would not boot. I really found this odd, because it showed up to the bios, and all hardware tests said the drive was fine, so I thought I would try and run a FIXMBR on the drive to see if that was the problem. Now, here is where the snag comes up. Normally I would take my Windows installation disk, and once running I would use the ‘recovery console’ to run the command and be done with it. But the Windows disk would not start. It would hang on the ‘Inspecting your systems hardware configuration.’ So, I needed the Windows Recover Console, to run the command, but I couldn’t get the console . . . and the whole things crashes down.

I then found http://www.arsgeek.com/2008/01/15/how-to-fix-your-windows-mbr-with-an-ubuntu-livecd/ . I thought to myself, how perfect is that? I know that the ubuntu disk will run, and then I can perform the changes I need and away we go.

Some changes since the writing of my reference article. The ms-sys package is no longer in the repositories. If you go to their website you can download source and do a quick make, make-install.

After you have done that the rest is easy peazy. Once again, linux saves the day.

Resource Website

Thursday, August 19th, 2010

The other day I had an HP laptop with some problems. I sent it back, using their HP care stuff. I was pleasantly surprised with how fast they shipped everything, at their expence, and got everything back to me. But as I started the machine they didn’t have the wireless driver installed. Using their website they said that I had to have a broadcom card, and so I installed their provided drivers. Unfortunately, it wasn’t a broadcom card. They were wrong. All I had was the Vendor ID and Hardware ID.

After some searching I found http://www.pcidatabase.com/ . This website can just search by Vendor ID or Hardware ID and give you the information that you need to get stuff fixed. I have used it a couple of times and found it very helpful.

My experience installing Debian

Monday, August 9th, 2010

A while back I wrote about my trepidation with Lucid. I have used ubuntu linux ever since my first linux introduction 5 years ago. But recently the changes in Lucid and general pain-in-the-butt install issues have had me very scared to install it. I have not updated any of my machines to Lucid but the other machines that I have updated have been less than spectacular.

So, I finally got around to installing Debian on my home desktop machine. I have been holding off because I am lazy. So far everything had worked, but I had a weekend off and away we ran with it.

First, I did have two little issues. I installed lenny and my update to squeeze crashed and burned. Once I used the Testing installer all was well. Also the installer didn’t like hooking to the wifi even though my wireless driver is included in the kernel as the ath9k driver. Aside from that this was the smoothest install I have ever had. Ever. Of all time.

Some things that I really liked. Once I installed the system I was up to date and running full steam ahead. No need to update and wait and download everything. That was already done as part of the install. Usually there are some configuration things and little get it together issues. Once I associated my bluetooth keyboard and mouse I have not had to do anything else. Everything has just fallen into place.

Also, rolling releases are just an awesome idea. I can stay on testing and I will always have an up to date system. Furthermore, the packages in the repositories are not archaic, but actually quiet up-to-date.

All in all, I am very pleased with my Debian install.