dannyman.toldme.com


Technical

HOWTO: Use a monospace font in GMail

Link: https://dannyman.toldme.com/2007/03/08/gmail-fixed-width/

2018-08-23 Update: It looks like Stylish has been barred from Chrome. Here’s an alternate extension.

2014-09-05 Update: Revised my Stylish answer

2012-01-09 Update: Note that pimp-your-chrome no longer works due to new Gmail style . . .

2011-04-06 Update: Added some additional options . . .

So, I have mixed feelings about GMail, but it is mostly good enough. However, if you are a system administrator, you find that the ability to render plaintext messages in a monospace font is really really important. Messages like this can get very annoying:

gmail-default

It is pretty lame that after these few years, GMail still has no feature to set your preferred font. But that doesn’t have to stop you! These days (2011) there are a few ways to achieve a fixed-width font in Gmail:

gmail-fixed

(more…)

5 Comments


Technical, Technology, Testimonials

Rotating Rotating Rotating

Link: https://dannyman.toldme.com/2006/12/29/jpeg-exif-autorotate/

My last camera had a special sensor in it so it could mark the picture it took with Exif metadata indicating the correct orientation. I set my Flickr account to “auto-rotate” the images and everything was groovy, except Windows and the Macintosh screensaver don’t know for EXIF metadata, so some pictures stay sideways when viewed on my computers.

In my new camera, I have to run through my pictures and manually set the rotation before I offload them to my computer. Again, this because the Windows explorer and picture viewer doohickey, which is otherwise pretty neat, doesn’t grok Exif metadata, so if I use Windows to rotate my photos, I will suffer generational loss on my JPEGs.

Anyway, rotating images within the camera is pretty easy, so I just do that before I offload. For Windows, I Googled and found this awesome little utility, that will go through and rotate your images, losslessly, based on the orientation set in the Exif on the camera. You just right-click on an image, or a directory of images, and it will go through and rotate all your pictures just right once and for all!

Well, until you upload the rotated images to Flickr. If you have enabled auto-rotation in Flickr, and auto-rotate your images the right way beforehand, then Flickr will rotate your images again! At least, this happened to me!

So, I turned off Flickr auto-rotate, and from now on, I’ll set my image orientation in the camera before I transfer to Windows, and on Windows, I’ll right-click and auto-rotate before uploading to Flickr.

Of course, this would all be easier if the Windows explorer supported lossless rotation. At least it warns you that it doesn’t when you try to rotate an image. You would think that if they bothered to warn you they could have just stuck a summer intern on the project. Oh well.

2 Comments


Technical

Thunderbird Hotkeys?

Link: https://dannyman.toldme.com/2006/12/26/thunderbird-hotkeys/

Just thinking out loud here after some casual Googling left me unsatisfied . . .

I like Thunderbird, mostly, but while it has an extensions interface, I am finding it lacking for basic customization. For example, I like to toss e-mails in an “archive” folder . . . but as far as I can tell I have to drag messages to the folder every time I want to archive them! I dug around and found the “file” button . . . but that thing is just awful! I’d like to . . . press “a” or something, or click an icon, and get the mail archived that way. (Like, to delete a message I press “delete” . . . eh?)

Has anyone found a useful configuration option / extension / doohickey to realize this stuff? Or should I re-acquaint myself with mutt for e-mail triage?

1 Comment


Technical, Technology, Testimonials

Digital Image Recovery: PhotoRescue

Link: https://dannyman.toldme.com/2006/12/12/photorescue-recover-digital-images/

Well, I owe a plug, here . . . and a reminder note for myself if this happens again!

My third Canon camera has suffered a death comparable to my second Canon camera. So, I ordered myself a Christmas present today: a Fujifilm FinePix F30 — should be here Wednesday!

Anyway, one thing my second Canon camera did for a very long time was to EAT pictures I had taken. I tried multiple cards but they would just randomly get corrupted in the camera, and Canon went to great lengths to presume that the problem was with me, and not with their camera. (They got sued for doing that–yay class actions!) I am still bugged that I lost pictures of Clapham Junction and of the Eiffel Tower! Grr! Anyway, when I got to Thailand I slowed down enough to find a work-around to the problem of my second Canon: PhotoRescue! (more…)

2 Comments


Linux, Technical

HOWTO: Audit User Crontabs

Link: https://dannyman.toldme.com/2006/11/29/crontab-l-u-star/

For production systems, I think it is best to use a single, centralized /etc/crontab, which simplifies the job of tracking batch processes. On a production system, batch scripts should be sufficiently robust such that if they are resource or lock-intensive, they make sure everything is okay before they get to work. Stuff like user crons and fcrontab can live in your development and corporate servers.

Of course, sometimes you inherit production systems with people who don’t think like you do. You’ll need to review what random user crons are running on each system. With any luck you’ll have a sane OS that keeps the user crontabs in a well-documented location. (FreeBSD? /var/cron/tabs . . . SuSE . . . still not sure . . .) Of course, luck is a fickle mistress, and sometimes you have to do it the evil way:

> cat /etc/passwd | awk -F : '{print "echo crontabs for user "$1"\ncrontab -l -u "$1"\n"}' > /tmp/crontabs.sh
> head /tmp/crontabs.sh
echo crontabs for user root
crontab -l -u root
 
echo crontabs for user bin
crontab -l -u bin
 
echo crontabs for user daemon
crontab -l -u daemon
 
echo crontabs for user lp
> sudo sh /tmp/crontabs.sh | mail -s "`hostname` crontabs" $USER

If you are borrowing my “recipe” you will likely want to put your e-mail address where it says $USER . . . and, you may have to do the same for fcron as well. Bah!

cat /etc/passwd | awk -F : '{print "echo fcrontabs for user "$1"\n/usr/local/bin/fcrontab -l -u "$1"\n"}' > /tmp/fcrontabs.sh
sudo sh /tmp/fcrontabs.sh | mail -s "`hostname` fcrontabs" $USER

Feedback Welcome


Linux, Technical

Linux HOWTO: Add Temporary File to Swap

Link: https://dannyman.toldme.com/2006/10/24/howto-swapon-file/

Scenario: a Linux system with two drives. The system was built with resiliency as a priority, but availability is not critical. So, the filesystems were mounted atop md raid1 for resiliency, and the swap was striped across an md raid0 for performance.

One disk failed and was removed from the system. System returns to service on remaining drive until RMA is completed. Users are informed that the system is available but does not have swap space. Consensus is reached to add some temporary swap space via a swapfile. (more…)

2 Comments


Technical, Technology

Apple is France

Link: https://dannyman.toldme.com/2006/10/10/mac-a-la-mode/

I drove down to Mountain View yesterday and met Brian and Jessica for dinner. I also picked up the remote control for the TV Brian gifted us last year. He gave me another remote for the DVD player he also gave me last year, and then there was another TV remote that was nearly identical.

We puzzled a bit, and then I realized that this other TV remote was for a TV I bought years earlier, and had traded to Joe for the TiVo he had won. Joe had lived with Brian prior to my living with Brian, and when he moved he must have forgotten his remote.

Later that night, I was talking to Mike, who has the TiVo that I traded to Joe, which I gave to Mike when I went to travel, since Brian didn’t want it. Mike upgraded the TiVo, and has another connected to the satellite, would I like my old TiVo back, in all its upgraded glory? Not really, though I asked if he might want my car, since I never drive it any more, and could perhaps do without, but due to sentimentality, I would rather “keep it in the family.” (more…)

1 Comment


Technical

Locutus of CODE

Link: https://dannyman.toldme.com/2006/09/13/sleep/

japolo: haha, danny quotes locutus of borg in his code
anna: locutus was cool
dman: hrmmm.
dman: that sounds familiar … care to paste a bit, sir?
japolo: # “Sleep.” –Locutus
japolo: sleep($sleep);

