awesome

mnemonic.

Today I had to wire up some Category 5e ethernet cabling. I’ve had to do this since I started working in IT but every time I’ve had to resort to looking up the TIA/EIA586B spec via Wikipedia to get the wiring correct.

I’m kind of sick of this, so I came up with a mnemonic to remember it. I’ve seen one but it involved boobies so it’s not really suitable for a work environment. Well, most, anyway.

You have to remember 2 things though:

1. Each pair consists of a Colour/White strand and a White/Colour strand. The Colour/White strands (pins 2,4,6,8) are in UPPERCASE, and the White/Colour strands (1,3,5,7) are in lowercase.
2. Both Blue and Brown start with the letter B, so for Brown I use the letter ‘R/r’, being the second letter. Blue has no letter R so this avoids ambiguity.

If we take o=Orange, g=Green, b=Blue, r=bRown, this gives us:

o O g B g G r R
1 2 3 4 5 6 7 8

If we split this into even/odd pins, we get

o g b r for the odd pins
O B G R for the even pins

The mnemonic is:

our good boys run Over Bloody Great Rails

So next time you have to hand crimp some Cat5e just say this to yourself, and remember the first 4 are the odd pins and the last 4 are the even ones.

Bear in mind this is only valid for TIA/EIA586B. For non-PoE A/B crossover cable, just swap the Green and Orange pairs round at one end. I haven’t thought of a mnemonic for this one yet, though, so you’re on your own. A word of warning though! This will only work for data-only Cat5e — you risk seriously damaging your kit if you run Power over Ethernet or phone signals through this kind of crossover cable. Something tells me that your average onboard Ethernet chipset will not appreciate having 48V DC shoved up its backside.

Remember, with the advent of widespread support for Auto-MDIX there is often no need to run x-over cabling at all and just using straight B-B cabling is the best idea unless neither of the PHYs on either end support auto-MDIX.

hackers.

Go up to a random person in the street. Ask them what a “hacker” is, and 9.9 times out of 10, they will say “someone who hacks into computers/steals your personal data/gives you viruses”.

The popular press has done nothing to help this, every other week in some red-topped tabloid there’s a story claiming “Hackers break into x”, but the thing is –

We aren’t the ones breaking into your bank account and siphoning off money for their own personal gain. The names for the people who do that kind of stuff are “computer criminals”, “Nigerian 419ers” and many other terms, but not hackers. For this we have only mass media to blame, people believe what they see on TV and, unfortunately, take it as gospel.

A hacker is someone who hacks things. Hackers wrote Apache, the software this blog is running on, because many people added “hacks” to make Apache better. Hackers wrote ModSSL/OpenSSL as a “hack” to Apache, without which you wouldn’t be able to conduct secure purchases online.

So for those of you still unconvinced, I urge you to watch a documentary called “Hackers are People Too”, by Ashley Schwartau, a Def/Toorcon regular and somewhat talented film-maker. It portrays us in a light that the general public usually don’t see us in, which is a welcome change.

[youtube=http://uk.youtube.com/watch?v=x3lrhCuofqw]

Remember guys: Hug a hacker today! =3

seven.

(As we all know, the final turned out somewhat different. Still, an improvement over Vista, was it not? :) )

I’m going to do something very, very unexpected here.

In contrast to my previous post, I’m going to praise Microsoft.

I finally got round to installing the WinHEC 6801 build of Windows 7 last night, and… well, compared to the same stage in Vista’s dev cycle, it’s a stunner. It’s what I would call “Vista Done Right”.

You heard that right. Keep reading….

Continue reading

asterisk.

After hearing about Asterisk for the millionth time I finally decided to take the leap from boys’ VoIP (Skype) to mens’ VoIP by setting up my own PBX. It took a couple of days for me to learn the basics, but this page will detail my adventures with the *.

My extensions.conf is available here.

Slashdot RSS Feed Reader (ISN 7001*939 / sip:slashdot@sip.uberpipe.co.uk)

Ext 7001 Pri 1
PHP script fetches RSS feed from /., each line is the innerXML from the //ITEM[]/TITLE tag from the RSS feed, with the word “break” appended to each line to signify EOL (otherwise, sentences would run together as the feed gets read to the listener). This is the passed into Flite‘s standard input for speech synthesis.

The get_slashdot_news.php script looks like this (very simple):

<?
        $sd_rss_feed = "http://rss.slashdot.org/Slashdot/slashdot";
        $sd_sxml = new SimpleXMLElement(file_get_contents($sd_rss_feed));
        foreach($sd_sxml->item as $item){
                $outstr .= $item->title . ". break.rn";
        }
        echo $outstr;
?>

The output looks like this:

cmn@ubercdn-tcsov:/etc/asterisk$ php /usr/share/agi-scripts/get_slashdot_news.php
BBC's Open Player Claims Not Followed Through. break.
Debian's Testing Branch Nears Completion. break.
reCAPTCHA Hard At Work, Rescuing Fading Texts. break.
Netflix Woes Mean a Gap In Shipments. break.
Using Photographs To Enhance Videos. break.
What Will Linux Be Capable Of, 3 Years Down the Road?. break.
30% of Americans Want "Balanced" Blogging. break.
Slashdot's Disagree Mail. break.
Violent Video Gaming Comes To the Wii. break.
Slashdot Announces Idle Section. break.
Americans Refusing To Wait For Mainstream EVs. break.
The Evolution of Sega. break.
Literacy Bridge Founder Answers Your Questions. break.
Psystar "Definitely Still Shipping" Mac Clones. break.
Intel Releases USB 3.0 Controller Interface Spec. break.

extensions.conf:

exten => 7001,1,System(php /usr/share/agi-scripts/get_slashdot_news.php | flite - /tmp/sdnewsout_tmp.wav)

Ext 7001 Pri 2

Output from fLite is encoded using Sox. GSM and uLaw/aLaw voice codecs only carry voice in 1 channel 8kHz 16bit SBC/SL, whereas the output from Flite is 16kHz unsigned 16-bit PCM. Also specified was a 45-bit sampling window (-qs; see man sox) so that Sox would resample the file in the quickest possible time at the expense of stop-band rejection accuracy (very high/low frequencies can “leak” into the passband, accounting for some wierd artefacts from time to time).

extensions.conf:

exten => 7001,2,System(sox /tmp/sdnewsout_tmp.wav -r 8000 -c 1 -s -w /tmp/sdnewsout.gsm resample -ql )

Ext 7001 Pri 3 & 4

The final resampled .gsm file is finally copied into Asterisk’s sound library in /var/lib/asterisk/sounds/, and then played to the caller via Asterisk’s Playback() application.

extensions.conf:

exten => 7001,3,System(cp /tmp/sdnewsout.gsm /var/lib/asterisk/sounds/)
exten => 7001,4,Playback(sdnewsout)

Hmm, looking at the feeds (on the sidebar of this page) I want to do a Twitter version now. This could be quite awesome.