nLite

Sunday, April 3rd, 2011

Normally I don’t do posts on anything windows because, well, I don’t like to use windows. But this one was just frustrating enough that I thought a quick writeup would be good.

I am helping a coworker with their personal laptop. It is a Toshiba something or other and at boot it was saying “Error in reading the disk” (or whatever the message is, you get the point). Knoppix quickly showed that not only is the disk readable and everything there but also the rest of the system works fine. Using knoppix I fixed the windows MBR but to no avail! The silly thing still wouldn’t boot. I popped in the Windows XP CD with the intention of doing a CHKDSK but to my great aggravation, the Toshiba laptop uses a sata controller that doesn’t have a driver in the Windows XP disk. Couldn’t do CHKDSK because it didn’t see a drive. Crap.

After some searches I ran into nLite. A tool to spin up your own XP disk. You can add drivers, files, windows updates, remove windows features and even have pre-installed software. To my great joy I got the driver needed for the intel 82801 SATA controller, spun up my own disk, and now this laptop is merrily performing the CHKDSK /P which HOPEFULLY fixes this problem.

Some things to note with nLite: Won’t work under wine worth a crap. Had to fire up my Windows VM to make it work. Otherwise it is pretty straight forward. Tell it where your windows disk is and where you want to store stuff on your hard drive. It will copy the windows files over and then give you a nice list of options to customize things. Seems as though sky is the limit, although I didn’t try it past adding some drivers. At the end it will make for you an .ISO which you can burn at your leisure. From there you are on your way to getting stuff done … even though it is windows.

PHP ini variables in apache config

Monday, February 28th, 2011

I think we all come across times where we need to have custom php.ini settings for a web-application. One such instance has come up with an application that I have written and recently deployed for Larkin Mortuary. We needed Zend Framework components and I needed session times to be longer. Now the second need is something that is very specific to just this application. There are other applications on this server that we would not want a longer session time.

So I decided to use the apache config file to get custom settings per application. I got a bunch of info from this php page http://php.net/manual/en/configuration.changes.php.

Now my apache config file contains the following:
<IfModule mod_php5.c>
php_value include_path “.:/usr/local/lib/php:/opt/ZendFramework-1.10.8/library”
php_value session.gc_maxlifetime “28800″
php_value session.cookie_lifetime “28800″
</IfModule>

We can see these changes taken place if we look at the output from phpinfo():
Directive                                   Local Value    Master Value
session.cookie_lifetime         28800              0
session.gc_maxlifetime         28800              1440

I also understand that you can have custom php.ini files for each application. But why when you are going to have a VirtualHost section for each application anyways?

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.

Laptop to an AP

Monday, July 19th, 2010

So, the other day I was at a location that has a wired internet connection but no wireless and no switch. I didn’t have switch and wireless with me and so, I decided to take on the task of making my laptop a wireless access point with WPA2 security. The guide that I followed the most is here, and much thanks to the author, although I did find that I had to do more to get it to work than the guide provided.

Very first you will need to have installed the following packages:

wireless-tools
iw
linux kernel 2.6.30 or later (I am using 2.6.31-21 ubuntu generic)
hostapd
dhcp-server

My hardware: Macbook Pro 3,1 running Ubuntu Linux (9.10 Karmic). This laptop has a wireless card that uses the atheros ath9k driver.

The rest of this article assumes that you already have a good working WIFI card, my point is not to troubleshoot why your wifi card doesn’t work. Also I assume that you know how to set up a DHCP server, know how to edit files, etc.

First, after making sure that my wireless card would even do it I set the static IP on my wirless card.

ifconfig wlan0 192.168.10.1 netmask 255.255.255.0

Next, I set up DHCP on the wireless interface only with my dhcpd.conf looking like this.

subnet 192.168.10.0 netmask 255.255.255.0 {
range 192.168.10.10 192.168.10.49;
option routers 192.168.10.1;
option ip-forwarding off;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.10.255;
option domain-name-servers 4.2.2.2, 4.2.2.1;
}
Then I set up my hastapd.conf file thusly.
interface=wlan0
driver=nl80211
ssid=YourSSID
channel=6
hw_mode=g
auth_algs=1
wpa=3
wpa_passphrase=12345678 (Change this, obviously)
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
rsn_pairwise=CCMP
Lastly, run the thing.
#hostapd -d hostapd.conf
Some other caveats. I did have to change some iptables stuff to allow routing through the eth0 interface and allow access to the DHCP server through port 67. My rule set looked like this:
-A POSTROUTING -o eth0 -j MASQUERADE
-A INPUT -p tcp -m tcp –dport 67 -j ACCEPT
-A INPUT -p udp -m udp –dport 67 -j ACCEPT
-A FORWARD -i wlan0 -j ACCEPT
Otherwise, that was all there really was to it. My brother-in-law could connect to the web through my laptop and I could use it with the wired. The world was right as rain.

Geek Squad Experience

Wednesday, July 14th, 2010