I used to love Star Trek: The Next Generation.  But that was pretty damn lame when the Borg got blown up just when they were about to destroy Earth because someone told them to sleep.  Now, it just makes me grin.

There are three lights!

5 Comments


Linux, Technical, Technology

Serial Console Woes

Link: https://dannyman.toldme.com/2006/09/06/serial-console-woes/

So, I’m setting up a box. I need to test different filesystem configurations, which will involve a lot of boot-configure-install-post-install-benchmark cycles. We have a nice network boot infrastructure, but getting serial booting to work is always fun. Today I found that the vendor has set up BIOS “remote access” to COM2. Funny thing, the box only has one serial port! So, I set that to COM1, and configure console redirection only up to the boot loader, tell the bootloader that I want text console=ttyS0 and we’re in business!

But man, if SuSE’s YaST aint a bloody mess when it downgrades to text on a serial port:

yast

What you don’t see here is the constant slow screen-redraw, constant pressing control-L. This is what it looks like at a good moment!

I think I understand why. I mean, I would think that Linux developers would take serial consoles and text mode to heart. After all, that’s the whole point, right? But that’s how I think, because I manage dozens of servers at a time, remote, and all my boxes are rack-mount jobbies with lots o’ fans and nobody wants to be in the same room.

But the developers who hack on Linux probably aren’t hard-core SysAdmins. Their dev system is some beat-up old hardware sitting near their desk, wired up to a spare VGA monitor, so yeah, text mode is kind of an afterthought. Especially given the pain in the butt that setting up serial consoles can be!

2 Comments


Technical

MySQL: Backup User Privileges

Link: https://dannyman.toldme.com/2006/08/22/mysql-backup-grant-privileges/

Q: What privileges must I grant to a MySQL user to allow them to run mysqldump?

A: LOCK TABLES, SELECT seems to do the trick.

Example: GRANT LOCK TABLES, SELECT ON mydatabase.* TO 'backup'@'backuphost' IDENTIFIED BY 'somecoolpassword';

Principle of least-privilege: don’t entrust your backup host with the power to hurt the database if you don’t have to. SELECT allows the user to read data, and LOCK TABLES allows the user to lock the tables while running a “snapshot” . . . and of course, narrow the privileges to a specific user-host-password tuple.

3 Comments


Linux, Technical

Linux Uptime Reset

Link: https://dannyman.toldme.com/2006/08/16/linux-uptime-reset/

dman: Anyone ever been on a Unix box and see uptime reset without a reboot?
SmooveB: dman: yes
David: dman: yes
***dman smiles
David: dman: my personal favorate is the rollover or the negative rollover
SmooveB: dman: linux in particular
dman: LINUX, you say?
David: SmooveB: fancy that, that’s where I’ve seen it too

It seems that this issue is near and dear to those involved in “the uptime project” where, I guess, geeks sit around comparing uptime size. Which is kind of juvenile. However, this bug gave me a hearty laugh:

How reproducible:
ALWAYS

Steps to Reproduce:
1. Boot Linux system
2. Go away for 497 days
3. check uptime

That would be a bitch to QA! (more…)

2 Comments


Excerpts, Relationship Advice, Technical

Quotation Station

Link: https://dannyman.toldme.com/2006/08/14/quotes-quotes-quotes/

While waiting on a file transfer, perhaps I can share a variety of quotes that have caught my mind lately.

I attended San Francisco’s Unitarian Universalist church for the first time this Sunday. One of the hymns has some lyrics which I dug:

We’ll be a land building up ancient cities,
Raising up devastations from old;
Restoring ruins of generations.
Oh, we’ll build a land of people so bold.

Barabara Zanotti
“We’ll Build a Land”

Then, several quotes from the August, 2006 issue of The Sun, dealing mostly with romantic relationships. (A subject especially near and dear to my heart this year.)

