off by one for 2007 |
||
<Y | Y> | |
(1) Sun Jan 07 12:05:46 PST we are idiots: We're back in LA after a 3.5 week time away. We are idiots. We don't have renter's insurance because we're slackers. I think "renter's insurance" is one of the most advanced levels of the game "Escape From Slackerdom". That game starts when you start college, and the levels get harder or more unlikely for you to complete as the game progresses. The first level is "1: Don't Skip Classes," then "2: Do the Reading For Your Classes," then "3: Get A Decent Amount of Sleep Each Night," then one of the Boss characters is "The Taxman," where you have to do your own taxes for the first time, etc. Anyway, one of the last levels is "24: Get Renters Insurance" and we haven't.
We also neglected to tell our neighbor that we would be gone for three weeks. AND there were workmen in our apartment fixing the plumbing when we left. So basically, we're idiots and worried about it all vacation.
When we got back last night, everything in the apt. was really dusty... but it looked like it was all here.
Looking around, we saw that the workmen left the kitchen window wide open. There's a screen, but still, it's the window that's above our porch, which is only 6 feet off the ground. Then last night I thought they left another window open... and... they did! Then, this morning, and this is the kicker.. the porch door was NOT UNLOCKED and was actually cracked open about a half inch!!!1!!!
At this point I'm glad the place was so dusty because it was pretty obvious that nobody had been in here in weeks, otherwise I would have started to get really paranoid.
Anyway... school starts tomorrow.
Happy new year to everyone... I hope that 2007 is a better year for us personally and also for the world.
Wed Jan 10 17:33:26 PST episode iv: a new quarter: Well, it's time for a new quarter at UCLA. I passed all my classes and did pretty well, so I figured it was time to invest in a sweatshirt. Now people stop me in the grocery store and say things like, "Go Bruins!" which is an unsuspected downside.
This quarter, I'm taking which is a grad-level Computer Security (236) course (sort of a current topics discussion), and the undergraduate breadth requirements Networking (118) and Automata and Complexity (181). I'm also taking the grad topics seminar, CS 201. I really like my schedule so far -- all my classes are back to back on Monday and Wednesday, so that I'm done by 2PM, and then I don't have to come in on Tuesdays or Thursdays except for seminar. Then Fridays I have some discussion sections. I also have friends in every class, which helps make it more enjoyable.
The Security course is cool because it's a grad course and is focused on current stuff; my last job and my history as a sysadmin, etc. helps me feel pretty tapped in to the subject matter. Right now I'm trying to brainstorm on a project for the class. Networking looks pretty straightforward; it helps that I taught a simplified version of the course at North Park. Automata and Complexity will be my most challenging course, I think, because it is more abstract and sometimes I have trouble really getting inside formulas and the like. But I really like the subject material, and so far, the professor is great.
So I think the big challenges will be the Automata stuff in general, followed by the Security project (which should be something new, functional and hopefully interesting), and then the Networking projects, which require some sockets programming in C... I'm going to start working on some practice in that area right now.
Thu Jan 18 08:52:50 PST warning: may contain SQL:
Thu Jan 18 11:12:05 PST here's one for posterity: I use postfix with smtp auth for users who use outside clients but still use my smtp server to send out (which is considered relaying).
The standard Debian/Ubuntu way seems to be to use sasl2 along with postfix. But the saslpasswd2 man pages are pretty cryptic -- do I need a "realm"? What about an "appname"? How come no matter what I do, nothing seems to work? There are two answers -- one, saslpasswd2 requires the bare minimum from you, and two, remember that postfix is running in a chroot jail.
1. To add users, just do saslpasswd2 -c username@domain.com and enter the password twice on the interactive prompt. The changes are stored in /etc/sasldb2.
2. The non-obvious catch is that Debian/Ubuntu run postfix in a chroot by default -- so after you add or remove users, you have to remember to copy the /etc/sasldb2 file into the chroot, like this:
cp -a /etc/sasldb2 /var/spool/postfix/etc/
... then it should work!
I have to do this so rarely that every time it comes up, I have long since forgotten and it takes me an hour to figure this out... so perhaps this can be a contribution to posterity -- mine and hopefully yours.
(2) Wed Jan 24 21:45:01 PST security ideas: So I'm in a security class with a bunch of other grad students, and my group needs a project. If you have an idea that you think I should explore and get famous for, please post it here now!
Thu Feb 01 10:39:06 PST another one from spamblock: It is trivially easy to block attachments by extension with postfix. This is nothing earth shattering, and people have been doing this for years, but pretty much everyone running postfix should be doing this. And it's so easy that you have no excuse.
Step 1: Create a file header_checks in your /etc/postfix directory. In that file, put a line like this:
/^content-(type|disposition):.*name *=.*\.(exe|pif|com|scr|bat)/ REJECT We cannot accept executable attachments
... run postmap on that file to create header_checks.db.
Step 2: Edit main.cf and add a line like this:
header_checks = regexp:/etc/postfix/header_checks
... restart postfix.
Step 3: PROFIT!!!
Seriously, that's it. You can also use a pcre instead of a regexp by using the postfix-pcre package (in Debian/Ubuntu), and changing "regexp" to "pcre" in the main.cf line.
Originally from here... but their regexp has a bug in it.
(1) Wed Feb 21 00:03:16 PST explaining finite automata -- without sounding CrAzY!: So, while I'll never be a "theory guy," I have really been enjoying my Automata / Complexity class. I think it's fascinating stuff that not only says a lot about computers, but fundamentally says something about how logic and reality function.
Unfortunately, my fascination with the material isn't something I can easily share with anyone, because... where do you even begin? When I try to explain it, why it's interesting, why it's hard, why it's important, I fail miserably, and usually sound like the guy ranting down on the corner with the hand-lettered sandwich board. "It's like tiny little machines, with arrows! Every thing is a tiny machine on a piece of paper with finite memory! 12 Galaxies!"
How would YOU explain Automata to someone who has no idea what they are or why they matter? Bonus points for explaining the concept of state machines without a pen and paper!
Thu Feb 22 10:50:06 PST the 56 hour challenge: In the spirit of SHATTERED and SUPER SIZE ME and THAT GIRL WHO ONLY ATE CARROTS FOR A WEEK and other great Internet "let me do something weird to my body and blog about it to the world" I bring you, THE 56 HOUR CHALLENGE.
YES, I, Peter Peterson am going to try and get 8 HOURS OF SLEEP A NIGHT FOR A WEEK -- a feat I have been unable to perform since I last had a bedtime!
DAY 1:
I got 8 hours of sleep last night, so far so good. I haven't started hallucinating or turning funny colors yet, so it seems like everything's ok. If I start going crazy later this week, please call a doctor!
Fri Feb 23 09:18:03 the 56 hour challenege: DAY 2: It's Day 2, and last night I got 9.5 hours of sleep. I know... it's shocking and disturbing. I feel pretty good -- much better than yesterday morning. Maybe my body is starting to adjust to this excessive amount of sleep. We'll see. I've only been up for a little while, so who knows what weird effects will happen to me throughout the day (like, maybe I'll be UNABLE to SLEEP in CLASS!)... I'll keep you posted.
Sat Mar 03 19:59:02 PST 56 Hour Challenge Results... : So, I made it almost to 56 hours, but the last night I had some homework done and I had to stay up. I probably completed the 52-hour challenge. I felt great though! You should all try it. You'll thank me.
Anyway, some other cool things you might like to know.
If you're on Debian/Ubuntu, and you want some RAD tab completion power, just source /etc/bash_completion in your login scripts. Yow! Now you can tab-complete package names with apt-get! And much, much more.
Another hot tip I just learned, is the -f switch for ssh, which is really handy for tunneling X11 apps over ssh. From the manpage: "Requests ssh to go to background just before command execution. ... This
implies -n. The recommended way to start X11 programs at a
remote site is with something like ssh -f host xterm." What you get when you try this, is the login prompt, then the program loads, and you get your terminal back... which you can then close! ... but since ssh is backgrounded, the tunneled app stays open! PROFIT!
Sat Mar 03 23:10:03 PST Boston and Tom Waits: Boston's eponymous first release and Tom Waits' Small Change were both released in 1976. In fact, Small Change was being recorded when I was born. Coincidence? I think not.
Sun Mar 04 14:05:14 PST hot vim tip sandwich (au jus): vim has a cool "delete-from-here-to" feature. In command mode, put your cursor where you want to start deleting. Then, type 'd/n', where n is a regex describing where you want to stop deleting. vim should show you where you are deleting to, either by highlighting, or by moving the cursor. When you're pleased with your regex, hit enter. Bam!
Mon Mar 05 16:30:48 PST gnome-terminal: control-'-' and control-'+' increase and decrease the font size in the active window. Pretty cool!
I'm one of those people who thinks that it should probably be control-'=' so that I don't have to do control-shift-'='... but maybe that's just me. It seems a little pedantic to make people press shift.
Sat Mar 10 10:37:12 PST .ssh/config:
(3) Sat Mar 10 13:55:10 PST online grammar checker: Are you writing a Context-Free Grammar and you want to see if it works? Want to try a few test cases but don't have time to work the derivations by hand? Did you think this kind of technology only existed in the future? You were wrong.
Sun Mar 11 01:49:34 PST speaking of boston...: We were just another band out of Boston /
on the road tryin' to make ends meet /
playin' out of bars sleepin' in our cars /
and we practiced right on out in the street
though we didn't have much money /
we barely made enough to survive /
but when we got up on stage and got ready to play /
people came alive
Thu Apr 05 20:07:57 PST cool vim trick: So, I've seen vim configured to open and place the cursor in the last cursor position in that file before closing, and at first I thought it was annoying. Then I started to like it. Now I miss it. It was bittersweet though; I thought I would want it enabled in my .vimrc, but would I find myself getting annoyed by it? Intrigued, I went looking for an answer, and instead found that the command '" (that's a single quote followed by a ") jumps to that position -- essentially, when you close vim, it sets a mark for that position to the character " and, as we all know, ' is the "jump to" command. So now I don't have to have it as a default -- but any time I want it, it's there.
Sun Apr 22 15:35:32 PST happy birthdays / encrypted Ubuntu: Two birthdays to celebrate: One, The Tastytronic Diner is now in its 5th year. And two, Dumont the IO Tower Guardian, keeper of the clickolinko is now in his 7th year of operation. We figured out his birthday -- 950341551 (Sat, 12 Feb 2000 07:45:51 GMT) -- today after never having known it.
I also recently found Encrypted Filesystem HOWTO for Dapper which I'm using to build an encrypted backup server for flynn. It seems to work.
Mon Jul 09 21:03:39 PST types of academic research, first in a series: The Retroactive Umbrella
This is when you look at something new, and you say, "Oh, actually that thing is a member of a whole class of things that either don't exist or nobody's identified yet." Example: identifying the coming expansive P2P revolution after seeing Napster for the first time.
Pros: You get to herald an as-yet nonexistent class of things and hopefully have some influence over their development. You also didn't have to come up with the initial idea -- you just had to identify it as significant.
Cons: You didn't come up with the idea.
Related: developing taxonomies for things that exist but haven't been put into little boxes yet.
Fri Jul 13 17:32:35 PST free ideas: a series: If I were a chemist or a physicist or whoever would be doing this, I would design a microwave mode that wouldn't make reheated coffee taste bad. It would have to be some kind of uber-gentle microwave mode. But even if it took 2 minutes to heat up a cup of coffee, as long as it tasted like it was fresh off the press/percolator/whatever, I would be happy to wait.
Mon Aug 27 15:24:04 PST cool vim trick: You can split windows in vim and keep multiple files open. This isn't usually that interesting to me because I use screen for everything and memory usage isn't really an issue.
What *is* useful is that you can have two views into the same file -- so if you want to reference something way up top but you're working way down at the bottom, you can split your view. Here's how:
:sp (splits window)
CTRL-W up (move up)
CTRL-W down (move down)
:q (closes this window)
You can find a lot more info and additional commands if you search for "vim split window" or somesuch.
Pretty rad!
Thu Sep 06 09:37:23 PST cool screen tricks: I used to do this one all the time, but recently forgot it. I had to look it back up again.
Anyway, when you're using screen (which is all the time, right?) and you wish that a particular screen was at a different index (like let's say when you're running some job that you don't want to start over) you can just reassign its index like this:
<escape>:number n
... where escape is probably control-a (aka C-a in screen lingo) and n is the numeric index you'd like the screen to be at.
Yes, it's just that simple!
Another cool screen trick that I'm going to throw in for FREE (if you call in the next 30 seconds) is nesting screens. There are two ways to do this:
1. Set a unique escape in each screen. You can do this by setting a new escape in one of the screens:
<escape>:escape ^Xx
... to set the escape to control-x in that screen. Then you can pick up the screen inside another screen and use the appropriate escape sequence in each screen context.
2. In this method, you don't change the escape sequences at all, but you just hit the sequence twice to "drill down" into a nested screen. So for example, if you have a screen within a screen, and within the nested screen you want to change to the next window, type:
<escape><escape>n
... where merely typing
<escape>n
... would just change the screen in the "top level" screen.
At these prices you can't say no!
Sat Sep 22 15:36:03 PST firefox forwards and backwards navigation: Thinkpad laptops have two special "forward" and "backward" keys above the typical left and right keys that are used for paging in applications like Firefox and other web browsers. Unfortunately, they don't work out of the box in Ubuntu like other buttons (like the volume knobs, suspend, etc.). I hate using Alt-Left/Right -- why make two keystrokes when I should be able to use one?
So I have been looking for a solution, but complicating this issue is that old solutions to this problem don't work in Firefox +v2.0, firefox extensions that advertise this ability are pre 2.0 as well, and Firefox remote tricks assigned to commands don't seem to work either (I think because of a vulnerability in Firefox remote? I'm not sure.)
Anyway, this site has a working howto, and it's really easy. The short version is to edit your ~/.Xmodmap to make back (keycode 234) and forwards (keycode 233) F19 and F20, and then edit browser.xul to use that instead of the Alt-Arrow combos. For Ubuntu anyway one thing different from the howto is that browser.xul is already unzipped in /usr/share/firefox/chrome/ ... etc, not in your homedir or .mozilla, etc. Just edit it and save it; you don't need to re-package chrome or whatever although you do need to restart Firefox. This material should get updated in the ThinkWiki and other sites... but I'm not going to do it.
Incidentally, the "back" and "forward" buttons on the new Microsoft Natural Ergonomic Keyboard 4000 use the same keycodes, so if you have one attached to your Thinkpad like me, this is a two-for-one deal.
Update: You can leave the old hotkeys in and just add the new ones to keep the old "alt-arrow" mapping and add the new thinkpad arrows if you want! Beaujolais!
off by one for 2007 |
||
<Y | Y> | |
Unless otherwise noted, all content licensed by Peter A. H. Peterson under a Creative Commons License. |