Review: Tidy your carry via the Grid-It

I came across this nifty invention while browsing the ScotteVest website (really cool gear on that site too btw) and thought, this Grid-It is some seriously some cool piece of shit! Unfortunately it was out of stock so in my urgency to get it ASAP ended up buying it from Flight 001 Australia. Took 3-4 days to arrive in the mail, and here I am with a quick review – this is for you HJ.

Note: I ordered the Medium Grey version (had enough of black for everything), measurements are 30.5cm x 20.5cm x 1cm (according to the Flight 001 product page).

How it looks like with all my work stuff on:

Here’s a full list:

  • 2 Philips screwdrivers
  • 1 Cisco console rollover cable
  • 1 serial-to-USB adapter (allow laptop to use rollover cable)
  • 1 pair of small pliers
  • 1 Ethernet cable
  • 1 Apple power adapter for work iPhone
  • 1 flash drive (hidden near the Apple cable, see if you can notice it)
  • 1 pen
  • 1 paperclip

As you can see there’s plenty of straps left to stuff other bits and pieces, not to mention the big unused zip compartment on the reverse side. Figuring out how to best efficiently stick all your stuff into the Grid-It is oddly enough, kinda fun in itself.

Post Grid-It: I would say the medium Grid-It is good enough for a typical laptop bag. My bag is currently left with many empty pockets which feels a bit weird, but I guess that’s the whole point! Very convenient if you are looking to switch bags since you can empty most of your stuff by removing the Grid-It. Also prevents all that conventional digging around in the bag for that thing you know “must be inside.. SOMEWHERE“. Make life easier for yourself, use Grid-It.

Might post a more detailed review after a few weeks of use if anyone’s interested, but this is it for now.

Cisco MRTG temperature graphing with the 7200 router

In a way, this post is a sequel to the previous MRTG tutorial I wrote. Then again, it’s slightly more specific towards the Cisco 7200 series router, so it wouldn’t be as applicable to everyone. If you are interested in graphing Cisco MRTG temperature though, read on.

Once again the disclaimer follows – I’m using Debian distribution 2.4.18-bf2.4.


#1 Knowing what’s good and what’s not

It’s not very useful to know the temperature if you don’t know what you’re looking out for.

Ambient operating temperature: Cisco advises a minimum of 32°F (0°C) and maximum of 104°F (40°C). 40 degrees Celsius doesn’t sound like it’s enough to cook the router though.

If we check the table displayed in our router’s CLI by going into exec mode:

Router#show environment table

We get:

Sample Point LowCritical LowWarning HighWarning HighCritical
I/O Cont Inlet 40C/104F 50C/122F
I/O Cont Outlet 43C/109F 53C/127F
NPE Inlet 75C/167F 75C/167F
NPE Outlet 50C/122F 60C/140F

Seems to be a wee bit higher than what the website said? Oh well, I guess it’s a good thing.


#2 Checking your router’s temperature the quick and easy way

Login to your router (telnet, console whatever) and go into exec mode.

Router#show environment all

I believe the display differs according to the NPE (Network Processing Engine) you’ve got, but this is what mine says.

Power Supplies:

Power Supply 1 is Zytek AC Power Supply. Unit is on.
Power Supply 2 is Zytek AC Power Supply. Unit is on.

Temperature readings:

I/O Cont Inlet measured at 25C/77F
I/O Cont Outlet measured at 27C/80F
NPE Inlet measured at 28C/82F
NPE Outlet measured at 29C/84F

Voltage readings:

+3.45 V measured at +3.50 V
+5.15 V measured at +5.25 V
+12.15 V measured at +12.39 V
-11.95 V measured at -11.85 V

Envm stats saved 94 time(s) since reload

The bolded section’s what we want, period.


#3 Using MRTG to plot your router’s temperature

Takes a bit more effort, but at least you’ve got some historical data to rely on for comparison. Plus, you don’t have to keep logging into your router to check!

We can’t use cfgmaker this time round as it takes a bit of typing to get things done.
Here’s a sample .cfg template of what I used:

