Mar 1 2009

DD-WRT350N - USB Multimedia

So I run DD-WRT on my Linksys WRT-350N router. I know the router comes with a media server, allowing music and videos to be played through a wireless connection. My goal is to get this working using DD-WRT, but I’m having trouble figuring out how to do this.

My first step was to upgrade my version of DD-WRT to v24-FINAL. Doing this gave me the option to enable USB via the web control panel. The upgrade went flawlessly. I enabled USB and my external hard drive is connected.

This is where I am right now. I’m doing a bit of reading into where to go from here, but it looks like I’m going to have to install some Optware packages. My main concern now is how much space I have on the router to be able install the packages I will need.


Jan 16 2009

Adding a mini login box to Magento

I’m surprised there is not one in the default template for Magento.  Nevertheless, it’s pretty common to see a login box on a sidebar, and I need one.  This is actually pretty simple to do, we’re going to be modifying templates, layouts, and unfortunatly we’re going to have to alter the core (for something really silly.)

First, lets go ahead and make a template for the mini login box.  Take a look in template\customer\form…  What’s this!?  We already see that there is a mini.login.phtml.  For a closer look:

27
28
29
30
31
32
33
<form action="<?php echo $this->getPostActionUrl() ?>" method="post">
    <table width="100%" class="mini-login">
        <tr><td><?php echo $this->__('Email') ?>:</td><td><input name="login[username]" /></td></tr>
        <tr><td><?php echo $this->__('Password') ?>:</td><td><input name="login[password]" /></td></tr>
        <tr><td>&nbsp;</td><td><input type="submit" value="<?php echo $this->__('Login') ?>" /></td></tr>
    </table>
</form>

We’ll, even though functional, this isn’t styled nor does it fit in with the default Magento template. So let’s change this.

27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<div class="box base-mini mini-login-form">
    <div class="head">
        <h4><?php echo $this->__('Login') ?></h4>
    </div>
    <form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="login-form">
        <div class="content">
            <ul class="form-list">
                    <li>
                        <label for="email"><?php echo $this->__('Email Address') ?> <span class="required">*</span></label><br />
                        <input name="login[username]" value="<?php echo $this->htmlEscape($this->getUsername()) ?>" title="<?php echo $this->__('Email Address') ?>" id="email" type="text" class="input-text required-entry" style="width:122px;" />
                    </li>
                    <li>
                        <label for="pass"><?php echo $this->__('Password') ?> <span class="required">*</span></label><br />
                        <input name="login[password]" type="password" class="input-text required-entry validate-password" id="pass" style="width:122px;" />
                    </li>
                </ul>
                <p class="required"><?php echo $this->__('* Required Fields') ?></p>
  		</div>
    <div class="actions">
        <button class="form-button-alt" type="submit" name="send" id="send2"><span><?php echo $this->__('Login') ?></span></button>
    </div>
</form>
<script type="text/javascript">
    var dataForm = new VarienForm('login-form', true);
</script>
</div>

Also add this to your CSS:

.mini-login-form h4 { background-image:url(../images/icon_page_white_text.gif); }

Now that we have a template (mini.login.phtml), we’re going to have to add it to our block structure. Open layout/customer.xml, and make this change starting at line 65.

71
72
73
74
75
76
77
78
79
80
    <customer_logged_out>
        <reference name="top.links">
            <action method="addLink" translate="label title" module="customer"><label>Log In</label><url helper="customer/getLoginUrl"/><title>Log In</title><prepare/><urlParams/><position>100</position></action>
        </reference>
        <remove name="wishlist_sidebar"></remove>
        <remove name="reorder"></remove>
		<reference name="right"> 
			<block type="customer/form_login" name="mini_login" template="customer/form/mini.login.phtml" /> 
		</reference> 
    </customer_logged_out>
Mini Login Box

Mini Login Box

We now have a functional login box in our right-side column. There’s a problem though. You’ll notice that every single page of the cart now has “Customer Login:” in the page title. Here’s a quick fix.

Open app/code/core/Mage/Customer/Block/Form/Login.php and comment out line 40.

38
39
40
41
42
    protected function _prepareLayout()
    {
//        $this->getLayout()->getBlock('head')->setTitle(Mage::helper('customer')->__('Customer Login'));
        return parent::_prepareLayout();
    }

Remember to copy this file/folder structure and put it in app/code/local. We do this, because when you go to upgrade your Magento installation, your core files get patched, thus erasing all the hard work you did :P


Dec 19 2008

3 books I’d like to read

VIM is probably one of the most powerful text editors I’ve ever come across. I can’t even begin to tell you what it’s capabilities are. This book is probably a little advanced for me, but I’ll still be able to learn from it.

Java is always something I wanted to learn. Also, I enjoy reading books published by Apress.

amazon item image

Beginning Java Objects: From Concepts To Code, Second Edition
Price: USD 38.49
40 used & new available from USD 5.98

MooTools is a light, modular JavaScript framework that makes adding Ajax, animations, and interactive elements to your site a breeze. This would help a lot with web animation, and avoiding building applications in Flash.


Dec 19 2008

Thinkpad x61 with Ubuntu: Getting the 3rd mouse button to work.

There are two different methods I found, which work for different version of Ubuntu.

Ubuntu 8.10

First, copy/paste below

<match key="info.product" string="TPPS/2 IBM TrackPoint">
<merge key="input.x11_options.EmulateWheel" type="string">true</merge>
<merge key="input.x11_options.EmulateWheelButton" type="string">2</merge>
<merge key="input.x11_options.YAxisMapping" type="string">4 5</merge>
<merge key="input.x11_options.XAxisMapping" type="string">6 7</merge>
<merge key="input.x11_options.Emulate3Buttons" type="string">true</merge>
<merge key="input.x11_options.EmulateWheelTimeout" type="string">200</merge>
</match>

Then, make a new file /etc/hal/fdi/policy/mouse-wheel.fdi

sudo vi /etc/hal/fdi/policy/mouse-wheel.fdi

Insert a new line by hitting the letter i
Paste by hitting shift+ctrl+v
Save and quit by typing :wq
Reboot.
That’s it, pretty hard eh?

Ubuntu 7.10

Replace the mouse entry of your /etc/X11/xorg.conf with the following (its a good idea to back up your xorg.conf before making any changes):

Section "InputDevice"
 
Identifier "Mouse1"
 
Driver "mouse"
 
Option "Protocol" "ExplorerPS/2" # IMPS/2 is not recommend for TrackPoints
 
Option "Device" "/dev/input/mice"
 
Option "EmulateWheel" "on"
 
Option "EmulateWheelTimeout" "200"
 
Option "EmulateWheelButton" "2"
 
Option "YAxisMapping" "4 5"
 
Option "XAxisMapping" "6 7"
 
EndSection

Reboot.


Dec 17 2008

X61 Wireless: Fixed

Ok the subject is a little misleading, I didn’t actually fix anything, because nothing was broke to begin with.  I have verified that the problem is not hardware related.  I have a strong belief the culprit was the AccessConnections software.  When I last used the ThinkVantage software updater, it upgraded my AccessConnections software.  After this update, the integrated network adapter just completely stopped working.

As I said before, I tried installing Debian to see if the card was working, unfortunatly I didn’t realize that I was using the stable (old) kernel version, and I needed the newer kernel version to get the correct modules for the network adapter.

I just installed Ubuntu 8.10, and during installation the wireless light lit up, very much like a Christmas tree :-)

So, I didn’t exactly solve the problem, I didn’t really even figure out what the problem was, but I now know what it isn’t, it’s not hardware failure.

I advise anyone having this problem, to either revert to a backup copy before you did any updates.  This is the only thing I can advise at this point.  Or if you’re feeling frisky, go ahead and give Ubuntu a try :-)  Everything should “work out of the box.”

Good luck.  If this post helped you at all please leave a comment, anything will do.
I barely get any comments.

EDIT: http://betweengo.com/2006/10/31/thinkpad-t60-wireless-keeps-powering-off/


Dec 16 2008

America’s Most Wanted’s John Walsh - CASE SOLVED TODAY

I’m in complete awe, 27 years later this case is finally solved.

If you didn’t know, “America’s Most Wanted” TV host John Walsh’s son went missing on July 27, 1981.  Today this case was finally solved.

