December 29, 2007

Wireless Phone vs. Wireless Internet




I have had the unpleasant experience of having to deal with a wireless router acting as if it where possessed at my house. The symptoms where randomly it wold crash and reset, then repeat many times over. After reseting it, it wold be fine for a while then all of a sudden it would starts all over again. I have worked with routers before and if all fails then hard reseting them always fixes it, not counting the occasional hardware failure. This time was not the case, and as funny as it was for a while the constant drop of internet during important tasks was starting to get on my nerves.

So as usual I looked at the possibilities...

1. Settings got messed up (Maybe, but reset did not help)
2. Verizon is dropping our connection (Looked into, and not the case)
3. Something is wrong with the router (Only other possibility)

It turns out that something was wrong with the router, but not the router its self. My family had recently purchased a new phone, 5.8GHz. This supposedly should not have any problems with the 5.4GHz router, and phone calls do not cause any problems. The big problem is that the phone has another wireless connection to the two base stations that are included, and combine that with the phone being less then a foot away from the router and you get interference. After moving the router away from the phone all is well again. Now I have to find a new place for it...

December 28, 2007

Samba & Swat on Mac OSX

With PHP and Mysql installed, it was on to setting up file sharing on my G4 Server which now had 4 hard drives in it. A friend of mine already had a server set up a while ago, so I had a little knowledge of Samba configurations, and I figured it was similar to the webDav setup I had done on an eMac a while ago.

There is nothing to install because Samba is already installed in OSX and you can just turn on Windows File sharing in the Sharing preference panel to start it. However beyond that there is not much control over what is shared and who has access to what. To do that you need to edit the smb.conf file in /etc, but I am inexperienced/lazy and would like a better way of doing this. After doing some research found that Samba had a web GUI for it called Swat, and like in the case of PHP it is installed by default, but is not active.

To start the service you must set the Swat service as avalable and using tcp port 901. I used the page here to figure this out. "Configuring xinetd to launch swat requires just a few steps. You first need to check that your /etc/services file contains a port entry for swat. To do this, enter the following command in the Terminal: cat /etc/services | grep swat. This command should return one result, which will list the swat service as running on port 901/tcp. If you do not get a result for this, add such an entry to your /etc/services file by editing it with pico running under sudo or as root. Add an entry that lists the information above and then save your changes." I used VI because that is what I am most comfortable with. There is already a service specified by port 901, but it is not needed so remove the line with UDP and replace with swat.

After that I tried to set up a service in etc/xinetd.d for swat, and that worked, but the swat page at localhost:901 would not let me log on. I found that there was no password file associated to it, and quickly looked for a fix. Not only did I find a fix but an easier way to set it up. Mac os Hints had a good Article on Samba and in the comments is how to get around the problems. These are the steps I finally figured out, using the mix of suggestions on the page here.

1. Edit /etc/hostconfig
2. Change SMBSERVER=-NO- to SMBSERVER=-YES-
3. Save
4. Edit /etc/services
5. Find the line where port 901 is defined
6. delete the line where it says 901/udp
7. Change the 901/tcp line to read: swat 901/tcp
8. Save the file
9. cd to "/etc/pam.d"
10. run "sudo cp ./passwd ./samba"
11. run "/sbin/service swat start"
12. reboot
13. goto http://localhost:901

After this it is all working and I can now use swat to set up my Samba shares.

December 27, 2007

PHP & Mysql on Mac OSX

Now that have a running G4 tower that I can use as a server, all that is left is to set up the required items on it. My main goal is PHP and MYSQL so that I can start development on the next update to the PSU AMS groups website. From what I had learned from previous setups is that PHP is already installed in Mac OS 10.4, however it is not completely active. Luckily the process was very painless and straight forward. It also helped that I was not doing anything more then a simple setup.

I made the PHP setup a lot harder than it had to be and tried to build from the latest source. Sadly I did not have all of the required dependancy files for it and that quickly became a waist. Still it was a good idea to read the Apple developer page on PHP first here. Luckily someone had already made an installer for PHP, and I just had to find it at Entropy. It installed without any problems, just make sure to read the directions.

Mysql was next, just like PHP there was a handy installer for it. Apple's developer site has a great page on installing Mysql on Mac OS X here, that I started with. It boiled down to just get Mac installer from the Mysql site and install it. It also included a control panel for Mysql that I installed, it lets you set Mysql to start up on every time the computer is turned on.

One thing that was missing was the phpMyAdmin page for Mysql. I thought that it would be included, however after trying to get to lazurus.local~efeion/mysql, which is how I get to it from school, it quickly become apparent that was not the case. It is actually a separate project here. To make it similar to what I am use to using, after extracting the directory, I named it mysql and placed it in the sites folder in my directory. This is where apache is set to host websites by default, and is fine for what I am doing. Now if I went to lazurus.local/~efeion/mysql and the phpMyAdmin page would show up, but now complained about not being configured. Easiest way to fix that was to go to the mysql/scrips/setup.php page. This handy script will generate a config file for phpMyAdmin, just grab what it outputs and save it in a file called config.inc.php located in the main mysql folder. There is a sample version in that folder for the more advanced users to set up manually. However I am still new to this and did not want to dig that deep yet.

