Wednesday, January 16, 2008

how does bash work

When evoked the Borne Again Shell can launch one of two different types of interactive shells, login or non-login.

These descriptions are based on my experiences with a variety of Debian & Fedora based environments - each has their own peculiarities in their implementation of bash. I'll do my best to be "generic"

When you login via tty, ssh, or su --login - your $SHELL is launched for you. This is called a "login" shell, and it will automatically source the following files:
1) /etc/profile
then
2) ~/.profile or ~/.bash_profile
(but generally not both, one will take "precedence")
When you launch /bin/bash by some other means (xterm, konsole, su, or even typing /bin/bash) it is considered non-login and it WILL source .bashrc

It is VERY common for ~/.profile (or ~/.bash_profile) to source ~/.bashrc by either:
. ~/.bashrc
or
source ~/.bashrc
You can use source either way - in both interactive and non-interactive shells.

/etc/profile may source lots of other files. Sometimes /etc/bashrc (or /etc/bash.bashrc) and sometimes even ~/.bashrc - so watch out!

Your system may not have all these files - or they may have different names. Try:
ls -al /etc/ | grep bashrc
ls -al /etc/ | grep profile
ls -al ~ | grep bashrc
ls -al ~ | grep profile
to get some different ideas.

the command "su -" is short hand for "su --login root" or "switch user to root and launch a login shell"
it is NOT "switch to super user and load environment variables" (even if that may be the case on some systems)

Saturday, January 5, 2008

3RLOD Error 0020 X Clamp Replacement

And so, it was my turn:


For a used 360, I'm actually pretty happy it lasted as long as it did. Manufacture date was 2/06 - so there's nothing holding me back now.

Funny thing, this is actually how my FIRST xbox got modded. When it broke, it was out of warranty, so I had nothing keeping me from opening it up. XBMC is the best thing I ever did for my entertainment center.

In this case the interwebz says I need an X-Clamp Replacement - so you know... whatever.

I went with RBJ's MKIII method. Which is extremely well documented, so I didn't really take many pictures. (Update: Last I checked RBJ had taken down his tutorial, which is too bad - I sent him a message. Lamma has a good one up, which is essentially the same thing. However, it should be noted I did NOT buy the kit he's selling - although I'm sure it's worth every penny - you can get the parts anywhere. It's the work of removing the x-clamp, not the tools/equipment you use, that fixes your xbox.)

I used the following hardware from Lowe's:
2 packs - M5-.8x20mm - Oval Head Phillips - Sales # 138573 - $.92 each pack (Qty:2)
2 packs - M5-.8x16mm - Oval Head Phillips - Sales # 138566 - $.68 each pack (Qty:2)
5 packs - 5mm Flat Washers - Part # 138319 - $.56 each pack (Qty:10)


I spent probably more time than I should have cleaning the old thermal paste off the chips & heat sinks. Goo-Gone and 99% alcohol. Then I used a razor to spread a very thin even layer of some generic thermal paste on the CPU and GPU. I just used what I had lying around instead of the "artic silver" stuff everyone talks about.

Drilling the holes in the case was surprisingly pretty easy - I used a 1/4" bit for a pilot hole, then opened it up to 3/8's. Using the tape to hold the bolts in place while I got the board in place also went pretty smooth.

I accidentally screwed the CPU head sink down backward on my first try putting things back together (heat tube AWAY from the GPU) - but once I got everything screwed down... It booted up on the first try - green lights all around.

Been running great for 3 days - posted success.

BTW, I start the new job @ Rackspace on Monday.

Friday, December 21, 2007

Reset BIOS password on an IBM Thinkpad T23

I had really hoped I could reset the supervisor password on a spare IBM T23 laptop we had around the office by - disconnecting the CMOS battery or shorting a jumper. Anything besides the procedure described on sodoityourself.com

But apparently there's no way to "reset it" you just have to build yourself a "testpoint" jig and read the encrypted data directly off the EEPROM connected to the main board.

So I picked up a few parts from RadioShack and went to work. BTW, The password turned out to be XPBIOS.


But, I feel it's important to note, I'm an idiot.

The image you see above here is NOT of a working cable. It is in-fact the improperly constructed cable which was later rebuilt and used to successfully dump the contents of the actmel eeprom on the IBM Thinkpad.

Apparently there isn't much standardization to diagramming a serial connector. It's hard to tell if the flat picture you're looking at is supposed to be a male or female connection. And even worse - true circuit diagrams will often show the BACK of the connector - i.e. they draw it so you would be looking at where the "wires" are ACTUALLY connecting to the BACK of the connector.

Crazy.

Your only real hope is to know the pin numbers of an rs232 cable. Thankfully, almost ALL diagrams will include pin numbers to specify the orientation of the connector and avoid this type of confusion.