My deepest condolences to the Walsh family.

Read more here:
Fla. police close books on ‘81 Walsh killing


Dec 16 2008

Great gift idea for Superbad fans!

I happened to stumble upon this at Spencers.  This is a picture book of penis cartoons from the movie Superbad.  Great gift for anyone who is a fan of the movie.

amazon item image

Superbad: The Drawings
Price: USD 11.70
34 used & new available from USD 7.16


Dec 16 2008

More on the x61 wireless problem.

I’m seeing more and more people getting this problem.  I think we all need to make at least stick to the same board, I see too many topics on too many different boards.

Please, if you’re having an issue using your integrated Intel wireless adapter on a ThinkPad x61, I urge you to support this thread and make a post:
http://forums.lenovo.com/lnv/board/message?board.id=X_Series_Tablet_ThinkPads&thread.id=754

Symptoms

  1. I noticed an inconsistency with the device before it started waiving the white flag.  I used my x61 on a docking station at work, and when I brought it home to connect to my wireless network, I noticed that sometimes I would not be able to see any available wireless networks to connect to.  Sometimes I would have to use Vista to repair the network connection.  It would tell me that I had to “click this button to turn on my wireless device,” even though the light was on, even though my switch was on, and even though the device was working properly.  It seems like switching back and forth from a wired to wireless network connection may have played a part.
  2. One day, it decides to just completely stop working.  The light for the device won’t come on, even though the light for the Bluetooth device still comes on (the switch to turn on/off wireless controls both the wireless adapter and Bluetooth adapter.)
  3. Vista sees the device, says it’s working properly, but I can’t access it in the Network Connections dialog.

What I’ve tried so far

  1. Updating software via Vista updater.
  2. Updating software via ThinkVantage updater.
  3. Uninstalling/Reinstalling drivers for the Intel wireless adapter.
  4. Disabling/Enabling the Wireless LAN setting in BIOS.
  5. Reset all default settings in BIOS (don’t do this unless you know what you’re doing.)
  6. Installing another operating system (Debian, stable.)

Dealing with the problem in Linux

I’m no Linux guru, but I needed to confirm that this wasn’t another one of those “Vista is screwing with my hardware,” problems.  I’ve installed Linux on the x61 before, wireless worked out of the box, this time it didn’t.  I brought my machine over to the LUG/IP HW-SIG meeting to see if I could get any expert help with this issue. Vinko helped me me out as much as he could with the time left in the meeting.  I noticed that the operating system at least saw the device, and knew information about the device, but it wasn’t working.  I asked Vinko if that meant if this would rule out a hardware failure, it doesn’t.  Vinko manually installed the module/drivers for the device, and that’s where we left it off at.  This will be continued when more information is gathered.

My hypothesis

I read many of times about how people are complaining about the heat generated from this card.  That spot where your right palm/wrist sits, is basically where the wireless network adapter is located.  It either generates an abnormal amount of heat, or we are just feeling a all the heat that we shouldn’t be feeling because of a poor case design… Who knows.  I couldn’t tell you how much heat this device is supposed to generate, nor could I tell you how much heat my device is actually generating.  I barely noticed it, because I use external peripherals (wireless mouse/keyboard.)  Could this device malfunctioned due to overheating?  I don’t really know for sure, I’m not a hardware expert anymore, but I don’t think it’s something to completely rule out.  Could my operating system still see a working device, even though the device might have a hardware failure?  I believe so, it depends on what happened really.


Dec 11 2008

Delicious for WordPress Plugin - W3C Validation Error: Fixed

I keep almost all my bookmarks at Delicious (formerly del.icio.us.)  So I noticed there is a Wordpress plugin to display your Delicious bookmarks.  One of the things I do after I add a new plugin to WordPress, is to validate a page using The W3C Markup Validate Service.  I noticed that my markup was now invalid, but it wasn’t really because of the plugin itself.  The errors were caused because some of my Delicious bookmarks have predefined ampersand characters, and the plugin did not replace these with HTML entities.  I first tried replacing my bookmark titles in Delicious, but that just screwed up my titles (I always go for the easy way first.)  So it’s time to start editing sources again…

