Thu, 28 Mar 2024I've decided to put some of my answers from Quora on my blog for posterity. I'm going to back date them, though, so they will appear in the blog main page on the date they were written, not the day I posted them here. You can always look directly at the folder link to see them all if you want.
File Permissions in Unix (and Linux)
A couple of months ago, I was talking with a friend after radio club. He was having some issues with an installation of Linux using the "Pentoo" distribution. I hadn't heard of Pentoo before, but knowing it was based on Gentoo and was a fairly standard Linux distro, I thought I might be able to help him out. His problem was that when the screen saver would kick in, he wasn't able to get it to unlock. It kept telling him that his password was incorrect. His only solution was to reboot the machine. Obviously, this was not an acceptable solution.
My initial assumption was correct, that the screen saver, running as his
own user, was unable to open the So, let's talk about Unix file permissions. Remember, in the Unix model, everything is a file, including devices (they look like a file to the user-land), directories, pipes, named sockets, and even files! In Unix, a file exists in the filesystem as a collection of blocks and there is a special kind of block in the filesystem called the "inode". This kind of block contains inode structures which each contain information about a file. Some of the information is the "mode" bits (more on that in a minute), owner, group, size, link count, timestamps (for file access time, file modification time, and inode change time, called respectively atime, mtime, and ctime), and pointers (block numbers) to the first ten or so blocks of the file. There are also pointers to the first, second, and third tier block pointer blocks (the first tier points to a block of block pointers, the second tier points to a block of pointers that each point to a block of block pointers, and the third tier points to a block of pointers to blocks of pointers to blocks of pointers to blocks). For small files (those with 10 or fewer blocks), no additional blocks of pointers are necessary, so all of the information about how to get the file's data is right there in the inode. "Special" files (like devices, symlinks, Unix domain sockets, etc.) encode information about the device (symlink, socket, etc.) itself instead of block pointers (for devices, these are the "major" and "minor" device numbers, for symlinks, the information is the path to the file that the symlink points to, and so on).
You may have noticed that I didn't say anything about file names being
in the inode. They aren't. The file is a completely separate entity
from its name in Unix... and you can easily have multiple file names
at various places in the filesystem pointing at the exact same file
(not a copy, but physically the same data blocks that make up the file).
The names are stored in
data blocks of files that have the "directory" flag turned on, and
contain lists of filename and inode number tuples. You will probably
have noticed that all directories contain two special names, "." and
".." (or, as we say, "dot" and "dot dot"). The "dot" directory always
points to itself (so you can say something like "
This concept of multiple names pointing to the same file is why we
don't "delete" files in Unix, but we "remove" links (names) to them.
The "remove" command (" Now, this is a fairly simplistic view of the Unix filesystem, and indeed there are several different filesystem types that implement things in different ways (including things like journals, caching, etc.), but this concept of inodes associated with files and only loosely associated with file names is a critical concept in Unix. The other core concept is that the ownership and permissions on a file are associated with the file, not with the file name.
So, let's talk about permissions.... In Unix, the traditional permission
system is pretty simple. Each file will have an owner and a group. Each
file will have a set of permission bits, called the "mode" bits, that
encode the permissions as follows: read, write, and execute permission
for the file owner, group members, and everyone else (other). You may
see permissions written in octal, as e.g.
So, let's take a look at 1950 bash$ ls -l /etc/shadow -rw-r----- 1 root shadow 1349 Jul 6 2021 /etc/shadowYou see that first part that starts with a dash? That's the mode. A regular file will start with a "-", a directory will start with a "d", a symlink will start with an "l", a named pipe will start with "p", and so on for the other various special files. The next three characters are the read (r), write (w), and execute(x) bits for user, the next three for group, and the last three for other. The next thing (a number 1, in this case) is the link count for the file. Then comes the file's owner, and group, followed by the size in bytes. The next thing is the file's modify time (mtime) and then the file name. You can use other options on the ls command to show the atime or ctime instead
of mtime, but the
mtime is usually what we want so it's the default. For
/etc/shadow, the
owner is root and the mode bits allow root to read and write the file
(technically not necessary, as root can read and write any file, but
that's how they line up). The file is in group "shadow", and any process
with group shadow will be able to read the file, but not modify it.
Finally, there are no permissions for other, so if you're not root, and
you're not in group shadow, you won't be able to read the file.
Back to my friend's original problem with the Pentoo system... remember we
determined that the screen saver was running as the logged in user? If
that user isn't in group shadow, and the screen saver is not running
with enhanced permissions (i.e., the set group-id bit, which we haven't
talked about), then the screen saver will NOT be able to read the
So, how was this handled back in the old days? Through judicious use of
the setuid or setgid bits. There's another set of three bits, usually
indicated by a fourth octal digit when giving a numeric mode (this
becomes the most significant digit... the last three digits are the
standard mode bits as described above). These three bits are "setuid",
"setgid", and "sticky". Normally, these only apply on executable files,
and they cause the program to be run with elevated privileges. If the
"setuid" bit is on (ls will show this with an "s" character instead
of the "x" character), then when the program is running, it will be
running as the user who owns the file (in most cases this is root,
but it doesn't have to be, it will work for any user). If the second
bit, "setgid" is on, then the running program will have all of the
permissions that a member of the group owner of the file would have had.
The "sticky" bit is a totally different animal... it originally meant
that the executable file would be kept loaded in RAM even if it wasn't
running right now. In the old days, it could take significant time to
load a program off the disk into memory, and as soon as it exited it
would get unloaded to make room for other programs. The sticky bit
made it want to stay in memory, on the assumption that it was probably
going to get run again very soon, and if it was already in memory it
wouldn't have to be loaded again. This has gotten less important over
the years, since machines have more memory now and disk subsystems are
much faster than they used to be, but the functionality is still there.
These bits have also been overloaded to have special connotations when
set on directories (like
Now, that's how things used to work, and for the most part, Unix systems
still implement ownership, group, and permissions in this way. However.
These permissions and capabilities were found to be somewhat lacking in
granularity. Sometimes there is a need to give a specific program access
to a specific file, but you don't want to necessarily give it more than
just that capability. For this reason, modern filesystems support what
we call "access control lists" or "acls" on files. These allow very
fine granular control over access to particular files by particular
users, groups, and running programs. These overrides are permitted by
the kernel if the appropriate capabilities are enabled.
You can use "getcap"
to check the capabilities of the system and see if the screen saver is
allowed to override the normal permissions and use an enhanced acl to
access the
So, the solution I suggested to my friend was to
Sat, 09 Mar 2024
Aviation Fuel Efficiency
Sun, 08 Jan 2023I used to play the organ (the musical instrument). I started late, probably around age 12 or so, working with a private teacher. She was very talented and an excellent teacher. I had a beautiful Kawai electronic organ in my home for practice. One day, my teacher took me to the church where she played the organ on Sundays (it was the First Presbyterian Church in Great Falls, MT). She showed me the pipe organ there and allowed me to try playing it. A pipe organ is a completely different beast from the electronic organs I was familiar with. Sitting there at the console, I felt like I had the power of an enormous animal at my hands and feet. A pipe organ is alive. It breathes. It has a spirit of its own. There are two things you notice immediately: you can hear the shutters opening and closing as you operate the expression pedal (the shutters block off the pipe rooms and when closed muffle the sound somewhat), and when you start to play, you don't hear anything as you have to wait for the sound to get to where you are sitting. You quickly realize that mistakes are just part of the musical experience... there is nothing you can do about them as you have already moved on by the time you (or indeed anyone else) notices them. Pipe organs are amazing. If you ever have the chance to play one, take it. You will not regret the experience.
Thu, 18 Aug 2022(This is part of the SpaceTrader-based book I've been writing.) I'm "Captain" Jameson... at least, I guess I'm a captain now. I've finally decided to try my hand out in the spaceways. I sold everything I had, spent some weeks in school (I aced the pilots test, and got pretty good marks in trades and management, but I didn't bother with engineering or combat as I just don't have the knack), and purchased a secondhand Gnat-class trader. Today's the day I take possession of my new vessel, and I'm walking out to the pits to look her over. My Gnat is a little rusty, a little dusty, but a sturdy little ship. Gnats are not the smallest class of ship available, but they're definitely not the largest. With a capacity of 15 units of cargo, a range of 14 parsecs, and a hull strength of 100, they are really basic entry-level trading vessels. No shields, but they can carry one weapon (mine appears to have a pulse laser unit fitted... not having any experience with combat, I'm hoping not to have to use it). The ship has capacity for a single gadget, but doesn't have any installed, and it has a single crew capacity, so I'm essentially a captain of one... being the total crew as well. I think I'll name her... the Rusty Bucket. That seems apropos. It's a nice day on Draylon, a large planet with an early industrial tech level. The place is nothing special, with a moderate space police force and some pirates lurking around. We have been having some drought issues of late, but the monarchy says we will come through okay. I check out the boards at the space center while on my way to the market to see what kind of cargo I can pick up. I see there is a spacer looking for a billet, Iranda is her name and she's an excellent engineer. Too bad I don't have any additional crew slots available, she looks like a good addition. As I arrive at the market, I discover that I really don't know much about trading. While I have moderate skills, it wasn't my primary course of study, so I have to be careful. I also only have a kilobuck in my pocket, which means I don't have much bargaining room. There are only five systems within range of my ship (and the wormhole, of course), so I have to be a little careful of what I choose and where I go. Machines are in pretty high demand on Somari, but at 728 credits each, I can't afford too many. Maybe I can look into a few other options. I'm in luck, I found out I can sell my pulse laser for 1500 credits (I wasn't planning on using it, anyway), plus the bank will loan me another thousand, which means I can get four units of machines. They won't fill my cargo bays, but I stand to make 800 or so credits gross on Somari, so I set up the deal and get ready to ship out. On the way out of the market, I realize I have enough cash left to pick up five units of food, which isn't a high profit cargo, but empty bays don't earn me anything. Heading back to my ship, I'm ready to head out. Somari, here I come. My first voyage... hopefully it's profitable!
Fri, 05 Aug 2022(This is part of the SpaceTrader-based book I've been writing.) I decided to try writing a story, but I didn't have a good idea for a theme, background, or how to make a story go. I used to play a game called SpaceTrader on the PalmPilot many years ago, and recently discovered (thanks, Zack!) an Android port of the original game. The game puts you in charge of a trading ship and sends you traveling around the galaxy in search of enough money to buy your own moon and retire. Since the game plays kind of like a story, I thought I would start with it as a framework and keep a sort of Captain's Log of what happens (or what I imaging happens) during a normal game. I've attempted to turn this into something of an interesting story, with embellishments along the way. My adoring public will have to let me know how well (or if at all) I have succeeded. Without further ado, here is the annals of Captain Jameson as he attempts to make a living out on the spaceways. Jan L. Peterson jan.l.peterson@gmail.com
Wed, 29 Jun 2022
Commercial Ejection Seats
Tue, 29 May 2018
Fiery Crash
Mon, 21 Nov 2016
Fighter Joke
Sat, 16 Apr 2016I had a need to access my phone with ADB (the Android DeBugger) the other day, but I didn't have a suitable USB cable handy (the cable I have is dedicated to my Xi dock and, for some reason, fails to act as a real USB cable if I plug it directly into the phone. It's great for charging, though). Since I was at work, my laptop and my phone were not on the same WiFi network (the laptop belongs to the company and is on the corporate network, my phone belongs to me and wasn't on WiFi at all, but rather on my carrier's mobile data network). Since both my laptop and phone have Bluetooth capabilities, the solution was obvious... ADB over Bluetooth! Unfortunately, although the solution was obvious, the implementation of the solution was a little less than obvious. It took a while for me to work out all the steps needed to make this work, so I thought I'd share them here for the next time I need to remember how to do this. What's Needed? Obviously, you need to have a phone and a computer that both support Bluetooth. My phone is a rooted Motorola Nexus 6 (great phone, by the way) running the Chroma OS build (great ROM for Nexus devices, I highly recommend it). My (company provided) laptop is a MacBook Pro (mid-2015 model) with OS X 10.10.5 Yosemite. While some of the specific steps on what you need to do might be different if you have a Linux computer or a Windows machine, the basic principles will be the same. The other prerequisites are that you have paired the phone to the computer and that you have ADB installed (you can get it with the Android SDK) on your computer. Your phone needs to support Bluetooth tethering (which means you can share your phone's internet connection via Bluetooth to another device, my laptop in this case). You'll also need some kind of terminal application on your phone (I use JuiceSSH, which in addition to being able to make SSH and Mosh connections can also make a direct terminal connection to the local device, but most custom ROMs have Terminal installed). Step by Step 1. The first step is to enable Bluetooth tethering on the phone. To do this, navigate to Settings -> (Wireless & networks) More -> Tethering & portable hotspot -> Bluetooth tethering and switch it on. This happens instantly, you don't have to reboot or anything. 2. Secondly, on the computer, bring up the Bluetooth PAN (personal area network) device. This is where you'll have to use your own knowledge of your platform. On the Mac, there is a little Bluetooth icon up in the status bar (on mine, it's usually right next to the WiFi strength indicator). You click on that and a menu pops up that includes, among other things, an entry for each paired device. Hopefully you have changed the name of your device so it doesn't just show up as "Android". Mousing to the entry for your phone, you get a sub-menu that includes "Connect to network" that, not too surprisingly, brings up the Bluetooth network. 3. Third, you need to get the IP address of your phone and run a few commands on it, so you need to bring up your local Terminal app (like I mentioned, I use JuiceSSH, but you could also use Terminal). Once you have a local shell, your prompt should look something like this: ~$ Run the following command to find our your IP address: ifconfig | sed -ne 'bt-pan,$p' | awk 'inet addr {print $2}' | awk -F: '{print $2}' which will print out your phone's IP address on the bluetooth connection. For example's sake, my phone comes up as 192.168.44.1, so I'll use that throughout this discussion. 4. Fourth, still in your local terminal, you'll need to run the following commands (each command is prefixed with the prompt that the phone will print out, so don't type the prompt!): ~$ su root@shamu:/ # setprop service.adbtcp.port 5555 root@shamu:/ # stop adbd root@shamu:/ # start adbd 5. Finally, enter the following command on the computer: adb connect IP_ADDRESS (replace IP_ADDRESS with the IP address you obtained in step three above, e.g. "adb connect 192.168.44.1"). Now you're connected and can run adb commands (like push/pull, shell, install, etc.) on your computer via Bluetooth to your phone.
Mon, 18 Jan 2016A while back (2014) I entered a contest put on by the radio show To the Best of Our Knowledge called Three Minute Futures. The concept was to write a story that could be read aloud in three minutes or less, was about 500-600 words long, and was a "hard science fiction" story set in the near future. This was my submission: I Come To Awareness
Tue, 01 Dec 2015Unix (and unix-like systems, like Mac OS X and Linux) use a group of "hidden" files in your home directory to set up some functionality that you experience when using a shell. (A shell is a command-line interpreter/interface to the system, as opposed to a graphical interface. Power users generally love using the shell because you can do so much more and so much more easily than you can with the GUI point and click interface. The shell is also a programming language, so you can build more complex commands out of simpler ones.) Since the filesystem hides (by default) any files starting with the dot (.) character, these hidden files are often called "dot files". I've spent a lot of time working on my dot files over the years to get them to do certain things and make the shell behave in certain ways. I recently put my dot files up on github for all to see and ridicule. I have put some effort into writing good comments in the files, so you may be able to find something useful there. See the files on https://github.com/jlp78/dotfiles/ If you see something you don't understand, please feel free to ask. If you see something that I'm doing "wrong", feel free to "educate" me. If you see something you like and you want to lift it for your own use, feel free (not a bad idea to leave a comment in your own files saying where you got something from).
Tue, 24 Nov 2015by Jan L. Peterson
Tue, 25 Aug 2015I like Thunderbird. It works fairly well, lets me keep several e-mail boxes open and available, works decently with Gmail, and in general is a great program. Not today, though. Today, it's driving me crazy. I recently started a new job, and, as I proceeded to set up Thunderbird on a new laptop, I started encountering an odd behavior. For one of my accounts (an account that is not hosted by Gmail, but by Dovecot on a linode that I use). The odd behavior resulted in Thunderbird complaining every time I read a message on this non-Gmail account. Took a while to find it (it wasn't showing up in the Error Console on Thunderbird, but I found it in the Activity Manager under the Tools menu). Turns out Thunderbird was trying to retrieve X-GM-MSGID and X-GM-THRID from IMAP, but these extensions are specific to Gmail accounts. After much head scratching, I figured out that it was the fault of the Google Buttons Thunderbird extension that I had loaded. Seems the version that you get when browsing add ons is not actually compatible with current Thunderbird versions (even though it thinks it is). This old version is 0.5.0 (there is an 0.5.1, also, but it knows that it's not compatible with current versions of Thunderbird). On the developer's web site, you can download version 0.7.0b1, which doesn't have this problem. It was a simple matter to manually download and install this pre-released version and my annoying problem went away.
Wed, 24 Jul 2013I've taken to following quite a few web comics. Seems I'll get a pointer to a good funny strip and before I know it I've got to wade back through the archives and read it from the beginning. Here are some strips that have become my favorites over the last few years:
Check out some of these freely available web comics. If you've got any that you just love and have to read whenever a new one comes out, please feel free to mention it/them in the comments.
Mon, 10 Jun 2013There's been some discussion on the Interwebs lately about what people would like to see in the next mobile radio from Kenwood. I've had some thoughts about it myself, but they are more in line with a mobile/handheld hybrid. First, let me say that I own two radios, both Kenwoods. My first radio was a TH-F6A, a great little tri-bander with wide-band receive. This is a fabulous radio and met pretty much all of my needs for several years. I did, however, want to break into the digital modes (i.e. APRS) and finally decided to pick up the TH-D72. This radio is a little larger than the TH-F6A, and is a dual-band only (doesn't have the 1.25 m band), but it does have a built-in GPS receiver, TNC, and impressive APRS functionality. I think the ultimate (handheld) radio would include some aspects from both of these Kenwood models. Specifically, it would have the TNC and GPSr combination from the D72 and the 1.25 m band from the F6. I'd also love to see it in a "dockable" configuration for mobile use. Dockable? What does that mean? Well, for starters, I like to use my radio in the car, but I don't have a dedicated mobile rig. This means I have to either hope the 5W from my HT can make it through the faraday cage of my vehicle, or I have to use an external antenna (and disconnect and reconnect the HT's antenna whenever I get in/out of the car). Then, there's the speaker/mic connection. The HT has a port for a speaker/mic, but I don't normally use one when I'm operating as it's just more convenient to just hold the radio up to my face (gets the antenna where I want it to be, too). In the car, however, a separate mic would be a requirement, and an external speaker would also be a great benefit. Finally, I don't want to draw down the battery on the HT when I'm in the car, since I have access to a robust 12V power supply. I can use an external power adapter and either wire it directly to the car's battery or just use the cigar lighter port/12V outlet. If I want to also connect the TNC to my computer, I have to plug in the USB connection, too. So, how convenient is this? I get in the car, disconnect the antenna from my HT and hook up the external antenna cable, plug in the speaker/mic, plug in the external power adapter, and plug in the USB connection, then sit the radio somewhere where it won't slide off the console (clamp it into a holder or something). When I reach my destination, I have to reverse the procedure. I envision a docking connector that the HT snaps into. It could be mounted securely in the vehicle in a convenient location and be relatively stable. It would have built-in connections for power, speaker, mic, USB port (or even serial port) and antenna (and maybe even an external GPSr antenna, too). The radio would automatically select these output/input ports when it is docked, and switch back to the main (onboard) ports when undocked. I think this would be fairly easy to do for most ports... the only exception being maybe the antenna, but I did have an old cell phone that had an external antenna port on the back that you could hook up. You could even route the antenna line through an amplifier to get some kind of reasonable power out of your now mobile rig. The only other item that I could see as a valuable addition would be some kind of Bluetooth module. Ideally, it would support several profiles, including Hands-Free or Headset for speaker/mic replacement and a couple of Serial Port profiles, one for radio control and one for TNC access. Can you imagine the utility of a cordless speaker/mic?
Mon, 03 Jun 2013So I get an e-mail the other day. It's an "InMail" via LinkedIn (a social site for business relationships... I use it as a replacement for my basic resume and to keep in touch with former co-workers). The mail is not terribly interesting, it's along the lines of "I've got a client who is looking for someone with your skill set. Are you interested?" Now, I'm pretty comfortable at my current employer. I enjoy my job and I like the people I work with. The benefits are good, and the pay is quite reasonable for someone with 25+ years of experience. Never-the-less, it's always a good idea to keep your interview skills up as you never know what might happen in our industry, so I shoot an e-mail back to the recruiter. My mail is pretty terse, but it goes along the lines of "I might be interested... who is the client and what is the salary range they're targeting?" Minutes go by and I have another e-mail. "Can I call you?" Hmmm. No. I don't think that's necessarily a good idea. I shoot back an e-mail saying "I'd like to keep it to e-mail at this time." E-mail is great, because I have a record of what both sides said. With a phone call, I can keep some notes, but I don't have any real proof of what might or might not have been said. Recruiter-droid e-mails me back with a rather terse "I can't do a very good screen via e-mail." Now I'm tired of dealing with him. Is he trying to do a favor for me or is he asking for one from me? I mail him back again, trying to be very diplomatic, but making it clear what my point of view is. I think my mail went something like this: "Dude. There are some companies that I will not work for. If your client is one of them, I don't see any point in continuing to waste my time. In addition, my current salary is in the $xxxk range. If your client can't exceed that by a reasonable amount, I've already wasted more time than I should have. Just answer my two simple questions and I'll let you know if I want to continue talking or not." I never heard back from him. Pretty sure I don't want to work for a company that has to resort to recruiters of this caliber.
Tue, 17 Aug 2010
Upgrading To Ubuntu 9.10 Karmic Koala
I have been running Ubuntu 9.4, Jaunty Jackalope, on my laptop (an HP Pavilion tx2510). Recently, Ubuntu released version 9.10, an updated release. I started by using the excellent update-manager program. Update-manager took care of the heavy lifting, but it did have some drawbacks: 1. the upgrade utility was a little hard to deal with. Since Ubuntu updates each of it's packages independently, each package might have a configuration script that needs to be run. This means you have to sit and watch the machine during the whole multi-hour update process (well, technically, you don't have to sit and watch it while the download of new packages is in progress), so you can respond when you get prompted. I had three packages that prompted me for information during this process. 2. another issue here is if any system configuration files have been modified from their defaults (i.e., modified by the user), the upgrade offers to either keep the original or replace it with the new one. It shows you a diff of the two files, but it doesn't offer any kind of automated merge, or even to let you edit the file after the replacement. It did leave behind the old version of the file so I could go look at the diffs and make appropriate changes, but I had to find the files. They all end with names like .dpkg-old, so you can find them with a command like this: find / -name '*.dpkg-old' -print 3. after the upgrade, it seemed to take a few reboot cycles before everything "settled down" and started working well. For example, the first boot after the upgrade left the display just flashing for about five minutes. I hard-booted the machine after that and found the linux console (not the X console, but the console you access by pressing Ctrl-Alt-F1) had corrupted text. I could tell that the correct text was there, but the display was seriously messed up. I knew this had to be a transient problem because it only affected the first few vtys... vty8, that contains boot log messages, looked fine. This seemed to clear up after a few reboots and it's now working well. 4. sound on my machine quit working with the upgrade. I remembered having made some changes to get the sound system to work with Jaunty, but the upgrade wiped out those changes (see number 2 above). It took me a little time, but I found this page that walked me through exactly what I needed to do to get it working again... didn't even need to reboot! 5. third party APT repositories that I had added were automatically disabled by the upgrade, but there was no indication as to what applications were not upgraded because of these repos. I had to go back through and manually re-enable the ones I wanted. Now, not everything went poorly with this upgrade. Some things went exactly right. For example, I had recently purchased additional RAM for my system to bring it up to a full 4GB (it originally had 3GB when I purchased it). I had put the RAM in while still on the Jaunty release, but found that my WiFi connection became extremely unstable (as in, it would drop the connection after about 15 seconds, then try to re-establish it, which usually took about 35-40 seconds. Fifteen seconds later, it would drop again. Reverting to 3GB made the problem go away. Even with 4GB, Microsoft Vista did not have the problem, so I figured it was related to an interaction between the kernel and the (non-free) WiFi driver (from Broadcom). After the upgrade, even with 4GB, my WiFi is rock solid stable. All-in-all, I'm fairly satisfied with the upgrade. I imagine I'll be finding a few more oddities and glitches as I continue using the machine, but for now, it's working quite nicely. Thanks, Ubuntu! UPDATE: I recently updated this machine to Ubuntu 10.04. I tried to do it using Update Manager, and many things quit working correctly. Finally, I decided on the forklift upgrade option... I backed up my home directory and a copy of /etc, wiped it and re-installed the OS from scratch, and then restored my files and configs. The machine is working quite well under 10.04... the features and functionality pretty much worked out of the box without much tweaking.
Tue, 06 Apr 2010Recently, I took a training class at work (the training was on the JBoss framework, which is actually pretty cool, but that's beside the point). During the class, we did a lot of hands-on work, trying out different configurations, experimenting with various settings and modules. Each of us needed a computer to do our testing on, so the company provided each of us with a nice HP laptop for the duration of the class. A laptop running Microsoft Windows. I'm a Unix user. I've been one since about 1984, well before Microsoft even had a product called Windows. I'm pretty comfortable with Unix, and Unix-like operating systems (such as Linux). I'm a little less comfortable with Windows. Oh, I can use a Windows system just fine. Windows provides a very usable environment, it's just not the environment that I prefer. Since we had access to the laptops for a day before the class was scheduled to begin, I took advantage of that access to install some software that I've found that makes Windows a little more usable for me. See the details after the break.
Fri, 22 Jan 2010I use the excellent Ubuntu linux distribution at work. While I love linux, there are some tools that it just doesn't provide. One of these is Toad, a tool for interacting with a RDBMS that allows rapid testing of SQL statements, database exploration, and other useful features. Toad, unfortunately, is only available on Windows. Luckily, there is a freeware software package that provides most of the functionality of Toad. This tool is TOra. TOra provides an interface very similar to Toad, but has the advantages of being free and available on linux (and other Unix-like operating systems). Sadly, the build of TOra installed via Ubuntu's packaging utilities does not include support for Oracle, an incredibly capable RDBMS. Since I use Oracle at work (in addition to other database systems such as PostgreSQL and MySQL), I really wanted Oracle support compiled into my copy of TOra. Surely, I thought, other people have wanted to do this before. I promptly accessed Google to search for what I needed. I found several examples, but none of them quite did exactly what I needed. While working out what was needed, I decided to keep notes so I could share my experience with others and perhaps help someone else to avoid having to do the research and experimentation that I did. UPDATE: the build procedure has changed for Ubuntu 9.10 thanks to a new streamlined Debian build system. The original procedure worked great on Ubuntu 8.04, but not so much on 9.10. I've added some notes inline with the procedure explaining the changes.
Mon, 26 Oct 2009Okay, so I like Star Trek. I've liked it for a long time, ever since watching TOS in syndication in the 1970's. It was good. It was fun. It was (occasionally) deep, especially for a 10-14 year old kid. When I heard that a new Star Trek series was going to be coming out (the "Next Generation," no less), I was ecstatic! The series started. It was... well, there's no nice way to put this, rather bad. At least the first few episodes. Maybe the whole first season. It got better. It did, really.
Recently, I saw mention that Wil
Wheaton, the actor who played Wesley
Crusher on TNG, would be making a guest appearance on The Big Bang
Theory, a show that I hadn't watched, but had been considering
starting to watch (I've made the plunge now and borrowed the first
season on DVD from a friend). I saw the mention in the context of
a pointer to Wil
Wheaton's blog, WWdN:
In Exile. Checking out the blog, I discovered that Mr.
Wheaton Anyway, WW is writing this book, Memories of the Future, Volume One, which contains his anecdotes and memories of each episode in the first half of the first year of the series. WW is, presumably to plug his book, publishing a podcast of excerpts and commentary on the episodes, kind of like an abridged version of the book. He's posting these podcasts on a weekly basis and I've really been enjoying them... possibly even well enough to go out and buy the book (gasp!). I highly recommend that anyone who likes Star Trek go right over to Wil Wheaton's blog and download all of the episodes of "Memories of the Futurecast" and listen to them. Do it now. Now. Okay... now!
Fri, 23 Oct 2009I've used VNC a lot to connect to remote displays for remote management. It generally works very well. There are issues, however, in running it over a high-latency network (such as the Internet). Recently, I heard about a mechanism called FreeNX that gives much better performance over such links by using a local engine to cache and respond to the repetitive small packet traffic generated by X11. I started by following the excellent FreeNX guide for Ubuntu. This procedure walked me through a basic FreeNX installation, but there were still some problems that I was encountering. I kept getting the message "Function -c not implemented yet" when ever I tried to connect with the nxclient. I finally figured out that the issue was related to how FreeNX was trying to start the server. I used the watch command to see just what command was being executed (like this: watch -n 1 "ps -fwwlu nx"). It revealed that the FreeNX login was trying to run this command: "/usr/bin/nxserver -c /usr/lib/nxserver". Note the difference between /usr/bin/nxserver and /usr/lib/nxserver. Finally, after much searching, I found the culprit in the /usr/bin/freenx-server script. I discovered this line of code:
[ -z "$*" -o "$*" = "-c ${PATH_BIN}/nxserver" ] && SERVER_MODE="1"
Obviously, PATH_BIN wasn't /usr/lib, so this
wasn't matching. This meant that the command fell through and ultimately
the "-c" argument wasn't being processed, leading to the error message
as described above.
As a quick test, I modified this line of code to reference /usr/lib/nxserver directly (instead of trying to use PATH_BIN), and voila! I was able to get a session up and running. Now on to the real project... trying to get it to access my already-logged-in session. But that's for another time.
Wed, 21 Oct 2009Okay, so hate is probably a little strong. "Why I get annoyed by Linux" would probably be more accurate. Today, I was encountering a strange error message. The message included a number, which I thought might indicate an errno value. errno is a commonly used C-language construct. The C library will often leave an error code in the errno global variable when it encounters some type of problem. These error numbers are well defined and are (in typical Unix fashion) listed in an include file. On a normal Unix system I'd take a quick glance at /usr/include/sys/errno.h (or maybe /usr/include/errno.h) and find exactly what I need. On Linux, however, it goes something like this:
I love Linux. I really do. Please, continue to drink the Kool-Aid™.
Mon, 19 Oct 2009
Mon, 10 Aug 2009
World's Smallest Political Quiz
My dad sent me a link to this. It is the World's Smallest Political Quiz. Now, my dad is a Republican, and I've always considered myself more of a Libertarian, although I will often vote on either the Democrat side or the Republican side of a particular issue. My own personal political views can be summed up fairly easily:
I took the quiz and here is where I ended up:
I think that's pretty accurate. I've included my own answers to the questions below, along with my reasoning for each answer. Go take the test yourself before you read any further.
Thu, 30 Jul 2009Wow. What a struggle. I can't believe how hard it was to find and fix some window behavior in Gnome. Here's some background: I'm a Unix user from way back (I've been using it since about 1984... before there were windowing systems on *nix machines). When I first started using the X Window system (1988-ish), the window manager of choice was twm. If you've ever used twm, you know that it's an extremely minimalist window system. The main points about twm are that when you point the mouse at a window, that window gets the focus (i.e., that is the window that keyboard activity will be directed to). This behavior is different from what you might expect if you normally use Microsoft Windows, where you have to click in a window (or on the title bar) to be able to type in it (and yes, there are some registry hacks and things like TweakUI that let you get "focus follows mouse" behavior, but they're not the default for Windows and most people will never change this behavior). The next window manager I used was mwm (the Motif window manager), which I really liked. It provided relatively good looking decorations for windows, mostly stayed out of my way, and let me configure things to behave the way I wanted. Over the next several years, I migrated from one window manager to another, trying out the latest and greatest and then, generally, going back to mwm. Then I discovered fvwm. Fvwm gave me very similar functionality to mwm, but without all the Motif baggage. It seemed to be the best of both worlds. I've been using it almost exclusively for more than fifteen years. Recently, I installed Ubuntu on my laptop. Ubuntu comes with the Gnome desktop. Thinking I should maybe get with the times, I decided to use the default Gnome window manager (metacity) and see how it worked. Gnome desktop looked pretty good on my laptop... it gave me some functionality (control panels, in particular) that I wasn't used to having with fvwm. I could configure it to behave almost exactly how I wanted it to. I could set up "focus follows mouse" (known in Gnome as "sloppy focus"). I could make it not raise the window unless I clicked on it (so I could type into a window that was not on the top of the stack). But I couldn't find a preference to make it not raise the window when I clicked in it (for example, to select which text box in a browser to type into). Arrgghhh! The frustration of having windows jump to the top when I didn't want them to was almost enough for me to dump metacity and go back to fvwm! I thought about it for a while and decided that there simply must be a way to make it do what I wanted. I started researching the problem. I found this gnome bug from 2002 that described my problem exactly. Unfortunately, reading through the loooong list of comments, I found that the behavior I wanted had been implemented originally, but that behavior had been removed in favor of the (what I considered as "broken") current behavior! I did find mention of adding an option to metacity to have it do what I wanted, but the sum total of the comments were that the developer wasn't going to do that.
I thought about it... the last comment had been over four years ago.
I looked at my Gnome preferences.... It wasn't exposed
in the default window preferences, but it was implemented. I was able
to turn it on using Whew.
Sat, 25 Jul 2009I like reading. I love books. I love free stuff. I love Project Gutenberg. If you're not familiar with it, Project Gutenberg is a project to take books (and other media) that are in the public domain or otherwise out of copyright, transcribe them, and put them online in a freely available format. Project Gutenberg currently has over 30,000 completely free books available, in several formats. The format I prefer is Plucker format, which I read with the Plucker Viewer on my Palm T|X. Project Gutenberg offers downloads in Plucker format, but these downloads do not include any images that might be part of the eBook. I use the plucker-build utility to download the HTML version of the eBook (which typically does include the images) and then convert it to Plucker format on my own machine. I've written a little shell script to simplify the conversion process that I call gutenpluck. gutenpluck requires that you already have plucker-build installed, as well as wget. You give it a list of numeric text identifiers (numbers that Project Gutenberg uses to refer to an eBook). It retrieves the information page for the book, extracts the creator and title, then constructs a URI to reference the HTML format of the book. It passes this information to plucker-build, along with some other args to include the title and author in the Plucker format file. When plucker-build is finished, it will leave the file in your current working directory and clean up it's temporary files. Here's an example of how it works:
jlp@galaxy:~ 271 bash$ gutenpluck 29503 processing 29503 extracted author: Pohl, Frederik, 1919- extracted title: The Hated derived URI: http://www.gutenberg.org/files/29503/29503-h/29503-h.htm I generally find out about new eBooks on Project Gutenberg's site by using their RSS feed: http://www.gutenberg.org/feeds/today.rss.
Mon, 20 Jul 2009Added commenting capability (and trackbacks) via Frank Hecker's excellent feedback plugin. Currently, I have all comments set to require moderation, which means I'll have to approve each one before it shows up on the site. After I get a feel for how many comments I'm getting, I'll probably loosen this up.
Sat, 18 Jul 2009I'm trying out the the blox formatting plugin for Blosxom to simplify blogging. It supports easy bold, italics, and underlining, as well as various other wiki-like formatting. It also automatically flags paragraphs so I don't have to specify the paragraph tags in my text... that alone makes it worth trying out. :-)
Here's a test using a category. I want to make sure I can set up RSS subscriptions directly to specific categories, so I need one to work with.
Testing, Testing, One, Two, Three...
I'm testing out some blogging software (I'm experimenting with Blosxom), as I have some things to say and didn't have anywhere to say them. Things to expect here are notes on my experiences, both computer related and otherwise, pictures, news, links to things I find interesting, and whatever else strikes my fancy. For testing purposes, I needed this paragraph to be a little longer. It has to be long enough to wrap effectively. If you see something you like, or something that helps you in some way, drop me a line and let me know.
|
Hierarchy | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||