Thursday, August 25, 2005

Seeing all processes

'ps' is, as I'm sure you all know, a very useful command. 'ps' stands for 'process status' and it gives you information on running processes, and has almost as many options as ls. My standard ps bash alias is :




alias ps='ps -afuxww'


This shows all (-a) processes, swapped (-f, but only as root) processes, lots of information (-u), include "headless" apps, like daemons and the like (-x), and do it as wide as you can get (-w says 132 columns, -ww says use it as wide as you need).



Turns out, there are a couple of sysctl options that make ps more secure by not allowing "normal" users to show everything that is running. One of them is mentioned in the man page, security.bsd.see_other_uids (see the entry for the -a option). Kevin on the freebsd questions mailing list gives a cool little demo for setting and unsetting it from the commandline:


# sysctl -a | grep other_uid
security.bsd.see_other_uids: 1

# sudo sysctl security.bsd.see_other_uids=0
security.bsd.see_other_uids: 1 -> 0

# sysctl -a | grep other_uid
security.bsd.see_other_uids: 0

# sudo sysctl security.bsd.see_other_uids=1
security.bsd.see_other_uids: 0 -> 1

# sysctl -a | grep other_uid
security.bsd.see_other_uids: 1


But that's a 5.x option. The 4.x option is kern.ps_showallprocs - pretty straight forward name there. And to set this so that it gets correctly set every boot time, you put it in the /etc/sysctl.conf file:


kern.ps_showallprocs=1


ps (5.x)

ps (4.x)





Wednesday, August 24, 2005

Yet Another Boot Manager

There are a million boot managers out there. A boot manager, in case you didn't know, is something the OS geeks like myself use to select which OS to boot when the computer is restarted. It can be very useful for testing purposes. Say you want to see if your software works on Win98, or on some flavor of Linux. If you have the hard drive space, you create a new partition and install a completely standalong OS.

This is different than an emulator like Virtual PC or, even better, VMWare. Emulators run like just another program, and can bring the buffest hardware to its knees.

By using a boot manager, you can get a truly pristine setup. FreeBSD has its own boot manager - most non-Windows OSes will install their own, allowing you to choose between the dark side and the side of light and goodness. But the native ones are generally pretty basic, and don't give you things like partition managers, wizards, graphical interfaces, etc.

I've used a couple in my time. I used to be a huge fan of System Commander. I used it from version 1 up until last year, and was very happy with it. Easy to use, very smart, a great product.

But last year I started running into plenty of problems with it. The display would be garbled, and it just wouldn't work. I got less than satisfactory help from the VCom folks, so I started looking around.

Now I use BootIt NG from Terrabyte Unlimited. A shareware product that has worked very well for me. It's a little less easy to use, but has proven to be very powerful. While you're at the site, be sure to check out other, Windows, freeware utilities like BurnCDCC, which is a very easy to use ISO burner.

There are some freeware ones out there too. Grub is a standard one in the Linux world.

Here is GAG, a freeware one. I'll give it a shot on my test machine and see how it does:

The home page of GAG - main

Emacs delete key

Something that I never quite got working right was the key mapping on my FreeBSD box, at least when I was working locally and using Emacs. The normal key mapping has the Backspace key generating a Ctrl-h, which translate to a call for help in Emacs. But you really want it to behave by deleting the previous character, which is the default for the DEL key in Emacs. Why? Who knows.

It's not quite as important now for me, because I use a terminal program to connect to my remotely hosted box now, and it does the remapping for me.

Anyway, there's a function that plays some serious games with this and does it in a simpler way than mucking about with the translate table. Check out 'normal-erase-is-backspace-mode' - very interesting routine.

Man, Emacs has almost as many nooks and crannies as FreeBSD!


Monday, July 18, 2005

Cable modem tricks

I recently moved (back) to a cable modem, after being, pretty happily, with Speakeasy DSL. I had used cable modems since they first came out, but moved to DSL because of the much faster upload speeds. As I work for a video conferencing software company (inSORS), upload speeds are as important as download ones. And I could get a 1mb SDSL (synchronous DSL, so upload & download speeds were the same), I made the switch.



However, the cost was pretty steep (US$200 per month), even if my company was paying for it. Now that cable modems are up to 768kpbs upload speeds (and 6mb down!), for about $50 a month, the switch was pretty much a no brainer. I've always told folks that asked that cable is, in general, a much more economically feasible broadband alternative than DSL. For the same speeds, DSL is generally twice as much. Plus you have to deal with two or three different folks (Speakeasy was my provider, Covad did the work and it was actually Verizons "copper" wire in the end).



But I miss Speakeasy. I got some cool perks (free download service, game server time, etc), as well as 4 static IP addresses. For reasons unknown to me and even to folks who know a million times more than me, cable companies have always gone with a dynamic IP address. While it almost never seems to change, they are free to give you a different IP address at any time. So running servers and the like is a little more difficult. You can go with a dynamic dhs host (I used to use TZO), it's still much more of a pain. Speakeasy was very server friendly. Instead, I relocated my servers to my friend's ISP (MV.COM if you're interested), and solved all kinds of problems that way!



Anyway, here's a cool page with lots of cable modem tips. I recently found out that the IP address 192.168.100.1 connects to my cable modem and shows some basic info about it. That's easy and this page shows even more stuff like that.



Cable Modem Troubleshooting Tips: IP addresses



Monday, July 11, 2005

Practice Healthy Computing

I've been looking for something to keep a more active watch on my server, which is now kept remotely. Here's one possiblity. I need to find out if the motherboard has any of the supported chips, though.



Port description for sysutils/healthd



Script for setting up internet sharing

Here's a script that will help set up your machine by asking questions about your internet sharing and firewalling. Looks pretty cool:


IPFilter "automagic' script for FreeBSD / Roq.com