Google explains the internet to your granny, or 20 Things I learned about browsers and the web.
Shorts
Dummy sendmail for development environments
21:21
Most developers working with the web will sooner or later need to deal with sending e-mail. Usually it’s a contact or feedback form that needs to be delivered to an inbox in a nearby universe.
What has been bugging me about this is that whenever I need to send e-mail, I actually need to use e-mail, which slows things down and is cumbersome in so many ways, since your sysadmin didn’t configure the mailer on the development server – and more often than not, that development environment is your own laptop and I certainly don’t want to setup a working mailer on mine. Besides, I might not even be connected to a network. And don’t even get me started on when you need to dry run bulk mailing.
Luckily, at least if you’re running *nix, there’s a very simple solution; replace your sendmail binary with the following shell script1:
<code>#!/bin/bash
LOGDIR="/tmp/sendmail-sim"
NOW=$(date +%Y-%m-%dT%H.%M.%S)
CNT=1
PRIVATELOG="$LOGDIR/$NOW.$CNT.log"
COMBINEDLOG="$LOGDIR/combined.log"
# If privatelogs are being used...
if [ ! -z "$PRIVATELOG" ]; then
# ...make sure the filename is unique and create the file
while [ -f $PRIVATELOG ]; do
CNT=$(($CNT + 1))
PRIVATELOG="$LOGDIR/$NOW.$CNT.log"
done
echo "$0 $*" > $PRIVATELOG
else
# ...otherwise swap filenames
PRIVATELOG=$COMBINEDLOG
COMBINEDLOG=''
fi
echo "[$NOW]" >> $PRIVATELOG
while read BUF
do
echo $BUF >> $PRIVATELOG
done
# Append privatelog to combinedlog when both logs are used
if [ ! -z "$COMBINEDLOG" ]; then
echo "[$NOW]" >> $COMBINEDLOG
cat $PRIVATELOG >> $COMBINEDLOG
fi
exit 0</code>
This will result in all input that is sent to sendmail being written to a separate2 log file in the /tmp/sendmail-sim
directory, as well as a combined.log
for convenient tailing.
Shorts
Androids’ march against pirates
17:18
Tim Bray also says that “the best attack on pirates is to make their work more difficult and expensive, while simultaneously making the legal path to products straightforward, easy, and fast.”
Right on Tim, but…
Google’s Android Market lets you install paid applications only if you are in one of the 13 supported countries. The “legal path” is neither “straightforward, easy, or fast” if you don’t live in one of the 13 countries that are supported. Maybe instead of focusing on developing anti-piracy services, Google should add more locations to the paid Android Market.
Shorts
bq.. There are only two hard things in Computer Science: cache invalidation, naming things, off by one errors.
“The camera described in this report represents a first attempt demonstrating a photographic system which may, with improvements in technology, substantially impact the way pictures will be taken in the future.”
So long, and thanks for all the fish!
10:40
By the looks of it, this blog seems to have failed the test of time. I’ve had fuck all to say for over 2 months now. Not even a single link worth posting. Not a single photo worth showing.
So, until I find a new boost of inspiration somewhere, the status of /dev/nikc/blog is discontinued.
Shorts
Magic in Google Reader
09:56
Being a subscriber to a plethora of photo blogs, I was very pleased when I recently learned that Google Reader was equipped with a feature to give a lesser preference to “spamming” (i.e. frequently updating) streams by choosing the Sort by Auto, thus diminishing the urge to use the “Mark all as read” button when the reading list grows to numbers uncomprehensible to all but the most brilliant mathematicians in world history.
It was almost like magic, and it seems Google now thinks so too.
Shorts
Meta
Subscribe to feeds
Pages
Latest Posts
- Overland from Finland to London: Epilogue
- Overland from Finland to London: Days 3 and 4
- Overland from Finland to London: Day 2
- Overland from Finland to London: Day 1
- Overland from London to Finland: Day 5
- Overland from London to Finland: Day 4
- Overland from London to Finland: Day 3
- Overland from London to Finland: Day 2
- Overland from London to Finland: The Beginning
- The day the .dev gTLD died
Latest comments
- nikc on Managing scrollTop in your Backbone single-page app: Richard, you’re right, you can store...
- Richard Hunter on Managing scrollTop in your Backbone single-page app: Unfortunately, pop state wont help you...
- nikc on Managing scrollTop in your Backbone single-page app: Richard, Thank you. You’re right, scroll position...
- Richard Hunter on Managing scrollTop in your Backbone single-page app: This is a clever solution- however...
- llaurén on Better tools for procrastination: Yer welcome!
- nikc on Better tools for procrastination: Well, after evaluating both, I find...
- nikc on Better tools for procrastination: Having taken a closer look at...
- nikc on Better tools for procrastination: One Tab looks nice, too. But...
- llaurén on Better tools for procrastination: Nice catch! I use One Tab to...
- nikc on How to turn your smartphone (nearly) useless in one simple step: Wow, I’d love for the EU...