Simple NAT With Cisco IOS

Performing NAT with any variety of a LINUX box is possibly one of the most redundantly documented applications on the Web. Attempting to do the same with a Cisco IOS router is not documented in so straight-forward a way.

This little snippet shows the configuration for an IOS router where vLAN 13 is a public network and vLAN 12 is a private network. The router has a public IP address of A.B.C.D [netmask: E.F.G.H] and the gateway address is A.B.C.I. The private network is a 10.0.0.0/8 with multiple /24 segments which all route to this NAT gateway.

Counting weekdays between dates

Need a method to accurately count the number of weekdays between two days? [The key here is "accurately", it is a bit harder than it seems at first]. In Python there are several ways to do this, but most involve some iteration or list comprehension. In my opinion, if you have to do that, you are probably violating the Python idiom of "use the batteries".

If a record exists

A common action when synchronizing data between some source and a database is to check if such-and-such record already exists and needs to be updated or if a new record needs to be created. The SQLAlchemy's one() method [of the query object] provides an easy way to check to see if such-and-such record exists; but it doesn't return either an ORM object or None - if no record is found it raises an exception. This is surprising at first as x=do;if-not-x is possibly the most common of all Python constructs.

Recovery From Half An MD Mirrored Pair

In the process of decommissioning an old physical server I wanted to recover some data from the server's drives. The failing server was configured with a SATA RAID1 pair that contained a logical volume group (LVM). So I could either boot up the old server, change it's IP address, and recover the data over the network.... or I could just recover the data directly from one of the drives [they are a mirrored pair after all]. But only having a USB caddy for one SATA drive the trick was to get the RAID1 array to come up on my laptop with only one drive.

A JSONDateTime TypeDecorator

JSON doesn't provide a date or date-time construct; therefore every application is burdened with implementing a solution of it's own for receiving date-time information over the wire. On common issue receiving JSON and serializing that data into some type of database - but the database knows the value is a date-time and you want to be able to perform date-time like operations on the value (locally).

Discovering DLL Version With pefile

A Microsoft KB article claimed that if a specific DLL was at least a certain version that a bug reported by one of my users would be resolved. But the user was using their computer and I dislike interrupting people's work (I know how annoying it is when someone interrupts me). No problem; I can just grab the named DLL off their machine over the network and copy it to my home directory. But I'm not running Windows and all file tells me is that the DLL is a 32-bit PE file.

Installing PDO_INFORMIX on CentOS6

Step#1 : Install the Informix SDK / Client

Identifying The Hottest Tables (Informix)

Yesterday I posted about how to identify the hottest table in a PostgreSQL database. Pretty much the same functionality is available for administrators of Informix databases as well; this kind of information is found in the sysmaster database which is the database engine's own database.

Identifying The Hottest Tables (PostgreSQL)

In recent versions of PostgreSQL there is a magical view called pg_stat_user_tables which provides per table information on usage; there is one row per table and eight counters per row.

Fields

Tags: 

Querying Connectivity

You're application almost always needs to know if there is a working network connection. This is typically handled by placing the connection attempt in a try...catch block. That works, but can be slow, and it means the UI can't really adapt to the level of current connectivity. A much better solution is to query the NetworkManager [used by every mainstream distribution] via the System D-Bus for the current connectivity.

Pages

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer