Author Archives: Adam

Remote Cisco Router Change Safty Net

In the networking world you have a lot of opportunity to break things and take down entire buildings, WAN links, etc. Even less risky changes can result in a short break in connectivity while routing protocols re converge and so on. Because we often don’t have physical access to both sites while we are making WAN changes there has to be some type of worst case scenario prevention method. This is it: When making changes to WAN links in particular I always like to make the change to the far side first and obviously have to if there will be … Continue reading

Posted in Networking | Tagged , , | Leave a comment

MySQL Date Time Filename Backup

I recently setup a system to manage our companies IP addresses. This was an open source PHP application that ran in Apache and used MySQL for its database. Since I typically don’t have time to manually run a backup (and why would I want to do something the hard way anyhow?) I decided it was time to automate the task. The first issue was what to name the backup files. I wanted at least a few weeks history worth of backups in case something bad was done in the database… Obviously, I could not have 30 files with the same … Continue reading

Posted in Shell | Tagged , , | Leave a comment

Notepad++ Regular Expression Find and Replace

When scripting or manipulating text data I prefer using notepad++. It’s easy to use, includes syntax coloring for just about anything, folds code nicely and even supports regular expression find and replace features. I have been using if for years but just recently have come to love the program even more. When using find and replace in the past I stuck mostly to the basics. From time to time I would use a regex to search and then replacing everything that was found. Notepad++ goes well past this. To explain I will show an example. I was working with tabular … Continue reading

Posted in Other Stuff | Tagged | Comments Off on Notepad++ Regular Expression Find and Replace

PHP Mac Address Validation and Formatting

I have been working on a small php app to perform a network scan and fill a database with the discovered information. The issue is that, depending on what you perform the scan with, the MAC addresses are in a number of different formats. This PHP functions validates a MAC and returns false if its not valid or a variety of formats depending on your needs! If anyone has any thoughts on improving this function feel free to let me know and I will post the updates.

Posted in PHP | Tagged | Leave a comment