Benjamin Ste.in Pro
The great thing about the web is linking. I don’t care how ugly it looks and how pretty your app is, if I can’t link in and out of your world, it’s not even close to a replacement for the web. It would be as silly as saying that you don’t need oceans because you have a bathtub.
Rails gets automatic EXPLAIN logging for slow SQL queries
In a fresh commit, Rails edge now has the ability to automatically add query plan info to the standard Rails logger:
# Log the query plan for queries taking more than this (works # with SQLite, MySQL, and PostgreSQL) config.active_record.auto_explain_threshold_in_seconds = 0.5… which will yield something like:
+----+-------------+-------+-------+---------------+---------+---------+-------+------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+-------+---------------+---------+---------+-------+------+-------------+ | 1 | SIMPLE | users | const | PRIMARY | PRIMARY | 4 | const | 1 | | | 1 | SIMPLE | posts | ALL | NULL | NULL | NULL | NULL | 1 | Using where | +----+-------------+-------+-------+---------------+---------+---------+-------+------+-------------+ 2 rows in set (0.00 sec)Hot.
spark
A little shell script that lets you generate sparklines at the command line:
spark 0 30 55 80 33 150 ▁▂▃▅▂▇You can also pipe stuff to spark—see this wiki page for some clever examples.
This is pretty cute. I like the idea of putting inside your prompt, think there’s some interesting information you pull to put there.
Maybe a graph of how many times you had to run `sed` to actually get your prompt to render?
Goodbye Web Workflow
Four years I abandoned all native desktop apps except an ssh client and a text editor.
I completely migrated my work life 100% to site-specific browsers with Google apps and 1Password.
We were living in the future and I loved it.
Fast forward to today: 1Password doesn’t work with Fluid anymore and Google’s new borderless-contrastless-whitespace interface is rolling out everywhere.
Now we’ve actually reached the future and it’s miserable. What’s a guy to do? I’m thinking about going back to all native desktop apps. Mail, iCal and Pages, I guess.
I hate to sound like a curmudgeon, but I really want to roll-back everything to 2010.
How are you dealing with this?
iTerm2 - Mac OS Terminal Replacement
A trigger is an action that is performed when text matching some regular expression is received in a terminal session.
What can Triggers Do?
Various actions may be assigned to triggers. These include:
- Bounce Dock Icon: Makes the dock icon bounce until the iTerm2 window becomes key.
- Ring Bell: Plays the standard system bell sound once.
- Run Command: Runs a user-defined command.
- Run Coprocess: Runs a Coprocess.
- Send Growl Alert: If Growl is enabled, a Growl alert is sent.
- Send Text: Sends user-defined text back to the terminal as though the user had typed it.
- Show Alert: Shows an alert box with user-defined text.
iTerm2 is so frackin’ cool
-#define RUBY_VERSION “1.9.4”
+#define RUBY_VERSION “2.0.0
Dennis MacAlistair Ritchie (Username: dmr, September 8, 1941 - October 9, 2011)
RIP Dennis Ritchie.
I think having your username inscribed in your epitaph before your birth date is something all nerds should aspire to.
Super Fast SSH with ControlMaster Settings
Add the following to your .ssh config file:
ControlMaster auto
ControlPath /tmp/ssh_mux_%h_%p_%r
Then, when you open up a second terminal to the same remote server, it will automatically reuse the existing connection and the new prompt will appear almost instantaneously. It doesn’t have to re-authenticate for every new window. Amazing.
If you also add
ControlPersist 4h
then the connection will stay open in the background. Super useful for things like git that re-establishes a connection on every operation. Dropped my `git pull` from 10 seconds on the first run to 2 seconds on the second.
via @malmckay
How do I switch between windows in Full Screen Mode in OS X Lion?
First follow these steps in OS X Lion:
- Launch Safari
- Cmd-N to open a new window (so you have 2)
- Ctrl-Cmd-F to make one of the windows Full Screen
Is there a way to toggle between the windowed Safari and the full-screen Safari using just the keyboard?
I haven’t figured it out. Cmd-` (back tick) and Ctrl-F4 don’t work in this mode. And cmd-tab will get you to ONE of them, but not both.
It’s driving me crazy, and makes it so I can’t use full-screen.
Anyone know how to get around this?
Local variable’s memory can be accessed outside its scope?!
You rent a hotel room. You put a book in the top drawer of the bedside table and go to sleep. You check out the next morning, but “forget” to give back your key. You steal the key!
A week later, you return to the hotel, do not check in, sneak into your old room with your stolen key, and look in the drawer. Your book is still there. Astonishing!
How can that be? Isn’t the contents of a hotel room drawer inaccessible if you haven’t rented the room?
Well, obviously that scenario can happen in the real world no problem. There is no mysterious force that causes your book to disappear when you are no longer authorized to be in the room. Nor is there a mysterious force that prevents you from entering a room with a stolen key.
The hotel management is not required to remove your book. You didn’t make a contract with them that said that if you leave stuff behind, they’ll shred it for you. If you illegally re-enter your room with a stolen key to get it back, the hotel security staff is not required to catch you sneaking in. You didn’t make a contract with them that said “if I try to sneak back into my room later, you are required to stop me.” Rather, you signed a contract with them that said “I promise not to sneak back into my room later”, a contract which you broke.
In this situation anything can happen. The book can be there — you got lucky. Someone else’s book can be there and yours could be in the hotel’s furnace. Someone could be there right when you come in, tearing your book to pieces. The hotel could have removed the table and book entirely and replaced it with a wardrobe. The entire hotel could be just about to be torn down and replaced with a football stadium, and you are going to die in an explosion while you are sneaking around.
You don’t know what is going to happen; when you checked out of the hotel and stole a key to illegaly use later, you gave up the right to live in a predictable, safe world because you chose to break the rules of the system.
C++ is not a safe language. It will cheerfully allow you to break the rules of the system. If you try to do something illegal and foolish like going back into a room you’re not authorized to be in and rummaging through a desk that might not even be there anymore, C++ is not going to stop you. Safer languages than C++ solve this problem by restricting your power — by having much stricter control over keys, for example.
This is a fantastic explanation for new programmers about accessing memory, low level languages, and undefined behavior.
Thieves Found Citigroup Site an Easy Entry - NYTimes.com
All they did was change account IDs in the URL and voila, they were in someone else’s account. This makes me so sad.
At least they have 2 factor authentication and Site Key and ridiculous password length and content requirements that are incompatible with any of my other password algorithms and auto-logoff because those things aren’t at all annoying and really help protect my info.
Then I will hug and kiss some poisonous snakes
Troy Hunt has an unsurprising-yet-nonetheless-terrifying analysis of the passwords found in the recent Sony security breaches. The nice thing about so many different Sony properties getting hacked is that we have data from multiple web properties to cross-reference :)
The most striking (yet still unsurprising) things to me: 99% of passwords contained NO non-alphanumeric characters and 92% of passwords are re-used on multiple sites.
Oh, and passwords like dallascowboys and 1qazZAQ! that people think are strong are still in the password dictionaries.
The whole post is worth a read later.
My conclusion: if you actually know any of your passwords, you’re doing it wrong.