It remains inexplicable to me that we can finally become happy again after someone we love has died. Yet there I stood at the end of my bed, a scant four years out, feeling happy. Was this not betrayal? It does not help to say that the dead are gone and do not care. The problem of grief is never with them; it is with us, with those who remain. Like the bed we lie in, it is ours.

Susan Carol Hauser
“The Marriage Bed”

And a bunch of “Sunbeams” starting with something light-yet-presidential: (more…)

1 Comment


Technical

Unix Trick: Block-and-Page

Link: https://dannyman.toldme.com/2006/07/26/unix-trick-block-and-page/

Well, I hope to give some cool narrative of the big move to San Francisco, the awesomeness of my new pad, and the joy joy experience of a hip new job, but for now, I’ll share a little Unix trick.

You ever had a job to do that consisted of issuing a time-consuming command, waiting a long time, then issuing the next time-consuming command, waiting a long time . . . meanwhile, you wander off and focus on other things and the time-consuming command has completed but long ago you stopped paying any attention whatever?

Well, what I do, is ask Unix to page me when the command completes. “Hey, boss! Wake up! Time to look at me again!”

This is pretty easy to rig up. For example, this morning I had to copy a series of CD-ROMs, swapping between each copy, so my command looks like:
cp -rp /media/cdrom/* 10.1 && echo "copy done" | mail -s "copy done" pager@example.com

If you don’t already “get” it, I’ll explain:

cp -rp /media/cdrom/* 10.1
This is the time-consuming command: copy the contents of the CD-ROM to a directory.
&&
This means “if the last command completed successfully, execute the next command.” Like a conditional operator in your favorite programming language. Of course, in this context, ;; is probably smarter, as it means “after the last command terminates, successfully or otherwise, execute the next command.” (Even if the copy screws up, I still want to know, right?)
echo "copy done" | mail -s "copy done" pager@example.com
Say “copy done” and send that to the mail command, with the subject “copy done”, and send that to pager@example.com.

Hrmmm, my pager just went off. I guess I am done posting for now!

5 Comments


Free Style, Technical

Annals of Creative Systems Administration

Link: https://dannyman.toldme.com/2006/07/06/pen-in-the-tube/

IMG_3071

So, we had this “swamp cooler” that had been used to augment cooling in the machine room for a time. It has been sitting unused since before I started working here a few years ago. It takes up some space, but I could never remove it because it was attached to a hose in the wall, to drain the water.

Well, this morning my colleague complained that the water was starting to smell, so I took it upon myself as the Senior Systems Administrator to solve the problem, once and for all!

We found that the tube actually ran to the sink in the kitchen next to the machine room. I pondered many ways to remove the tube without spilling water in our machine room. Tourniquet? Well, the zip-ties couldn’t compress the hose enough. In the end, I unfastened the hose from under the sink and plugged it with a pen.

From there, it was a straightforward task to pull the tube back through the wall and remove the swamp cooler, freeing us up several cubic feet of valuable machine room!

I was digging around under the sink when a coworker asked “so you’re a plumber now, huh?”  I confessed that us systems guys like to think we can do hardware, but really we’re just kind of dangerous, and the right solution would have been to call the facilities people.

I started a set on Flickr to catalog such feats.

1 Comment


Technical, Testimonials

Add a “Subscribe” Button to Google Custom Home Page

Link: https://dannyman.toldme.com/2006/05/02/google-subscribe-button/

I was talking to a co-worker about how awesome the Google Personalized home page is. There’s an advanced interface where you can paste in just about any URL and get it aggregated on the page. How neat is that? Well, it would be even neater if there was a button in the web browser, so you could just visit a web site, and add it to your Google Home Page.

Well, I have done this before … I didn’t invent it, but this little JavaScript bookmark does the trick: (more…)

Feedback Welcome

« Newer Stuff . . . Older Stuff »
Site Archive