Well... that doesn't help you much if you don't know which pin is which on your cable. So here is a picture of an rs232 / db9 / 9-pin serial cable - with both male and female connectors labeled pin 1, pin 5, pin 6, and pin 9.


Not even wiki has this kind of information...

Wednesday, December 19, 2007

Nokia 770 OS2007HE - Can't change Regional settings

Flashed my Nokia tablet with the new '07 OS "Hacker Edition" - it's been running strong all night.

The first issue I came into was a problem changing the Regional settings and Device language from English (United Kingdom) to English (USA). I would get an error:
Device storage memory full.
Delete some data to free memory.
Total rubbish, the memory was fine. Not surprisingly all this little drop down does is change a setting in a config file. Install xTerm, gainroot, find the file, edit the setting, reboot and now my date displays month/day/year - no problem.

**UPDATE** Ivie found an even simpler solution documented on her blog - you may want to try that first.

I found an updated version of xTerm that draws the screen quite a bit better, and supports color. To install xTerm on a Nokia 770 0S2007HE go to maemo-hackers and click on the .install link for "bora"

To gain root access on a Nokia 770 OS2007HE use the same old 2006 "becomeroot" package - download it here.

Then just open up xTerm, su gainroot and edit the following file:
/etc/osso-af-init/locale
change the last two lines to:
export LANG=en_US
export LC_MESSAGES=en_US
that is... as long as you live here in the states.

I'll probably have more updates as I run into more snags installing and reconfiguring all my packages. To-Do list updated.

Thursday, December 13, 2007

Configure Nokia 770 Internet Search Applet

Add additional search engines to your Nokia 770 Internet Search Applet by creating carefully crafted .xml documents in /usr/share/mis. You can even make custom icons!

To add IMDB, Amazon, eBay, NewEgg & Google Maps (for Nokia 770) download internetsearch.zip from my media fire account, and add the extracted files to /usr/share/mis

Extract the files into a folder on your Nokia 770's memory card (something like internetsearch). Then you'll need to fire up xTerm and becomeroot. Copy the files to /usr/share/mis using a command similar to this:
cp /media/mmc1/internetsearch/* /usr/share/mis/
Reboot for changes to take effect.

I've added my favorite search engines. I particularly like the Google Maps for Nokia 770 - the trick to using this effectively is to "zoom in" to 150% using the buttons on top. Then instead of "dragging" around the map - you click where you want to re-center.

This is an update and repackage of work started by Moonshine.

For more details about the format of these .xml files reference this post on internet tablet talk.

Friday, November 30, 2007

c0072746 - Can not expand Public Folders in Exchange 2003

FINALLY!!! This has been bugging me for AGES!!!

There is TONS of errors that may crop up when you try to expand public folders in the Exchange System Manager (ESM). But I couldn't find much about MY error: c0072746

Exchange System Manager
An existing connection was forcibly closed by the remote host.

Facility: Win32
ID no: c0072746
Exchange System Manager
[OK]
I'm not really worried about the "error" - the public folders work FINE inside Outlook and OWA. My real concern was that I couldn't administrate the public folders through ESM - setting permissions and the like.

FINALLY I found a tool that will let me administrate them with out using ESM - PFDAVAdmin

Download it here
Run the .exe to extract the contents to a folder called PFDAVAdmin
Double click PFDAVAdmin.exe to start the GUI

From here you can change permissions on all your public folders, and correct problems such as no owner being defined. Once I fixed all the permissions errors, ESM was again able to administer the public folders - PRAISE JESUS!

Monday, November 26, 2007

My Wordpress Site

www.cciwholesale.com

Yup, so that's word press. I made more than a few minor re-writes to some of the default theme and widget pages. Enough changes that I feel justified in putting PHP experience on my resume.

The inital installation was super easy, that famous "five minute install" was really amazing to experience. CrystalTech even had a tutorial. They could have put this part closer to the top though:
You may need to add the “index.php” file as a default start page for your site configuration. This can be achieved within the WebControlCenter within the IIS -> Default Pages menu.
The only thing I feel I'm missing on a WIMP vs LAMP configuration is the URL re-write feature.

http://www.cciwholesale.com/cci/about

would have been a lot better than:

http://www.cciwholesale.com/cci/?page_id=2

But apparently there's no good way for a web hosting company that runs an IIS server to give their users a good way to implement this feature. If I'm wrong on that - I'd love to be corrected.

I got a new job working for RackSpace - they're a managed services hosting company, and the largest tech employer in San Antonio. I am actually pretty excited - I won't start until after the holidays. I'm going to be working with the managed services group, mainly setting up back-up policies on all their client's various hosted systems, filling restore requests, and generally troubleshooting any problems that come up. It's all good.