I think we have all seen the little Volkswagon Bugs plastered with their oval logo. Or their vans, all decked out in black, white, and orange. If you have ever been to BestBuy you can’t even purchase a DVD player without the offer of a Geek Squad ‘Double Agent’ to come and install the item. They offer in home diagnosis of computer problems and can do computer repairs.

I have heard of others having poor experiences with Geek Squad. My brother Ryan had a computer gone for 12 weeks. Each day a new excuse as to why it wasn’t done. The other day one of the computers at our floral show was on the fritz. In fact, two were. I went to look at the computers but was only able to dedicate a limited time to my diagnosis. Not being able to complete the repair the choice was made to call Geek Squad. They needed to have the computer fixed and it made sense to have someone come over that was a ‘computer expert’ and would make ‘house calls’.

Geek Squad arrived and went to work addressing the problems. First, was a computer that was being plagued by pop-ups. Whenever I went to diagnose the problem no pop-ups happened and I didn’t see anything out of the ordinary in the processes list. Geek Squad looked at the computer and said that the hard drive had bad sectors and the computer needed to be replaced. Well, that may be true, but bad sectors don’t cause pop-ups. They found the first thing wrong and the first suggestion was to replace the computer. Not even just replace the hard drive, the whole computer needed to be new.

They then spent a few hours looking at the next computer. This computer needs to use the modem, and what was happening was that the modem would work for a short time, and then stop working. When you would try to make a call, it would say the telephony service had an error, and restarting the telephony service didn’t help. Geek Squad still hasn’t figured it out. I am waiting for them to say that we need a new computer or it will take 12 weeks in their shop.

The point is they never did address the problems that we asked them to. It seems they just want to ‘up-sell’ the consumer. In addition their diagnosis cost was enough that I would have expected more. Has anyone had a good Geek Squad experience?

Introducing Open By Design

Monday, May 24th, 2010

I want to take just a moment to introduce my company, Open By Design. There are many reasons that I made this company and picked this name.

First, the reason that I started this company. My job responsibilities at work took a sudden change in December. Basically instead of just being the ‘Computer Guy’ I now manager one of our satellite locations. With that I meet nearly every family that is served there, and go on all of their services. This has severely curbed my ability to dedicate time to computer issues. So, I made this company to offload work from my job, to my business, which saves overtime for them, and gets me extra money. Truth be told extra money is always good.

The name is really a reference to my passion about the use of open source software. Seemed better than Wild Smith Productions. In addition my goal is to leverage open source software in any way that I can for the clients that I have/get. I am really targeting small businesses where I can help with infrastructure and web design. We’ll see how it goes.

Same Old Song And Dance

Monday, February 15th, 2010

I know that I have talked about it before. Many have talked about it before. But there really is additional hardships that come with administering a windows machine.

In this particular instance the machine has been running Windows XP fine with no problems whatsoever. No viruses, no spyware, nothing. I have this machine at my second office and VNC into it to do quite a bit of server administration (for my 3 windows servers) and using Microsoft Office when there is no alternative. So, I go to get into the machine today and it is acting weird. Stuff won’t open. For instance I get an error when trying to run adobe reader. So I restart the machine. I think nothing of it but I can’t ping the machine. Since the box is at a different location I just wait till I happen to be there.

What I find is that the machine will let me log in but when applying my ‘personal settings’ it sets there for a long time and then boots me out with the following error.

“A problem is preventing Windows from accurately checking the license for this computer. Error Code: 0×80090006″

Two issues I have with this message. First, what problem. Is it that files can’t be found? Is there some corruption on the disk? Is Sagittarius in special alignment with Saturn? What? Next, the cryptic error code number. If I only have one computer, what good is that code really going to do me? Even with web access why not tell me the issue right there. They have the code, and know what the code means. Put two and two together. This points back to number one issue.

So after a google search for this cryptic code I get some advice to reregister some DLL’s while in safe mode. No dice. Can’t get to safemode. So I do safemode with command prompt, and log in as the local administrator. I can get in. Apparently it doesn’t check the license in this case.

I reregister the DLL’s and low and behold . . . . no dice. Still won’t let me in. I get the same error message so I look at some Microsoft KB article on the subject. Do you want to know what Microsoft’s advice is for this particular message? I know I do! Reinstall your operating system. Yep, whatever magically happen it is way to mucked up to be fixed so we are going back to the drawing board on this one.

Even as I type I am trying one of the Windows XP’s ‘repair installs’ to see if this will work.

By way of comparison, I have messed up my Linux machines bad by changing file permissions or deleting my home folder. In each case a specific message is given saying what is wrong so that I can know how to fix it. Also, the answer is never an exasperated ‘just reinstall and start over’.

+1 for Linux.

Better Backups

Friday, June 26th, 2009

So, yesterday I talked about me casually wielding the sword of death that is `rm -rf`. Part of the issue has been that with some things I have daily backups. But for most stuff our backups are sporadic at best. So this is my question. I obviously need a better, and preferably FOSS, solution for backups. Any suggestions?

My first thought is to set up a NAS server that I can copy stuff to. Anything better?