HOW-TOs

Floating Point Math in Bash, Part 2 (Wait for System Load)

If you run scripts that require a lot of execution time it's a good idea to try to avoid letting them overload your system. You can run them via nice, but if for example your script is sending a bunch of emails your email daemon isn't running via nice and it may itself get out of control. One way to deal with this is by using the values in /proc/loadavg to pause when your system load gets too high.

An Introduction to AIR

AIR (Adobe Integrated Runtime) is a wrapper around a set of technologies that enables developers to build rich Internet applications that deploy on the desktop. Applications are created using a mixture of JavaScript, HTML, and Flash. The resulting

Floating Point Math in Bash

When you think about it, it's surprising how many programming tasks don't require the use of floating point numbers. If you're an embedded systems programmer, you'd probably get fired for using "double" in a C program. If you write PHP or JavaScript, quick, do they even support floating point? One language that doesn't support it is Bash, but let's not let that stop us...

Turn Make Options into Tool Flags

Often times when developing programs there is a need to build the program in/for multiple configurations. Many times, autoconf and its resulting configure script do what you need. Other times you can just change a #define in your code. But sometimes, autoconf isn't an option and changing a define doesn't quite work (say you need to pass your defines/undefines to m4 or some other tool that can't handle include files). The solution is probably to change your makefile. The method presented here results in a fairly compact change to your makefile.

Exploring Space with Celestia

I, as well as my 4 year old son, have always had an interest in Astronomy. My son puts planet puzzles together and looks at picture books. I'm proud to say that he can name all the planets in order, and astonished to realize that he knows that Pluto isn't considered a planet anymore. I've read books on Astronomy; I've been to planetariums and observatories.

Add an Auto-Incrementing Build-Number to Your Build Process

When building software it's often useful to give each iteration of your build process a unique number. Many IDEs and RAD tools do this for you automatically. If yours doesn't and you're using a make file to build your code you can add an auto-incrementing build number to your project with a few simple changes to your make file.

GPS and GIS: A Great Combination, Part I

A GPS unit and a Geographic Information System (GIS) program are a great team. With a GPS receiver in hand, you can tap into the network of government satellites to calculate your position on Earth to within meters. With a GIS on your desktop, you can import acquired GPS data onto to your desktop and combine it with other geospatial features such as maps, aerial photos and satellite imagery.

Automating the creation of slide shows in OpenOffice.org

Why do you need an article on building slide shows in Impress? You don't, in one sense, because the application is simple enough for anyone who has ever seen a slide show to figure out. If you want, you can just plunge in and learn by doing. However, if you take the time to learn, you'll find that OpenOffice.org has two tools to help you organize and automate the process -- and, ultimately, to help you save time.

Data Manipulation with Sprog

I don't think I know anyone who relishes the task of data manipulation, and I'm certainly not different. Some of the more complicated manipulations pose a briefly satisfying technical challenge, but in the end, data manipulation is boring.

An Introduction to Gnome-Inform7 - part 2

This is the second in a two-part introduction to Gnome-Inform7 (and by extension, the Inform 7 language). I'm not going to spend much time re-capping what we covered last time, so if you haven't read part one, please do so now.

Creating chroot sftp Jails with Jailkit

One of the things I both love and hate about my job is getting assigned new projects. They can be about anything and everything. A few months back I was given an assignment to create some chroot jails for a group of customers so that they could securely upload files with sftp. The requirement was that the customers needed to be able to upload file, but in a secure and private way.

Bash Arrays

If you're used to a "standard" *NIX shell you may not be familiar with bash's array feature. Although not as powerful as similar constructs in the P languages (Perl, Python, and PHP) and others, they are often quite useful.

Convert a File to a C Data Structure

Yesterday's post about embedding a file in an executable has gotten a couple of replies about programs that will convert the file to a C data structure. This is certainly an option, here's a script that does that without the need to go searching for programs, it uses standard Linux tools:

Embedding a File in an Executable, aka Hello World, Version 5967

I recently had the need to embed a file in an executable. Since I'm working at the command line with gcc, et al and not with a fancy RAD tool that makes it all happen magically it wasn't immediately obvious to me how to make this happen. A bit of searching on the net found a hack to essentially cat it onto the end of the executable and then decipher where it was based on a bunch of information I didn't want to know about. Seemed like there ought to be a better way...

OpenOffice.org Template Collections

Stubbornly, OpenOffice.org continues to ship with only a handful of templates. Despite the efforts of several sub-projects and individuals to change the situation, the standard OpenOffice.org download includes only a couple of slide show presentations and a few templates to accompany the wizards available in the file menu. This lack of templates is a serious handicap for many users, and often leaves a poor impression on new users who are accustomed to the selection of templates found in other office suites.

An Introduction to Gnome Inform7, Part 1

What is interactive fiction? It all started in 1975 with a man named Will Crowther who wanted to create something for his daughters that tied together two of his loves: role playing games and cave exploration. The result was a game called "Adventure" (also sometimes called "Colossal Cave"). He wrote the game on the mainframe he used at work and while his daughters loved it, others who discovered the game did to, and they shared it far and wide. Stanford student Don Woods discovered the program on one of the university computers in 1976 and with Crowther's permission extended the Fortran original, adding more rooms and treasure. This expanded version was later ported to C and from there to countless platforms and languages. You can still download various versions of it today.

How to be a good (and lazy) System Administrator

If you're anything like the average System Administrator, you are understaffed, underfunded, and overworked. By now, you've also gotten used to the idea that no one knows you exist until the mail server goes down, then you're suddenly on America's Most Wanted. In this article, I'm also assuming that you have many servers that you are responsible for. I'm also assuming