Now I had a PHP web server with a Mysql back end all set up, which was a lot easier than I expected.

December 25, 2007

Santa Chief


When we where small santa looked round and jolly. However with the wake of the digital age, santa must have decided that it was time for a few upgrades. Here is a picture we caught of santa in the apartment! (This is not a photoshop this is direct from a camera!)

Merry Christmas to all from Santa Chief and Efeion.

December 23, 2007

Running Lejos on Mac OS X


One of the classes I took last semester was Artificial Intelligence, and after a long and horrible 9 weeks of prolog bootcamp, we finally hit the robotics part of the class. There was only one problem, we where using Lejos, which is a java based programing language for the Lego NXT bricks. This was fine because I am quite proficient with Java, the problem was that Lejos does not have native Mac OS support, and all of the forums that relate to it only give partial help or promises of support eventually. This is not good enough so I set off on an adventure to get it running on my MacBook Pro.

The first thing I did was to get the latest update to Lejos, big mistake, the linux Lejos 0.4.0beta would not work for me. I finally got it to force build, but this was only enough to get a broken firmware on the brick. Realizing this I went back to the 0.2.0alpha that we where using in class and this compiled fine. You just download it from the Lejos Site and unzip it. Place the entire lejos_nxj folder in the Applications folder. Then open terminal and cd to the build directory aka /Applications/lejos_nxj/build. Then type and run ANT and it will make a build for the Mac OS based on the build.xml file in the build folder.

The problem I ran into is that in terminal you have to ether set up a tcsh shell with the environmental variables set or set them in a .profile file in your home folder. Both of these worked but where annoying and took quite a bit of research on my part to figure out what needed to be done. Also you then need to use a text editor and run the build, compile and link command in the tcsh shell on the .java file each time you run it. Sadly this was no better than the PC solution, which was essentially doing the same things through Eclipse and batch files.

In lab I had done the basic PC Eclipse Setup, but quite frankly the whole button setup made me want to scream, not that was was that hard, but instead I found it very pointless for all of that work that was required. So after I got Lejos working on my Mac I started to write a small application that would let me code and then run the code in one simple step, and at the same time make the PC users in my class envious of its simplicity.

The final result I was quite proud of, and only took about a week of using/upgrading, plus a bit of unix scripting on the back end to get it to the point where I was happy enough to just bring my laptop to lab and use it instead. Also now that the class is over I spent a little time to clean it up a bit more and make it more usable for people other than me. If you are looking for a quick solution or are planing on doing something similar I have uploaded my application, which I am calling LejosTools. Get it Here I hope it can be as helpful to someone else as it was for me. Also I have included the source with it, because I have no plans to continue development. All I ask is if someone uses the code send some credit my way as a developer. Otherwise enjoy...

As a side note, I have not tested other versions of Lejos, but from what I have seen the unix commands have not changed, so if you can get something greater then the 0.2.0alpha working, LejosTools should still work. If they do change just update the lejosfull sh script in the resources folder.

December 17, 2007

iPhone apps on iPod touch

After jailbreaking I realized that the iPhone apps where not included in the installer app. There are many ways to get them, one way I have found so far is to download iJailBreak, it has an option when it starts up to install iPhone apps. Follow the instructions, and you must have the bsdSubsystem and OpenSSH installed. However the eMail and Maps do not always work...

After that I found that you need a prep file for use with Maill.app and Mapps.app on the touch. The easiest way to get them is to go to installer -> sources, and click on edit. Then click on add and enter this url: “http://repo.us.to”. It has the iPhone apps and the file needed to run them.

After you have this new source go to install and browse to “iPhone 1.1.2 Apps for iTouch” from there Install “Mobile Mail Prep” as well as any other iPhone apps you might want. This is a safer way to get the iPhone applications, and it lets you chose and uninstall if need be later. After finding this, a friend of mine that had trouble with iJailBreak had no problems with getting the apps he was looking for.

The only problem I have found is that repo.us.to is slow, so after getting what you need remove it from your sources and the installer app will return to normal speeds.

Update: You should only add these apps after updating to 1.1.2, there is a good risk of partial bricking and needing to restore your touch if you do not. (aka You will have to start over from the beginning... )

iPod touch jailbreaking

I had recently gotten an iPod touch. I did not need the phone so it was the best choice for me, especially with the sdk coming out in February. So after having much fun playing with the basic thing that come on it, I quickly decided to jailbreak it. My iPod touch had the 1.1.2 firmware, so I had to go through some hoops to get it to work, if you still have the 1.1.1 it is a lot simpler.

First I had to go to Here to get the 1.1.1 revert firmware. Then in iTunes you option click restore and it lets you select the file. This took forever because the download was ~150mb. Then the restore took a while as well.

After it was all set and working with the 1.1.1 firmware, it was time to jailbreak. Go to jailbreakme.com on your touch(1.1.1 only) or Manual Install from conceitedsoftware.com and follow the instructions. After the touch is jail-broken you need to launch the installer.app and scroll down to tweaks 1.1.1. Install the OKtoPrep file. This will ready your touch for the 1.1.2 jailbreak.

Now in iTunes click update and let it update your touch to 1.1.2. After that is finished you must jailbreak your touch again. This is done by downloading the latest jailbreak from conceitedsoftware.com. It will jailbreak the touch that is updated to 1.1.2.

There you go you now have the latest firmware and once again can install apps.

December 9, 2007

Power Supply Fun Part 2




After trying to revive a G4 mirror drive door power-supply by replacing the fuse instead of using a screw driver did not help ether. Same sparks and smoke as last time, just the fuse blew instead of continuing to give off sparks as in my first attempt. So on to plan B... After doing a good deal of research online, there was little evidence that you could take a regular atx power-supply and replace a dead G4 MDD PS with it. After removing the pins from the ATX PS molex connector (thanks Matt) and cutting the entire wire from the MDD PS i just had to put the two together. Please note that you need the original molex connector from the old power supply for this to work, or one that fits, a regular ATX power supply does not have the right number of pins.

If you look online the MDD PS has 24 pins and the ATX PS has 20-24 (mine had 20+4). This is not so bad but the wires in each are a little different, so in all cases some rewiring needs to be done. First thing was to figure out what wires I had and what needed to be modified. ATX and MDD are good places to start. for the pin-outs. My main problem where the two extra white(-10v and +25v) and the gray(PWR-OK) wires. The -10v cant be used so ignore it, and the PWR-OK is also not needed. So the only problem was the +25v used for the video card to drive apple displays. Well you could find some way to add 25v to it, but my friend and I figured that it should be fine with out it, which turns out to be correct. However because of this do not try to use an apple cinema display with this tower!

Connect all of these together matching the same colors together, ignoring the white and gray from the ATX PS. Plug it in and behold the computer turns on. I also connected the MDD power leads as well, because they where longer and the ATX PS did not have enough connector to match the two optical drives and the 4 hard disks. Plus a little wire wrap to make it look less messy and protect the wire splices. The final step was to mount the PS in a good place. Because the original was slim it fit in the pack wall, not so much in this case. The best solution I found was against the side where the white speaker box was. I drilled two holes and zip tied it against the roof of the case. If I had more tools at my disposal I would have found a way to bolt it to the top, which would look a little better.

There you have it, a dead MDD brought back to life. It also has more power now, 400w from the 360w of the original power supply.

Update: After several months the G4 is still cranking away 24/7 as my web development server, and apparently this post has come in handy for some one at http://atxg4.com/forum/read.php?3,8

December 7, 2007

Power Supply Fun Part 1




I was able to grab a G4 tower off of surplus at school for 1$, the only problem was that the power supply does not work. After having great success fixing, breaking, then fixing again, a G3 iBook 900mhz, which I also bought for 1$ on surplus, I figured this can't be any worse. Anyone who has worked on an iBook would agree. So plan A was replace the fuse that had burnt out. If that fixes it, YAY, otherwise plan B is to mod another power supply to work with it.

Plan A did not work so well, with my best wisdom ever, I though that "OK I don't have the right fuse at the moment, time to improvise..." A torx driver's metal body should work... or so I thought. Lets just say after getting ready to switch on power from a good distance away( I am not that stupid and knew something like this could happen), then doing so caused sparks and a little smoke to fly. Sorry no picture of that.

Well, so much for that idea. As long as the power supply did not fry I will get a new fuse and try again. I figure the PS is already failing, and the sparks where from what ever part(s) failed, and because there was no fuse to pop it sparked. Yet it is worth the few bucks to get a new fuse and see. Worse case, I just have to start to mod the other regular power supply I have to work with it. That will be fun.

December 6, 2007

Haibane Renmei Webcomic



I am a big fan of Haibane Renmei becase of the religious themes that are used throughout the series. There is a great webcomic parodying the series called The Very First Haibane. The main character also reminds me of a friend of mine...

It is a great way to kill some time, and some of them are quite funny.

Check it out at http://firsthaibane.rubychan.de/

December 3, 2007

How to use a post photo in css







This a test to see how can get an image uploaded and use it in the css for the blog.

I want to see what is a good way to get images on the blogger server and then use them for my site layout.

Update: Although I could not find a good way to upload photos for use in the website layout, I figured that because Blogger lets you upload photos in posts, you could then use the address to that picture in anything hosted from the same server.

Well it worked, the photo in this post is now also used in the main css, and looks quite good. This is a goofy way of doing it, so I will be avoiding this method if possible, but for now it works. There must be a better way, I probably just overlooked it.

December 2, 2007

The Begining

After setting up a ChageBlog for work, I have been slightly curious about making one just for personal use. I am not much of a writer, but this could be a good place to post some of the random things I find or discover. Being a CS major there is plenty of that, plus I have been told that it is a good way to build up a portfolio of things I know or have worked on. Well maybe some one will get something out of this, that would make it all worth while. Enjoy