Search This Blog

Thursday, September 2, 2010

Dead AB Micrologix 1000

When an operator replaced a blown 2/10th amp fuse with a 20 amp one, eventually some device is going to have a bad day - in my case it was an Allen Bradley Micrologix 1000 PLC.  After repeated failed attempts to find a replacement PLC from the now defunct OEM and knowing absolutely nothing about PLCs, a local engineering firm quoted $8000 to enter in about 100 rungs of ladder logic into a new PLC.  I'm desperate but I'm not willing to be taken advantage of.  Regretfully, they declined my counter offer of $1500.  So, I purchased the same PLC off ebay for $99 and was determined to take a stab at programming it using AB's free version of RSLogix called RSLogix Micro Starter Lite (v8.10).  Even with the ladder logic printed in the back of the machine manual I realized this was over my head.  So I took a stab at swapping the power supplies (which is the bottom board).  Yeah, it worked.  Why didn't we think of that in the first place?  The top board (where the firmware and logic is) was obviously spared from the (lightning?) damage.  I went ahead and purchased a serial cable and downloaded the ladder logic from the PLC into an .rss file for safe keeping.  So why $8000? Does having a EE degree gives you a license to rip people off?  Turns out that even $1500 may be too cheap to do what I done for $99 even when the code is already provided in printed form.  One PLC guy recently told me he got out of the automation field and into the IT field because of liability insurance costs of $50,000 was prohibitive.  Because PLCs typically start/stop/run heavy equipment, insurance companies claim high risk exposure of personal injury.  So he's sticking to the IT industry where $500 liability costs are palatable.  
 

Monday, May 10, 2010

Dimension E510 runs a Pentium D 945

My Dell Dimension E510 with the 945P chipset has been very reliable.  So I decided to swap out to a faster LGA775 Presler processor on the mobo.  After some researching, I found out from others that the faster 950,960,etc Pentium D's didn't work so I choose the SL9QB Pentium D 945 (3.4Ghz/4M/800/65nm).   According to http://www.cpubenchmark.net/cpu_list.php (as of today), the processor ranks #445.  Not impressive - I know.  However, coming from a #511 ranked SL88T Pentium D 820 (2.8Ghz/2M/800/90nm),  it definitely feels snappier thanks to its double L2 cache size.  Nonetheless, this $80 upgrade will probably postpone a newer expensive PC upgrade for a couple years.  Deal.
 

Friday, March 19, 2010

Where is net view for linux? How about nmbscan.

Had a customer incident where Network Neighborhood came up empty for the
whole network. Everyone could see no one! Marco! Polo! I ssh'd into their RHEL box and
tried to find out how to scan the network for NMB netbios shares. The
nmbclient command was installed but I wasn't sure how to use it. Fortunately
I found a wrapper program for nmbclient called nmbscan:
http://nmbscan.gbarbier.org/

# nmbscan -a

This showed me a master brower called "ROBIN" out there and not much else.
I told the sysadmin to shut down ROBIN. Re-running nmbscan then showed us a
ton of machines and people's network neighborhood browsing came to life.
Perhaps a virus was able to self-elect ROBIN as browse master and then
poisoned the nmb name cache - dunno.

Wednesday, August 5, 2009

Curl's epsv broken when upload file via ftp.

Passive mode just wasn't good enough so engineering thought extended passive mode would fix something I had no clue was broken. However curl (the swiss army knife of moving web data around) didn't exactly implement it correctly.

To get the passive ftp uploads to work, you might have to use the
--disable-epsv
switch twice!!

curl --data-binary --disable-epsv --disable-epsv -v -u user123:mypasswd -T "myfile.tab" ftp://ftp.xyz.com/uploads/

Something is broke in curl's arg routine but this works for me. So try this if you're getting stuck with at "229 Entering Extended Passive Mode".

Thursday, July 30, 2009

Loading MySQL data via stdin

Here's a handy trick to put in a cron script to automate importing of data into mysql. As long as the tab delimited fields are in the same order as your mysql table columns, you can pipe data directly into it with LOAD DATA LOCAL INFILE '/dev/stdin'. This eliminates the need for an intermediary file - unless you're dealing with millions of rows, then a intermediary file might be neccessary.

/usr/bin/dump_customers | sed 's/abc/xyz/g' | mysql -u impy -pSeCrEt -e"use mydb; DELETE FROM customers; LOAD DATA LOCAL INFILE '/dev/stdin' REPLACE INTO TABLE customers FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n'"

I injected a simple sed search and replace in order to hotfix some data. Also note, that dates need to be in the format of YYYY-MM-DD.

Wednesday, February 4, 2009

The irony of our 44th President

I've heard this video was banned by NBC during the 2009 Superbowl commercials. It wouldn't surprise me. Now, this man pandered to Planned Parenthood in 2006 (see youtube for that appalling fundraiser speech). What's so sickening is that to Mr. Barack Hussein Obama a pregnant woman is not a mother. Since you're just a woman, you don't have a "mother's choice", you have a "woman's choice". He spins the words 'newborn baby' in a good light by giving "mothers" more than a 3 mo. maternity break. He fails to mention the 'unborn babies' in the other light. Obama's ideological argument is that abortions are needed for sustained resources for chosen people. His ideology is to allow women to kill their babies in order to avoid "a lifetime of struggle" and to increase her chance to receive the "same opportunities" as men. Obama briefly mentions that his church (Trinity - United Church of Christ) and others of faith can not ignore that "abstinence is an ideal but not reality". With his faith hat on, his argument for better education is admirable. But he doesn't keep this hat on and state the sinful nature of abortion. He is a master panderer. He's never pondered why 'two wrongs don't make a right'. He's purely bought into the legalized murder ideology. His "can't do / won't do" argument against the Bush administration is pure childishness. If you're a pro-life individual, the applause of that 2006 speech will sicken you. And the great irony of his pro-abortion stance is perfectly exemplified by this video - notice the smile. Sign. After a deep breathe, I'll still pray for the man and his like-minded agents. If I was on the left side of the abortion issue, I'd most certainly be rocked by John Piper's plea: http://www.youtube.com/watch?v=kdnQAB3cJec I don't think I could let that go unanswered - man up.

