HOW-TOs

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

Doing a Reverse Hex Dump

If you work with the command line you've most likely used hexdump or od to dump binary files, but what do you do if you have a hex dump of something and you want to create the binary version of the data? Assuming your needs aren't too complex, the answer may be xxd. You can use xxd to dump binary files just like hexdump and od, but you can also use it to do the reverse: turn a hex dump back into binary.

Bash Brace Expansion

Bash brace expansion is used to generate stings at the command line or in a shell script. The syntax for brace expansion consists of either a sequence specification or a comma separated list of items inside curly braces "{}". A sequence consists of a starting and ending item separated by two periods "..".

Managing your Life with eGroupWare

If your life is like mine, it's probably more complicated than it should be. There's that full time job, social events, and vacations to say nothing of various side businesses and their associated deadlines. The kids have Cub Scouts, soccer, and baseball. Since we homeschool, we have science club, field trips and play dates. And it seems that everyone we know has 2 email

How to Install and Use ndiswrapper [Video]

Hardware manufacturers often don't release specifications of their products to the open source community, so programs like ndiswrapper become necessary. This video demonstrates how to use Windows wireless drivers in Linux using ndiswrapper.

Online Storage with Wuala

At it's most basic level, Wuala is an online storage service. Like other services it aims to allow you to access your files from anywhere, even if your home or office computer is turned off. You can store any file in your Wuala 'drive' and they can be any size (up to your storage limit, of course).

Bash Process Substitution

In addition to the fairly common forms of input/output redirection the shell recognizes something called process substitution. Although not documented as a form of input/output redirection, its syntax and its effects are similar.

Bash Input Redirection

If you use the shell you surely know about redirection: # echo 'hello world' >output # cat <output The first line writes "hello world" to the file "output", the second reads it back and writes it to standard output (normally the terminal).

Make Your Scripts User Friendly with Zenity

The first time I played with Zenity, I recognized several potential uses for it. While I'm pretty comfortable with interacting with computers with a command line interface, I know many people are not. Zenity creates GUI widgets from a simple command line and can be used from any shell script.

How's The Weather?

One of the items on the Geek Ranch agenda is a weather station. While we don't have one yet, we have learned a bit about weather stations and Linux. First, why don't we have one? Well, there is no electricity at the Geek Ranch site yet for starters. But, more important, there is no Internet connection. So, let's just call this research.

RPMs - The HOWTO Short Story

If you like the latest and greatest version of everything and you use an RPM based system you probably want to learn how to create RPMs. You don't have to, you can just download the latest source and compile and install it in /usr/local. This of course leaves your system in a state where your RPM database does not accurately reflect what is installed on your system. Again, this will work, but building RPMs isn't (usually at least) that difficult.

Adding Configurable Logging to Your PHP Scripts

This tip shows how to add logging to your PHP script and how to add configuration so you have basic, configurable logging. The PHP script requires two PEAR packages, Log and Config. To use the code in shown in this tip, you'll need to PEAR installed along with PHP and you'll need to install both the Log and the Config PEAR packages. To install the two packages type: