For many yers I have used FreeBSD nearly exclusively. In the BSD tradition, root is pretty well protected — root can not log in from remote unless you put some effort into hooking that up, and local users can only run su if they are members of the wheel group. Because of the nifty sudo tool and my own disinterest in memorizing any more passwords than necessary, I have tended to remain unconcerned with the root password, setting it and storing the thing somewhere, which is a pain, or setting it to something dumb, or just not setting it, depending on the security needs of a given system.
I recently learned a painful lesson from Fedora: not all unices are as protective of the root user. Sure, I knew that in Linux any local user can run su, but OpenSSH isn’t going to allow people to log in as root, right? Wrong!(more…)
If you’re like me, you run Firefox on FreeBSD, or maybe Linux. And you use a classy nice window environment like fvwm2. And every time you start Firefox it asks can it be the default browser, and you say yes … like you use anything else? (MSIE4-Solaris, anyone?) And every time you start, it asks again . . . stupid!
I just saw this solution posted to FreeBSD-questions: (more…)
I recently had a need for two quick temperature conversion algorithms in a Perl script. I asked Google, but did not immediately get a great answer, so here’s my answer:
# Two quick helper functions: CtoF and FtoC
sub CtoF { my $c = shift; $c =~ s/[^\d\.]//g; return (9/5)*($c+32); }
sub FtoC { my $f = shift; $f =~ s/[^\d\.]//g; return (5/9)*($f-32); }
The regex is to untaint the input datum, and could be eliminated if you know that your variable is clean. This code has been incorporated into a systems health and data trend monitoring script for FreeBSD. For the vaguely interested, here’s today’s perldoc: (more…)
Q: How do you measure swap utilization in FreeBSD? (Assuming you are writing a script to gather performance metrics.)
A: If you are writing a C program, check kvm_getswapinfo(3) and maybe take a gander at the bottom of /usr/src/usr.bin/top/machine.c.
A: If you are writing a Perl script:
Measure swap activity: sysctl vm.stats.vm.v_swapin vm.stats.vm.v_swapout vm.stats.vm.v_swappgsin vm.stats.vm.v_swappgsout
(I believe these results are COUNTER type values, like you get from netstat -inb. You could establish “swap activity” by plotting changes in this value.)
I am an NPR junkie, and my new place gets awful reception. And for a long time I have admired TiVo and wondered if my life might not be better if I had a DVR for NPR programs. Add to that KQED’s obnoxious plugin/popup window and the fact that I use an older version of RealAudio to avoid Spyware, which stutters and rebuffers all the time, and I have enough motivation to rig up something different.
I have rigged up a simple system to schedule rips of programs broadcast on the KQED audio stream in to easily manageable .mp3 files. If I had one of them iPod thingies I could even listen to the radio programs on the bus. I might even get around to warezing this to interested friends via BitTorrent and CSS, which would leave us another technical explanation. (more…)
I have also figured out how to convert the Windows Media Player stream in to mp3 files, and may set up a system to “record” programs on a regular schedule, at which point I can listen to public radio as I would watch TV on a DVR. (Radio TiVo!)
If anyone might be interested in getting in on a non-RealAudio “NPR audio archive” via a bittorrent setup, I’d love to hear from you.
Skype is an Instant Messenger client with a twist — if you hook up a microphone you can CALL each other. Like a telephone, only you can see if your buddy is online before you interrupt them. The audio quality is very good, and clients are available for Windows, OS X, and Linux. The Linux client works on FreeBSD.
Even nicer, you can dial out on Skype, for exceedingly low rates. It costs us about 3c a minute to call Japan, though we’re going to get Noriko-san on Skype soon enough, and then the calls will be free.
If anyone wants to try it out, you can ring me at dannymanTM.
To answer a question you may have on your mind, Skype is not a telephone, so it is different from a VOIP service, where they send you a telephone that you hook up to your broadband. Instead, Skype is a way of making telephone calls from your computer. Unfortunately, people can not yet dial in to someone using Skype.
For me, though, it is as if the Internet has come full-circle: we used to have to find a cheap local number to dial in to the Internet on our existing telephone. Now, we are finding cheap services to make telephone calls on our existing Internet connection. Yow!
A new feature of FreeBSD 5.3 is the ability to set up a software mirror of your system disk. This allows you to boot off either of a pair of hard disks, which will then function as a RAID1, which will ensure system uptime in the face of a single disk failure. (more…)
This is the second time I am going to use NDIS to allow FreeBSD to load the Windows drivers for a Dell laptop to access the built-in wireless. As this is my second time, it is good to make my own crib sheet of what I have to do, so I can do it even quicker next time, and because you, the reader, might find yourself here thanks to Google.
In both cases that I have done this I have been starting with FreeBSD 5.3. According to this crib sheet, you need to be fairly current with 5.x to do this. That crib sheet is also my main source of reference.
If you have already done this to your system and find yourself having to re-do NDIS after an upgrade, you may find my “rendis” script handy.
The find command generates a list of .mp3 files in your $HOME/mp3s, and that mpg123 command says play songs randomly (-Z) from the list (-@) that I am feeding you via stdin. (-@ -)
To skip a song you are not enjoying, press control-C.
My fancy new Dell laptop and FreeBSD are a bit of an odd couple. I haven’t tried yet, but apparently I could get the trackpad, nub and mouse keys working through something called “Project Evil” that supports Windows drivers under FreeBSD. Entering suspend mode causes the computer to reboot, this in part because apparently Dell has messed up their implementation of standards-compliant power management, but whatever. (more…)
I just stumbled on this. My e-mail server is in California, but I am in Chicago. However, I launched my current screen before we ran tzsetup on the server, so my IRC window and mutt were displaying times in GMT.
Now the server is displaying times in Pacific time. Yet for my login shells it is displaying in Central time. How? (more…)
lnk.to is back online. I was even able to restore the database. I was skeptical, at first, because I could not understand quite how the Postgres database was laid out, filesystem-wise. And the install provided was different in layout than the install that had preceded it. How much fighting with Postgres would be required? (more…)