Thursday, January 15, 2009

DS Lite won't turn on - Loose Inductor

If you have a Nintendo DS Lite which charges but will not turn on and you hear something rattling inside, then it's probably a loose electronics part. It's a small cube that's black with two silver sides. This L2 inductor seems to be a frequent cause of dead Nintendo DS Lite units. The repetative depressing of the 'A' button seems to stress the board opposite of this small cube inductor which is located next to the power switch. Under a magnifing glass you should see glue residue on one side of the cube which gives you a clue as to which side goes down and in which direction. Like putting a broken ceramic piece back in place, try placing the inductor back in it's same orientation, as it will make a tight fit between the two broke L2 posts. Re-add a very tiny drop of clue to hold the inductor in place. Then do a quick touch-up of the solder points using your favorite gun - I used a Cold Heat soldering tool. User a pencil erase to firmly press down on the inducter before soldering - this will insure a better PCB contact. The DS should turn on once again. You can hold the battery in place manually to test it before putting it all back together. Note that you'll need a small tri-wing "security bit" screw driver. These are sold online by gaming shops but I would recommend Harbor Freight Tools to get your own precision screwdriver set.

Wednesday, October 29, 2008

TAB2XML awk script

This is a one level deep conversion from a tab file to xml.  So you have to manually change "catalog" and "sku" to your likings.
 
<code>
awk -F'\t' '
BEGIN { printf("<catalog>\n"); }
NR==1 {
for ( i=1 ; i<=NF ; i++ )
 name[i] = $i;
}
NR>1 {
 printf(" <sku>\n");
 for ( i=1 ; i<=NF ; i++ )
   printf("  <%s>%s</%s>\n",name[i],$i,name[i]);
   printf(" </sku>\n");
 }
END { printf("</catalog>\n"); }
' inventory.tab > inventory.xml

</code>
 

Thursday, June 5, 2008

Firmware Flashing a Digi Etherlite 32

After compiling the dgrp kernel module I needed to update the firmware of an Etherlite 32:
1. Power down the Etherlite
2. # /usr/sbin/dgipserv -erase <MAC> <IPADDR_OF_ETHERLITE>
3. Power up the Etherlite.
4. Make sure the dhcpd and tftp is not running.
5. # chkconfig dhcpd off; chkconfig tftp off
6. This was what was throwing me off - I thought I had to pre-configure additional linux bootp/tftp services which you don't.  The dgipserv command serves up it's own bootp and tftp services which is convienient.. 
7. Power down the Etherlite
8. # /usr/sbin/dgipserv -tftp <IPADDR_OF_SERVER> -firmware /tftpboot/800007009_E.bin <MAC> <IPADDR_OF_ETHERLITE>
9. Power up the Etherlite.
10. You should have a "Firmware successfully uploaded."
11. Power down the Etherlite
12. Now we need to make the ip settings permanent.
13.  # /usr/sbin/dgipserv -store -gateway <IP_GATEWAY> -netmask <IP_MASK> <MAC> <IPADDR_OF_ETHERLITE>
14. Power down and back up the Etherlite to make sure the new ip address stuck this time.
 
Note: I could never get rlogin to work with my etherlite, so I can't tell what the current firmware version was/is.

Tuesday, June 3, 2008

Humbled by the SC440 and SAS 5/iR controller on CentOS 5.1

Why isn't Dell's SAS Raid Storage Manger clueing me into whats wrong?

Let me back up and ask this: Since, the kernel is gratiously working a controller, are there not any generic commands that query the SAS subsystem to report back overall statuses of hard drives and raids? I'm not a kernel programmer, but I just can't understand why you put all the effort into writing a driver which natively works with the kernel, and linux doesn't give you a way to inspect the most basics of information other than the spartan:

# cat /proc/scsi/mptsas/0
ioc0: LSISAS1068, FwRev=000a3300h, Ports=1, MaxQ=286

So, last ditch effort, I updated the bios and firmware on the SC440 and SAS 5/iR controller, and reinstalled Dell's SAS Raid Storage Manger v2.16-01 for RHEL5. Still no luck - "No Storage Controller Found!".

Bryan Mclellan told me I need to make sure the mptctl module was loaded - he was right.

I added "modprobe mptctl" at bootup according to these instructions:
http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/sysadmin-guide/s1-kernel-modules-persistant.html

Now, not only does the Dell SSM (aka LSI's MSM) software sees the controller, also a nifty tool called mpt-status (http://www.drugphish.ch/~ratz/mpt-status/) works as well:

# ./mpt-status
ioc0 vol_id 0 type IM, 2 phy, 135 GB, state OPTIMAL, flags ENABLED
ioc0 phy 1 scsi_id 32 SEAGATE ST3146755SS T107, 136 GB, state ONLINE,
flags NONE
ioc0 phy 0 scsi_id 1 SEAGATE ST3146755SS T107, 136 GB, state ONLINE,
flags NONE

Now, IMHO, mpt-status is the kind of utility that should be a part of the
SAS subsytem commands and also give clues as to what drivers aren't loaded.
I'm not neccessarily looking to *control* every proprietary controller with
one utility, but at least be able to monitor the status of any controller
with on command across all manufactures. Imagine a different ls command for
Dell, HP, IBM, etc....