Target[router.temp]:1.3.6.1.4.1.9.9.13.1.3.1.3.1&1.3.6.1.4.1.9.9.13.1.3.1.3.2:CommunityName@RouterIP
Directory[router.temp]: temperature
WithPeak[router.temp]: wmy
YLegend[router.temp]: Degrees C
ShortLegend[router.temp]: °C
MaxBytes[router.temp]: 50
Options[router.temp]: nopercent, growright, gauge
Unscaled[router.temp]: dwmy
AbsMax[router.temp]: 50
Title[router.temp]: Router
Colours[router.temp]: GREEN#00eb0c,BLUE#1000ff,BLUE#1000ff,VIOLET#ff00ff
Legend1[router.temp]: Average 1 minute Inlet Temperature
Legend2[router.temp]: Average 1 minute Outlet Temperature
Legend3[router.temp]: Average 5 minute Inlet Temperature
Legend4[router.temp]: Average 5 minute Outlet Temperature
LegendI[router.temp]:  Inlet:
LegendO[router.temp]:  Outlet:
PageTop[router.temp]: <H1> Router temperature - Degrees C<BR></H1>
<TABLE>
<TR><TD>System:</TD><TD>Router</TD></TR>
<TR><TD>Maintainer:</TD><TD>Admin</TD></TR>
</TABLE>

There’s actually four points of temperature measurement for the 7200, but since we only need two for the MRTG, I used the inlet temperature and one of the outlets, which makes more sense than checking the temperature of two outlets.

OIDs for the four points are as follow:


Inlet .1.3.6.1.4.1.9.9.13.1.3.1.3.1
Outlet 1 .1.3.6.1.4.1.9.9.13.1.3.1.3.2
Outlet 2 .1.3.6.1.4.1.9.9.13.1.3.1.3.3
Outlet 3 .1.3.6.1.4.1.9.9.13.1.3.1.3.4

Follow up with the usual steps to creating the index and populating the cron job (refer to my previous MRTG article), and we should be done.


Credits for the solution goes to a whole ton of Googled results, and I sort of lost track along the way after reading numerous websites. One of the major help sites is the MRTG mailing list, and the people there are seriously good.

I hope this post helps some other poor soul out there who’s trying to do the same thing, and here’s to you saving two hours of research on doing up a Cisco MRTG temperature graph for your router.

Tech: 10 tips for FreeRADIUS server configuration

I had the pleasure (read: gruelling chore) of setting a RADIUS server up from scratch a few weeks ago. All in all it was an educational experience, to say the least. To anyone else who’s interested, here’s a rough troubleshooting guide incase you get screwed and start screaming “WTF WHY IS IT NOT WORKING!!!”

Scope of installation: to setup an authentication server in a LAN environment NAT-ed to a public internet address, that authenticates against user info in database and logs session data to database as well.

*I am assuming a basic knowledge of bash, and that you know how to edit files with vi or any other editor in the command line interface.

Packages used:

  • FreeRADIUS 1.1.3
  • MySQL 5.0.32-Debian_7etch8-log
  • Linux version 2.6.18-6-686 (Debian 2.6.18.dfsg.1-23)

Optional packages if you want to install dialupadmin:

  • Apache
  • PHP

Important note above everything else: read FreeRADIUS Wiki on SQL integration. Twice. Even thrice!

1. Network: make sure NAT is done if the server is using a private IP address (read: RFC 1918)

Default ports to be NAT-ed:

  • TCP 1812 and 1813
  • UDP 1812 and 1813
  • 1812 is for authentication, and 1813 for accounting. That’s if you did not customise the ports in the default config.

If you don’t know how NAT should be done, Google is your best friend.

2. Restart it: service should be restarted whenever you make changes!

To stop:
/etc/init.d/freeradius stop

To start:
/etc/init.d/freeradius start

RHEL (and similar distros) should use this to restart the service (via FreeRADIUS wiki):
service radiusd stop
service radiusd start

3. Protocols needed: configure /etc/freeradius/radiusd.conf as needed for types of authentication protocol e.g. CHAP, PAP, MS-CHAP.

4. Logging: check for error messages under /var/log/freeradius/radius.log

5. Debugging: debug mode is very useful:

To turn it on:
freeradius -X

*note: you have to kill to end the process, there is no stop command.

6. Dictionary check: add the relevant dictionary for your desired NAS in /usr/share/freeradius/

7. Dictionary include: include the file dictionary inside /etc/freeradius/dictionary

This is a sample entry for dictionary abc:

$INCLUDE /usr/share/freeradius/dictionary.abc

8. Client check: ensure your NAS clients are listed inside /etc/freeradius/clients.conf with a valid IP address and shared secret. NAS = Network Access Server, which is the client that’s handling the authentication. So yes, your NAS must be similarly configured.

9. Process check: Check that FreeRADIUS is running correctly.

List of processes check for freeradius:
ps -ef

If it’s not running, you’d better find out why.

Check listening ports make sure the required UDP and TCP ports are active:
netstat -tunelp

Make sure it’s listening on the right interface(s)!

10. Database check: Check that the username and and password (and related usergroup) have been inserted into the usergroup and radcheck tables.


That’s all there is to it, I wasn’t really in the mood for writing an epic saga of my woes encountered alongside the entire process. Hopefully this has been of help to you guys, so if you liked my article, please share it! Thanks as always.

Tech: Directing screen output to file with MS-DOS batching

How do you capture an error message from an MS-DOS prompt to a file?

One easy way would be to copy and paste it manually.

  • Right-click, select Mark and highlight the text.
  • Right-click again to copy.
  • Right-click to paste in the DOS prompt window, or Control-V to paste in other screens.

What if we wanted to use a batch file (.bat) to capture the output of several different commands at one go?

Use this:

cd K: >test.txt 2>&1

This example attempts to change directory to K: (which doesn’t exist), so the resulting error message is written to test.txt instead.

Thanks to YH for asking the question on Facebook, and I hope this tip helps some other lost soul out there.

Tech: IPplan – IP allocation system for the Internet Service Provider (ISP)

First and foremost, kudos to LH for recommending this software. Thanks!

I don’t know if it’s a trend, but Microsoft Excel was always (and is still) seen as a handy means of keeping inventory in the workplace. Why so?


Excel is da bomb. (via NI Developer Zone)

Good:

  • it’s portable – very small in size, and easy to backup.
  • visual appeal – easy to add colours, modify font to improve presentation.
  • easy organisation – use tabs for grouping.

Bad:

  • when – you usually don’t know when a particular record (field) was last updated.
  • who – you wouldn’t know who updated the document either.
  • one at a time – editing privileges is limited the first user that opens the document; everyone else is read-only.
  • VIP list – it is not easy to manage access rights on the Excel spreadsheet e.g. which specific users in the network have access, and the level of access.
  • region-specific privileges – you can’t limit users to edit only one tab, and have read-only for others. Result = many spreadsheets instead of a single point of information storage. This gets messy in the long run.
  • inconvenience – You need to have Microsoft Office (or some opensource variant that accepts Excel) installed on your computer.
  • security – anyone who’s allowed to edit, is allowed to delete the entire file. Not good.

A web system would be much better IMO.

  • Only need a browser, since interface is generated from the webserver.
  • User-specific access rights could be created and managed
  • The user and management interfaces could be readily modified as needed. Good design facilitates work.
  • Accounting e.g. last time/user edited could be done via the database.
  • Allows concurrent real-time editing by any user who is logged on.
  • Users not allowed edit/delete privileges for the core files (.php .asp etc), much safer.

Of course, there’s a shitload of work involved unimportant details like having to actually design the database schema, code the interfaces, and set the bloody server up.

So I was looking around for an IP address inventory system because I didn’t want to store a /20 address range on bloody Excel. 500 addresses, maybe. But organising 4000+ IP addresses on Excel is a little overboard. I was banging away against the wall for awhile, and was on the verge of writing one on my own when LH recommended IPplan.

(via softpedia)

IPplan is is exactly what it sounds like; a platform for IP address planning. It offers a readymade interface for entering and allocating your IP addresses, as well as DNS zone management.

*Check out the IPplan screen captures over on sourceforge.

Installation: not as easy as WordPress, but it’s not rocket science either. There’s an easy installation guide on openmaniak.com, which covers everything you need to know. Help is available via the forum and the FAQ too.