What we need to do to fix this is really quite simple, find the string that stores our bookmark title, and replace the predefined characters with HTML entities.  While looking for the best method to do this using PHP, I found a function that I never knew about before.  There’s actually a nice PHP function to do this: htmlspecialchars()

Certain characters have special significance in HTML, and should be represented by HTML entities if they are to preserve their meanings. This function returns a string with some of these conversions made; the translations made are those most useful for everyday web programming. If you require all HTML character entities to be translated, use htmlentities() instead.

This function is useful in preventing user-supplied text from containing HTML markup, such as in a message board or guest book application.

Perfect, this is what we’re going to use.  So let’s find that string now…

Open delicious.php and go to line 74:

73
74
75
76
77
foreach ( $bookmarks-&gt;items as $bookmark ) {
$msg = $bookmark['title'];
if($encode_utf8) utf8_encode($msg);
$link = $bookmark['link'];
$desc = $bookmark['description'];

So we’re going to take line 74 and change it to this:

73
74
75
76
77
foreach ( $bookmarks-&gt;items as $bookmark ) {
$msg = htmlspecialchars($bookmark['title']);
if($encode_utf8) utf8_encode($msg);
$link = $bookmark['link'];
$desc = $bookmark['description'];

Quite simple, now we’re back on the right track :)


Dec 9 2008

FSC - Fire Safe Cigarettes

If you didn’t already know, our cigarettes are changing (most have already changed.)  Take a look at your pack of cigarettes, find the UPC bar code on it and check to see if it has “FSC” written over it.  If it does, you have just bought yourself a pack of Firesafe cigarettes.  Most of the cigarettes in the U.S. are already changed, and there’s pretty much nothing you can do about it.  They are to prevent fires (go figure) by the cigarette self-extinguishing if it is not being smoked.  Basically, if you don’t smoke it, it will go out.  I think the idea is good, however the method, in my honest opinion, sucks.  There are a few differences I’ve noticed over the past 6 months.

Fire starting cigarette

That’s right, this thing starts fires.  I’m sure all you dedicated cancer stick loving fiends know that when you go to tap on your cigarette, that if you tap too hard the lit end (cherry) will pop off.  Well, this happens a lot more often with these new cigarettes.  For some reason it burns funny when exposed to wind, causing either the paper to burn before the tobacco, or vice-versa.

Scenario:  Your driving along, smokin’ a stick with the windows cracked about an inch.  You go to tap out your cig in the ash-tray and guess what happens?  The lit end pops off.  Where does it go?  Maybe if you’re lucky it will land straight into the ash-tray, maybe not (several times now has the lit end of my cigarette popped off onto myself, and my car floor.)  Will the cherry go out?  No, sorry.  It’s just the paper on the cigarette that has those bands to extinguish the cigarette, not the actual tobacco.  So your screwed, you try to put the cherry out before your car turns into a flaming ball from hell, causing you to crash, and die.

Can this happen?  I think it’s likely to happen.  Like I said I’ve already had close encounters dealing with a cherry popping off, it’s only a matter of time.

Taste

Who the hell do you think you are screwing with my cigarettes?  Where do you get off?  If I’m smoking cigarettes, I’m probably more likely to die from cancer than passing out, dropping a lit cigarette (starting a fire), and then burning in that fire (or inhaling too much of the ‘bad’ smoke), and die.  You’ve changed the taste of my cigarette, and don’t even try to deny it.  New Jersey switched over before Pennsylvania (PA is now FSC), and I had my share of both.  Damn right they taste different.  So let’s be honest, there’s a little more than 3 little bands in my cigarette.  I taste the different from start to finish, don’t play us for fools.

Toxins

Are they more harmful?  Do I care?  In all honesty, if you’re already smoking cigarettes you probably don’t give a shit whether a firesafe cigarette is going to do more harm to your body than a pre-FSC would.  To answer my question, no, I don’t care if they are more harmful.

Solution

There’s only one possible solution I could think of, choice.  Give us the choice to buy a fire safe cigarette.

References

Want to read more about how are our cigarettes are now a pain to smoke?  Sure…

Coalation for Fire-Safe Cigarettes

The Petition