FreeBSD, Technical

Shaddup, Firefox!

Link: https://dannyman.toldme.com/2005/10/04/shaddup-firefox/

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…)

Feedback Welcome

Excerpts, FreeBSD, Technical

Perl: Convert Celsius and Fahrenheit

Link: https://dannyman.toldme.com/2005/06/11/perl-convert-celsius-and-fahrenheit/

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…)


FreeBSD, Technical

FAQ: How do you measure swap utilization in FreeBSD?

Link: https://dannyman.toldme.com/2005/04/05/freebsd-faq-measure-swap/

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.)

Measure swap size:

0-13:38 djh@mito ~> swapinfo
Device          1K-blocks     Used    Avail Capacity
/dev/ad0s1b       1022224        0  1022224     0%
0-13:38 djh@mito ~> swapctl -l
Device:       1024-blocks     Used:
/dev/ad0s1b     1022224         0

If you are trying to accomodate n+1 swap devices, try this:

0-13:44 djh@mito ~> swapctl -lsk
Device:       1024-blocks      Used:
/dev/ad0s1b      1022224          0
Total:           1022224          0

Feedback Welcome

FreeBSD, Technical

HOWTO: Archive Audio Streams in to mp3 Files

Link: https://dannyman.toldme.com/2005/02/27/howto-convert-streams-mp3/

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…)


FreeBSD, Technical

FAQ: Stream KQED on FreeBSD

Link: https://dannyman.toldme.com/2005/02/22/faq-stream-kqed-freebsd/

If you want to listen to KQED using FreeBSD, install mplayer:

mplayer mms://wmbcast.kqed.speedera.net/wmbcast.kqed/wmbcast_kqed_jan032006_0957_103495

UPDATE: I just discovered the -playlist feature. So, this works even better:

mplayer -playlist http://www.kqed.org/w/streamingfiles/kqed_wmp.asx

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.

1 Comment

FreeBSD, Technology, Testimonials


Link: https://dannyman.toldme.com/2005/02/16/skype/

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!

Feedback Welcome

FreeBSD, Technical

FreeBSD HOWTO: Software Mirror System Disk

Link: https://dannyman.toldme.com/2005/01/24/freebsd-howto-gmirror-system/

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…)


FreeBSD, Technical

HOWTO: NDISulate Windows Drivers on FreeBSD

Link: https://dannyman.toldme.com/2005/01/05/freebsd-howto-ndisulate-windows-drivers/

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.

If you have already done this to your system, and are tracking -STABLE I have read that you no longer have to follow these steps, but merely run:
ndisgen (more…)


FreeBSD, Technical

HOWTO: Play random mp3s with mpg123

Link: https://dannyman.toldme.com/2004/12/28/howto-mpg123-random-mp3s/

Assuming your mp3 collection is in $HOME/mp3s:

find $HOME/mp3s -name '*.mp3' | mpg123 -Z -@ -

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.


1 Comment

FreeBSD, Technical

FreeBSD and Laptops, Windows and rsync Backups

Link: https://dannyman.toldme.com/2004/12/07/frebsd-laptops-windows-backups/

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…)

Feedback Welcome

FreeBSD, Technical

FreeBSD: Overriding the System Timezone

Link: https://dannyman.toldme.com/2004/11/01/freebsd-user-timezone/

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…)

Feedback Welcome

FreeBSD, Technical

PostgreSQL Database Restored from Filesystem

Link: https://dannyman.toldme.com/2004/10/28/postgresql-database-restored-from-filesystem/

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…)

1 Comment

FreeBSD, Technical

Dovecot: IMAP Server Sounds Good (So Far)

Link: https://dannyman.toldme.com/2004/10/19/dovecot-sounds-good/

I’ve done UW-IMAP, Cyrus imap and Courier. Dovecot sounds like it took the best of all three:
(Thanks, Photo Matt)


Feedback Welcome

FreeBSD, Technical

Latest Firefox Port on FreeBSD

Link: https://dannyman.toldme.com/2004/10/14/firefox-1-port-freebsd/

From the bleeding edge — get it working thusly:

  1. portupgrade
  2. Backup your bookmarks.html
  3. Remove your .mozilla directory
  4. sudo firefox to set things up
  5. chown -R `whoami` .mozilla
  6. Put your bookmarks.html back
  7. Run firefox under your own UID. :)
  8. And reinstall your preferred theme and all your favorite extensions.

At least it works well under Windows.

1 Comment

FreeBSD, Technical

HOWTO: Create a Tar Archive From a File List

Link: https://dannyman.toldme.com/2004/09/14/howto-create-tar-archive-from-manifest/

I had a list of files that someone requested. I wanted to put them in a tar archive, but the tar on the box doesn’t have an option to add a list of files. Huh. Well, this is quick and dirty, and will choke if you have any space in the filenames, but it met my purposes: (more…)


« Newer Stuff . . . Older Stuff »
Site Archive