It took me about three hours to set everything up, due to some stupid-ass mistake on my part. Therefore a smooth install shouldn’t take more than two hours.

WAMP: one option that actually makes everything easier, is using WAMP as a base for IPplan. WAMP is a software package that offers Apache/MySQL/PHP in a single Windows binary installer. How cool is that? No need to configure Linux at all, just run it off your Windows XP desktop! This was what I did, so be assured that WAMP works fine in this config. Just remember to follow the directions given in the ipplanINSTALL-WINDOWS help file.

Templates: the one thing I like about IPplan, is the ability to add additional fields by using templates. There’s no need to insert the columns manually via SQL, just add more fields and you’re good to go!

example:

<FIELD>
<DEFINITION NAME="dateact" DESCRIP="Date activated:" TYPE="C" MAXLENGTH="10000" SIZE="15" ROWS="1" DEFAULT="" REGEX="" ERRMSG="Invalid field: Date activated" />
</FIELD>

This adds a field called Date Activated into the form for individual IP address records, and the column is referenced as dateact in the database; easy huh?

Quirks: IPplan is not without its faults though.

  • Default display fields in the display subnet listing are not easily shifted around; you have to tweak the PHP files manually.
  • Search can only be done on the Description field, you have to edit the code by hand if you prefer it otherwise.
  • No built-in functionality for backup of data, I’m still thinking whether I should do an SQL dump every week or something.
  • No one explained this in the forums, so note – if you’re using the functions under the Admin menu e.g. create user or group, login as admin (default admin/admin). To use any other menu, create a new user and login again.

If you’re tired of Excel, now would be a good time to check IPplan out. Give it a try!

WordPress: Upgrade or be hacked!

I spent the better part of a day upgrading my WordPress platform.

In a word: lovely!

Summarised tale:

  • I started seeing less visitors from the usual search keywords, which was odd.
  • Could not see my own blog post even when Googling the post title e.g. “brazillion crumpler mod keinism”. I was (and still am) quite sure that no one else has written anything similar so far, so WTF?
  • Official conclusion: Blog had been kicked off Google for some inexplicable reason.
  • Started checking Google Webmaster Tools and Analytics, could not see shit. Looked in top search queries, found shitty keywords that led to my blog e.g. “download hlds updated patch for czero”, “download steel beast pro full version”. What the hell?
  • Rummaged through webhost and discovered weird looking .php files, and modified .htaccess as well. WTF?!
  • Found a text-only Google snapshot of the blog, displaying a link farm at the footer region. Depressing.
  • Finally found an article by Donncha, Did your WordPress site get hacked?. Fcuking A for sure.
  • Proceeded to clean everything up. Deleted all suspicious files, looked inside active_plugins on the options table, changed user passwords and upgraded WordPress.
  • Got down to writing this post.

Total shit.

So boys and girls, do not slack off like I did – upgrade your damn WordPress before it’s too late!

(Besides, it’s got a pretty cool UI. And effortless upgrade at that.)

Update:

1. Bunny’s Technorati Tags does not work well now, and I had to re-tag all my posts with the default tag system.
2. UTF8 will fcuk your Chinese characters up.

Raph Koster recommends using this setting inside your wp-config.php:
define('DB_CHARSET', '.');

Tech: Google Chrome – Google’s new browser

I’m not really a hardcore Google fan, but Google products have always been pretty good in my opinion. Examples would be like GMail, Google Docs, and even Google Apps. And how about their crowning glory, the Google search engine?

And so I came across the webcomic of Google Chrome in my random surfing yesterday; the product sounded pretty good so why not?

Better memory management is always a good idea, and this is the part I like best: each browser tab is run as a separate process. So if your tab hangs, just say goodbye to the tab – no need to close the entire browser and start bitching about how you lost everything.

(Today’s the first day of the beta release BTW.)

The new browser installation finished its download within five minutes so I’m guessing it’s not that big. Installation was smooth and hassle-free, and looking pretty sleek and works pretty well so far, despite the fact that it’s a beta release.


Image sourced from the Google Chrome homepage.

Things to do:

Goodbye MSIE, I’m kicking you out after all the constant hangups after that recent Windows update.

Check out Google Chrome if you haven’t!