Archive | Solaris RSS for this section

The Case of the Missing Tip

For the past 10 years or so of my career, I’ve mostly been employed as a sysadmin. During this time, I spend a great deal of time working with Solaris 10. Solaris 10 has a command called tip. Tip can be used for basic serial communications. You basically just pass it a baud rate, and a serial device, and it connects the STDIN and STDOUT.

Working with Arduino, sometimes you want to connect to the serial port and communicate with it. There is a whole Serial library for reading from and writing to Arduino via the usb cable. The Arduino IDE also comes with a serial monitor for use. However, using NetBeans, I find it kind of silly opening Arduino IDE just to use the serial monitor. Unfortunately, tip seems to be a Solaris-only utility. At a loss, I turned to google.

Google Proves Unhelpful

Shocking, I know. The number one solution to this is “Well, just write something in C!” I know what you’re thinking, and yes it did occur to me that this would be right up my alley. However, I know there is a utility that exists that does exactly what I want. In the interest of not re-inventing the wheel, I search on. The number two solution to the problem is a program called Minicom. Minicom is a fairly heavy menu-driven program that does serial comms. From what I can tell, it seems to be more like Microsoft’s Hyper Terminal than tip. Since I’m just looking for a simple command line utility, I move on.

Finally, after much searching, I come across my solution. There is a program called cu that seems to function exactly like tip. It even share the same disconnect code: ~. to hang up a connection. Even better: it’s in the repositories!

On an Ubuntu system, all you need to do is:

sudo apt-get install cu

…and you’re good to go. To connect is simple, just enter:

cu -l /dev/ttyWHATEVER -s BAUD_RATE

…and you’ll connect to your Arduino. To hang up, just enter ~. and it will disconnect (Ctrl+C and Ctrl+D have no effect).

In Defense of Multiple Partitions in Linux

If you’ve ever installed Linux or UNIX, you’ve surely come across this idea: installing across several partitions. These days it’s not so common in many distros, but just a few years back everybody wanted you to do it. Reccommended partition tables included: /, /var, /var/log, /usr, /boot, /home, /tmp, SWAP, and /everyone/and/their/mother. The silliness knew no end. Lately, in the age of Ubuntu, distros have decided that this list could be reduced to: /, /boot and SWAP. I’m here to urge you not to go along with this.

Why not?

I’m glad you asked. If you do a quick google search for why you should have multiple partitions like this, you’ll see the usual enterprisey reasons. The words “security” and “disk quotas” will come up often. You might think that as an end user you don’t really care about these things. You’d probably be right. Indeed, in this day and age you tend to only see these crazy partitions schemes server operings systems like Solaris.

There is one thing that typical Linux end users do tend to do though: switch distros. With so many choices, it’s easy to want to try a different one. Maybe you’re tired of replacing Iceweasel with real Firefox, so you switch to Ubuntu. Maybe Mark Shuttleworth spoke ill of your mother, so you switch to Mint. Maybe you want real Java, which only comes packaged in a .rpm, so you switch to Fedora. Either way, if all your filesystems are in one partition you’ll be sorry.

One of the historical problems with Linux that has yet to be solved is cleanly upgrading and replacing distros. Some try to support in-place upgrades, but the process still involves prayer. Others have extremely convoluted processes that are much harder than starting from scratch. My personal home server is still running Debian Squeeze because the upgrade process sounds like so much work.

Oh Dear. What Should I Do?

The solution is simple. There is no need for the complicated partition schemes of yore. All you need to do is partition your system like so: /, /boot, SWAP, and /home. If you partition your system like this, then switching distros is simple. All you need to do is not touch this partition. You will be able to delete and recreate /, /boot, and SWAP, and leave /home untouched. This will ensure your data is safe. Obviously backups are in order when messing with partitions, but it’s a pretty safe bet if you decide to gamble on it. So long as you don’t use some crazy filesystem for /home, the new distro should be able to mount it seamlessly.

%d bloggers like this: