Home

Previous 10

May. 29th, 2008

Geek Dad, or using Perl to do math

Yesterday [info]littlemeridian came to me and said she knew the sum of 1+2+3... etc to 100. She had figured out a way to solve the problem without adding all the numbers.
"I can bang out a perl program that can do the math," I said, not convinced she was right (she was right, btw). So we sat at my computer and I wrote this easy program that adds consecutive numbers up to a limit you specify from <STDIN>. It took us a little while to get the math right but we eventually got it.
see the code )

May. 20th, 2008

Ubuntu and Gmail

I was tired of not having mailto: links work correctly on my Ubuntu machine, so I did a bit of google-ing and found a very useful Perl one-liner here.

perl -MURI::Escape -e '$to= shift; if ($to =~ /^([^\?]+)\?(.*)$/){$to=$1;$args="&".$2;$args=~s/\&subject=/&su=/};$to =~ s/^mailto://i; exec("firefox","https://mail.google.com/mail/?view=cm&fs=1&tf=1&cmid=22&to=".URI::Escape::uri_escape($to).$args);' '%s'


Ubuntu (and possibly other Gnome) users, stick this in the Mail Reader custom command field of System -> Preferences -> Preferred Applications -> Internet.
Thanks to dcrooke at gmail dot com. It works like a charm.

netiquette websites +1

I ran into a few websites about netiquette today, and thought I'd share. The +1 may be useful for determining if a website is up or down...

netiquette:
five.sentenc.es
thanksno.com
bccplease.com
and +1:
downforeveryoneorjustme.com

May. 13th, 2008

SSH Vulnerability

from http://www.ubuntu.com/usn/usn-612-1

full notice behind the cut )

What does this mean? You should update Open-SSH if you run a Debian-based Linux distro, like Ubuntu, and recreate and redeploy your SSH keys.

May. 8th, 2008

Ubuntu 8.04, Firefox 3beta5 and SSL certs

There are a lot of problems with Ubuntu 8.04 that I'm finding since installing it at work. I use a lot of security features, like SSL certificates, GPG, and user authenticated samba shares to name a few.
Firefox 3 Beta 5 (which shipped with Ubuntu 8.04) has some issues with self-signed SSL certs, especially those generated by CUPS servers. As a sys-admin, I use the web interface to CUPS regularly. FF3b5 throws sec_error_inadequate_key_usage errors with CUPS SSL certs and doesn't allow exceptions. Here's the workaround I found from https://bugzilla.mozilla.org/show_bug.cgi?id=427081#c18:

1) go to an affected page, get the error.
2) right-click, view page info, security tab, view certificate
3) details tab, export, save as .cer, close, close
4) go to preferences, advanced, encryption tab
5) view certificates, servers tab, import, select the saved .cer file
6) hit ok, close preferences
7) refresh the page with the cert error, now should be a different error
8) click "Or you can add an exception", "Add exception..."
9) get certificate, confirm security exception - now you're in

May. 7th, 2008

Ubuntu users: Enigmail/Thunderbird invalid password error fix

I use Thunderbird and the Enigmail extension a lot at work. I like to sign all my emails. After installing the latest release of Ubuntu, I had some trouble. Seahorse (the new default key manager) was not recognizing a passphrase caching agent (either gpg-agent or seahorse-agent). Both were running....
when trying to sign an email, I would get an error like
gpg command line and output:
/usr/bin/gpg --charset utf8 --batch --no-tty --status-fd 2 -d --use-agent
gpg: problem with the agent - disabling agent use
gpg: can't query passphrase in batch mode
gpg: Invalid passphrase; please try again ...
gpg: can't query passphrase in batch mode
gpg: Invalid passphrase; please try again ...
gpg: can't query passphrase in batch mode

Turns out the fix is easy, and numerous bugs have been filed.

All you have to do is delete the file /etc/X11/Xsession.d/90gpg-agent and restart X (CTRL+ALT+Backspace).

Apr. 26th, 2008

Version 1.0

To go along with this post.


 

Apr. 25th, 2008

question for you perl programmers...

I wrote a script that will post to twitter. It takes a command line argument or reads a random line from a text file, and posts the result. I've got it working, but I think code could be a little cleaner.
Basically, I want to know if there is a way to put each element in an array ( like @ARGV) into a string.
For instance, if I run perl post-to-twitter.pl here is a tweet, I'd like to turn "here is a tweet" into a string so I can put it in a scalar like $post.
I think I could use a reference, but I have a hard time wrapping my head around the concept. I really want to turn the last 4 or 5 lines into one.

Thanks...

here's my code )

Oh yeah, if the command line argument has an apostrophe, the script breaks... Why is that?

Mar. 31st, 2008

new gpg key

I have a new gpg key. You can get it from the link in my profile, or here.
Fingerprint: E4C9 4420 8972 C50B 9CC8 DF0F B926 3A8B C46A F91F

Mar. 22nd, 2008

It Came Yesterday

My computer arrived yesterday... It's awesome!

Previous 10

mangavatar

November 2009

S M T W T F S
1234567
891011121314
15161718192021
22232425262728
2930     

Advertisement

Syndicate

RSS Atom
Powered by LiveJournal.com