Javascript CapsLock check (show)  

Ever need to check the status of the CapsLock key for a form? Don't want a user to accidentally enter their password with the CapsLock key on and get frustrated when it doesn't work.

I wrote a quick mockup to show an alert on a form when the capslock key is turned on when entering form data.
Leave A Reply

Linux bridging ethernet interface (show)  

I needed to make a bridging interface for some KVM work I was working on. Here's how to make a bridge interface in Fedora. First you have to turn your raw eth0 interface into a bridge with a new interface (br0) that you create. Then you assign IP information to the new bridge interface either statically or via DHCP.

Code:

#/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
DELAY=0
BRIDGE=br0

Code:

#/etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
BOOTPROTO=none
ONBOOT=yes
TYPE=Bridge
IPADDR=1.2.3.4
NETMASK=255.255.255.192
DNS2=65.182.224.50
GATEWAY=1.2.3.255
DNS1=65.182.224.40
IPV6INIT=no
USERCTL=no
PREFIX=26

Note: you will need to disable Network Manger for this to work properly.
Leave A Reply

Browser + Ogg Theora support (show)  

The following browsers support the HTML5 <video> tag with Ogg Theora video support. In other words, every modern browser except Internet Explorer.

Firefox 3.5
Opera 9.52
Google Chrome 3
Safari 3.4
Leave A Reply

Internet Explorer 8 (show)  

Keeping the web safe for everyone.

Leave A Reply

Advertising During The Simpsons More Expensive on Hulu than TV (show)  

It costs more per second to advertise on Hulu than it does on brodcast TV now. That's a pretty serious change.
Leave A Reply

YouTube h.264 vs Theora (show)  

Software philosophies aside this comparison seems like a pretty good argument in favor of Theora on YouTube.
Leave A Reply

Linux + Quad Nic (show)  

Just setup Fedora 10 with an Adaptec ANA62044 network card. It worked flawlessly out of the box. I now have 7 ethernet ports in that machine.

Code:

07:04.0 Ethernet controller: Adaptec ANA620xx/ANA69011A (rev 03)
07:05.0 Ethernet controller: Adaptec ANA620xx/ANA69011A (rev 03)
07:06.0 Ethernet controller: Adaptec ANA620xx/ANA69011A (rev 03)
07:07.0 Ethernet controller: Adaptec ANA620xx/ANA69011A (rev 03)
Leave A Reply

Linux + 8 Port Serial Devices (show)  

We purchased an Edgeport 8 port serial to USB adapter. We'll use these to console into various network gear from one central location. I wasn't sure how well they'd work in Linux but they work flawlessly. My Fedora 10 box detected it right away, and created the /dev/ttyUSBX adapter instantly. Pretty simple to setup and use.

Code:

May 11 16:23:21 localhost kernel: usb 1-1: new full speed USB device using uhci_hcd and address 4
May 11 16:23:21 localhost kernel: usb 1-1: configuration #1 chosen from 1 choice
May 11 16:23:21 localhost kernel: io_edgeport 1-1:1.0: Edgeport 8 port adapter converter detected
May 11 16:23:21 localhost kernel: usb 1-1: Inside Out Networks Edgeport/8 detected
May 11 16:23:21 localhost kernel: firmware: requesting edgeport/down.fw
May 11 16:23:22 localhost kernel: firmware: requesting edgeport/boot.fw
May 11 16:23:22 localhost kernel: usb 1-1: Edgeport 8 port adapter converter now attached to ttyUSB0
May 11 16:23:22 localhost kernel: usb 1-1: Edgeport 8 port adapter converter now attached to ttyUSB1
May 11 16:23:22 localhost kernel: usb 1-1: Edgeport 8 port adapter converter now attached to ttyUSB2
May 11 16:23:22 localhost kernel: usb 1-1: Edgeport 8 port adapter converter now attached to ttyUSB3
May 11 16:23:22 localhost kernel: usb 1-1: Edgeport 8 port adapter converter now attached to ttyUSB4
May 11 16:23:22 localhost kernel: usb 1-1: Edgeport 8 port adapter converter now attached to ttyUSB5
May 11 16:23:22 localhost kernel: usb 1-1: Edgeport 8 port adapter converter now attached to ttyUSB6
May 11 16:23:22 localhost kernel: usb 1-1: Edgeport 8 port adapter converter now attached to ttyUSB7
May 11 16:23:22 localhost kernel: usb 1-1: New USB device found, idVendor=1608, idProduct=000f
May 11 16:23:22 localhost kernel: usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=5
May 11 16:23:22 localhost kernel: usb 1-1: Product: Edgeport/8
May 11 16:23:22 localhost kernel: usb 1-1: Manufacturer: Inside Out Networks
May 11 16:23:22 localhost kernel: usb 1-1: SerialNumber: V13621972
Leave A Reply

JQuery parsing XML (show)  

JQuery doesn't support parsing XML with it's selector engine, even though it works most of the time. Apparently every browser except IE does a passable job of parsing XML using their built in parsers. IE requires an Active-X control to parse XML which is unreliable as Active-X is often disabled in corporate environments. I wrote up a quick test case to show this flaw. I never found a work around for parsing XML from a string, but with AJAX you just have to make sure your XML is served with content-type: text/xml and you get an XML object instead of a string. This JQuery can parse, even in IE.
Leave A Reply

List the open files of a certain process (show)  

If you want to list the files that are opened by a specific process:

Code:

lsof -p 12345
Leave A Reply

Oregon Narwhals (show)  

As a joke Dan posted the following text on Wikipedia, it was removed within 10 minutes.
A very rare breed of Narwhal has been spotted off the coast of Canby Oregon. Once thought to only be native to the saltwater of the arctic regions, these creatures have mutated and learned to adapt to freshwater climates. Scientists believe that the reason for these new mutations is due to the heavy pollutants of the Willamette River. It has caused them to become larger and much more in touch with the "Force" than their saltwater cousins. Due to the recent siting of these rare creatures, Canby has established "Narwhal Awareness Week" in order to educate the town about these magnificent creatures. Oceanographers strongly caution that if anyone encounters an Oregon Narwhal, do not approach it. They are known to be very aggressive and can take a polar bear in a fight. If attacked by an Oregon Narwhal, then it would be best to cover the genital region since that is what they usually attack. If they touch your balls then seek medical attention immediately.
Leave A Reply

SQLite index usage (show)  

To check if your SQLite query is using an index or not do:

Code:

EXPLAIN QUERY PLAN SELECT * FROM Table WHERE ID = 12;

and look for USING [IndexName]
Leave A Reply

Cisco transfer protocols? (show)  

How long has Cisco supported new transfer methods? scp? https? That along with USB ports on modern routers makes getting images on to routers easier than ever.

Code:

Router#copy ?
  /erase          Erase destination file system.
  /noverify       Don't verify image signature before reload.
  /verify         Verify image signature before reload.
  archive:        Copy from archive: file system
  bootflash:      Copy from bootflash: file system
  cns:            Copy from cns: file system
  disk2:          Copy from disk2: file system
  ftp:            Copy from ftp: file system
  http:           Copy from http: file system
  https:          Copy from https: file system
  ips-sdf         Copy from current IPS signature configuration
  null:           Copy from null: file system
  nvram:          Copy from nvram: file system
  pram:           Copy from pram: file system
  rcp:            Copy from rcp: file system
  running-config  Copy from current system configuration
  scp:            Copy from scp: file system
  startup-config  Copy from startup configuration
  system:         Copy from system: file system
  tar:            Copy from tar: file system
  tftp:           Copy from tftp: file system
Leave A Reply

50% percent randomness (show)  

Needed a quick random bit in Perl.

Code:

my $rand = int(rand() * 2);
Leave A Reply

Deleting all the Postfix queue mail (show)  

I had a server that Postfix wasn't running on, but had 8500 old emails in the queue. I needed to remove them since they weren't relevant anymore.

Code:

postsuper -d ALL
Leave A Reply - 1 Reply