Brandon's Notepad

December 27, 2017

The vi Text Editor

Home > My Lists > Technology > Software Development References > The vi Text Editor

User Guides & Tutorials

Tips & Tricks

  • Insert contents of another file into current file using :r filename
  • Open second file in split window using :sp or :vsp. Use Ctrl+w to switch between window panes.

June 5, 2015

m4 Macro Processor

Filed under: Computer Software,Linux — Brandon @ 3:54 am
Tags: , , , , , ,

Home > My Lists > Technical Notes > Linux > m4 Macro Processor

m4 is a macro processor that replaces tokens in a file. It was once used as a FORTRAN preprocessor and is now used by various systems to manage configuration files. I started using it years ago in conjunction with make to automatically generate web pages, but that practice ended when I decided to move this site to a ‘blog platform. Since then, I’ve continued to look for additional ways to leverage it.

Presently, I’m collecting links about m4 and will write more if needed:

GNU m4 Manual
m4 Manpage (
Using m4 Macros in Your Programs
Building text files with m4 macros
Michael Breen’s Notes on the M4 Macro Language
Fractals with SVG and m4
m4 Macros and CSS
Using the m4 macro processor for fun and profit

Here’s a random snippet of a makefile using m4:

.SUFFIXES: .m4 .html
.m4.html: $(Common)
m4 -D_LOCATION=coding -P $*.html

July 14, 2014

Other Uses For Tripwire

Filed under: Computer Software,Linux — Brandon @ 11:06 am
Tags: , ,

Short URL:
Home > My Lists > Technical Notes > Tripwire > Other Uses For Tripwire

Tripwire was written for security, especially on Unix and Linux systems. It can watch files that contain users and groups definitions, encrypted passwords, and system configuration settings, as well as executable files to verify that they have not been edited or replaced. Here are a few other uses that I’ve come up with. They are listed in no particular order at this point, and some are specific uses that belong to more generic categories.

Event Notification. This is a generic category of uses that need not be security focused. Notification that a periodic report has been generated, for example, may be useful to any number of people for a variety of reasons.

Disk Health Monitor. Unexpected changes to files may be indicative of imminent hard drive failure. Tripwire should reside on a different physical disk than the files monitored. Good candidates to watch include any file that doesn’t change often, including data files.

Change Control. File changes made during software deployment can be reconciled with a list of files stored in a version control tool to verify that only the expected files actually changed. The need to clear scheduled updates should already be a consideration for using Tripwire as an IDS, but this check goes a little deeper, and should be performed by someone who is not a system admin to maintain segregation of duties.

Groupware. This is another generic category that includes any scenario in which a group of people share a common set of working files. Professional, academic, and volunteer/contributor-based efforts could benefit from this usage of the tool, especially when files being developed are prototypical or experimental in nature, or the organization is very small and does not have other controls in place.

Records Management. A company or department may have certain records that must be retained for various reasons, and especially legal ones. Whoever is responsible for controlling changes to these documents can be notified when changes are made. The resulting action will depend on company procedure. For example, reported changes may trigger a review and approval process if a pre-publishing/staging directory is being monitored.

Development. Daily e-mails listing the files changed in a development sandbox could keep developers informed about changes made by peers. This is particularly important for common code, such as shared libraries, interface definitions, database schemas, etc. Other tools (i.e. version control) may have file watch and notification capabilities, but this tool would work in a pinch.

Open Source Tripwire Reference

Filed under: Computer Software,Linux — Brandon @ 10:34 am
Tags: , , , , ,

Home > My Lists > Technical Notes > Tripwire > Open Source Tripwire Reference

There is a lot of reference material on the Web about Open Source Tripwire. This page includes references to the sources I’ve used to understand how the system works.

How-To Guides

Writing Policy Files

Linux Man Pages


Filed under: Computer Software,Linux — Brandon @ 10:29 am
Tags: , , , , ,

Short URL:
Home > My Lists > Technical Notes > Tripwire

Tripwire is an intrusion detection system. It monitors file systems and stores various attributes about the files for later comparison. When it detects that a monitored file has changed since the baseline scan, it alerts someone (e.g. system administrator, data security, etc.) via e-mail who can either verify that the change was authorized and update the baseline, or have the change reversed. The Open Source product is based on code provided by Tripwire Inc.. The commercial offering includes a robust reporting and security policy management built around the core product.

Open Source Tripwire Reference
How Tripwire Works In Plain English (future post)
Other Uses For Tripwire

February 27, 2012


Filed under: Computer Software,Linux — Brandon @ 8:13 am
Tags: , , ,

Home > My Lists > Technical Notes > Linux > RCS

RCS is a version control tool released in 1982 as an alternative to the (then) decade-old SCCS written by Bell Labs. It is part of GNU now and is an underlying technology for almost all large version control solutions on the market. There is plenty of info on RCS out there; these notes only cover what I need to remember about RCS but tend to forget over time.


Official RCS Homepage (Purdue)
RCS Wikipedia Page
RCS manpage and intro (
Using GNU RCS by Aaron Hawley (Burlington Telecom)


  • The rcs, ci, co, rcsdiff, rcsmerge, rcsclean, & rlog commands are RCS operations.
  • Archives are stored in ./RCS if it exists or in ./ by default.
  • New archives are initialized with ‘rcs -i filename’ or by just checking it in the first time.
  • The -t flag adds a description of the file (instead of being prompted).
  • ci deletes the working file by default.
  • The -m flag adds a log message (instead of being prompted).
  • “ci -l” locks the file (implicit checkout), and “ci -u” leaves a read-only copy behind.

September 9, 2011


Filed under: Computer Software,Linux — Brandon @ 7:55 am
Tags: , , , , , ,

Home > My Lists > Technical Notes > Linux > Screen

Screen is a good solution for anyone who would benefit from using multiple Unix/Linux terminals (consoles) at one time. This utility divides the screen into two or more sections, each running a different session. This has many uses; for example, you can run a command and watch the output in one pane and tail (-f) a related log file in another.

Presently, I’m collecting links about screen and will write more if needed:

June 28, 2011

Small Linux Distros

Filed under: Linux — Brandon @ 10:55 pm

Home > My Lists > Technical Notes > Small Linux Distros

Small Linux distributions have a variety of purposes, from rescue disks to embedded applications to kiosk computers, weather stateions, or other specific-use clients. Here’s a list of the small distros I’ve encountered over time.


The old standby, requiring only 50MB of space, 16MB to 128MB RAM.


The KioskCD distribution is, well, just that: a CD-based distro that can be used to operate a (browser-only) kiosk computer. It appears that the website disappeared sometime in the Spring of 2009, the last snapshot from the Wayback Machine dated April 23rd. There was a page on the site that explained how to load an image to boot from a CF card.


The other old standby, weighing in at ~85MB.

Tiny Core

The GUI-based “Tiny Core” version has a 10MB footprint and the CLI version “Micro Core” occupies only 6MB! It is based on the cloud-computing concept, applications loaded from the Internet upon reboot (though other options are available).


From the homepage, “Tom’s floppy which has a root filesystem and is also bootable” and “The most GNU/Linux on 1 floppy disk.”


I use Ubuntu. It’s not tiny. But, this story posted on DistroWatch (2008) explains how to perform a minimal install. The author claims to have reduced a 3.1GB/430MB/37s installation down to a 2.2GB/210MB/25s installation (HD/RAM/Boot).

Wiping Linux File Systems

Filed under: How-To,Linux — Brandon @ 9:00 am
Tags: , , , , , ,

Home > My Lists > Technical Notes > Wiping Linux File Systems

Here are two Linux commands that can be used to overwrite disks with random bits:

badblocks -c nnnn -s -w -t random -v /dev/sdb

dd if=/dev/urandom of=/dev/sdb

The badblocks command searches for bad blocks on the disk and the parameters used above put it into write-mode (-w), writing random data (-t random) to the disk. The dd command takes longer but uses a higher quality of encryption. Also, /dev/random device is more secure but has higher enthropy than /dev/urandom.

Incidentally, the Wikipedia entry for dd explains that its JCL roots give the “Data Description” utility its name, but that “it is jokingly said to stand for ‘disk destroyer’, ‘data destroyer’, ‘death and destruction’, or ‘delete data'”. Personally, I thought it stood for “disk dup” because my experience has always been centered around writing boot/root disks and usb drives for Linux installs. I probably based this assumption on other utilities, such as the Tandem “FUP DUP” command.

April 15, 2011

Creating Movie DVD ISO Images

Filed under: How-To,Linux — Brandon @ 1:05 pm
Tags: , , ,

I’ve taken an interest in networked media players, like the WD TV Live series of devices. Some of these devices will play DVD ISO images. The idea is that an ISO file can be mounted and read just like the filesystem on the DVD itself. From what I’ve read, this is not necessarily as easy as running the trusty ‘dd’ command – something to do with variable block sizes or something like that, but I’ll leave that for others to explain for now. This is a how-to page for creating ISO images that play.

Incidentally, I don’t advocate stealing music or movies in any way. Artists absolutely deserve to be payed for their work, so I buy my albums and movies. I find nothing wrong with creating backup copies of these things for non-public use, and I’m fairly certain that U.S. law still permits this (fair use).


I already use this utility to burn CDs and such. I have used it to burn ISO images to data CDs, primarily Linux distros, but I’ve not tried using it for audio or video projects yet. More to come…


This is a command-line utility and it looks promising. I will try this one after trying K3B above. For now, here are some useful links: vobcopy manpage, a newbie tutorial, Mac-based tutorial on YouTube (I think this guy was stoned while filming), this insightful snippet. The vobcopy utility just copies the VOB files – the ISO file must be compiled with mkisofs. More to come…


On the list to try. Sourceforge project page More to come…


On the list to try. Sourceforge project page More to come…


Is it possible that the ‘cat’ command will work? The example provided on this page is ‘cat /dev/dvd/ > $HOME/video.iso’. Call me skeptical, but I’ll have to verify this one for myself – I have a feeling this is what copy protection prevents.


According to this post, Ubuntu (8.10) provides a ‘Copy Disc’ option. This, too, should be easy to test out once I obtain a player.

Next Page »

Create a free website or blog at