We required a method of using sms to activate users on our new site so that we can be sure that people aren’t creating duplicate accounts and are from the UK. We have now come up with two methods for achieving this, both of which are documented below. It took a long time to get this working, not…
Linux: Recursive find and replace
After Googling for a bit, the easiest solution I could find uses find and sed. Here it is:
find ./ -type f -exec sed -i ’s/oldstring/newstring/’ {} \;
That will edit all the files in place and will NOT create backups so buyer beware.
Another year, another blog redo…
For the last year, Mike The Coder has been hosted on Chyrp, a nice and nimble little self-hosted blogging platform that dips into the tumblelog side of things (different post types, auto-posting of other websites stuff, etc.). Then, much to my dismay, Alex announced that he was done maintaining Chyrp (I’d link to the blog post but the site seems to be down). That alone doesn’t warrant a switch, since things were working fine as they were, but it made the antsy side of me kick in.
So now I’m on Tumblr, just because it’s the closest thing to Chyrp and I’m ready to try something hosted for once. The benefits of Tumblr over something like Chyrp are many:
- Can email or IM in posts
- Can call in audio posts using a phone
- Easy Disqus integration
- Lots of readily available themes
- All the other stuff that comes with using a popular platform
So holler if you spot any problems. I manually ported over all the posts worth porting (skipped the twitter statuses and pointless pics, etc.).
RT @Merge: What’s the coolest thing that happened to you on the web this week? Let us know on the Merge blog. http://ow.ly/2fBAz
Use `less` to view and search huge files
Every now and then I’ll have to search through a 10MB or 20MB SQL dump for something, and historically I’ve just used Gedit for this, even though it can take minutes to open it and scrolling is pretty much unusable.
Today, I discovered that if all you’re doing is viewing it and searching it, then less is definitely the way to go. It opens instantly and you can use vim syntax to search through it. Try it:
less your_huge_file.txt
Then just type /searchterm and hit enter to search, then n to cycle through the results.
Heartballs
- Mike: STUPID ERIN
- Erin: that hurt.
- Mike: YES
- Mike: your hurt tingles my earlobes with the sound of a million tiny bells on horses
- Erin: good.
- Mike: the sound crinkles and burns and lights up my heartballs
- Mike: they are oh so satisfied by this symphony of pain
- Erin: your heartballs are satisified with the symphony of pain?
- Erin: as if heartballs aren't weird enough...
- Mike: but yes my little dumpling
- Erin: if i am your "little dumpling" what the heck do you call nancy?
- Mike: my tiny gumdrop
- Mike: my teetiny trinket
- Erin: OH. OH. SO I'M LITTLE AND SHE'S TINY. ARE YOU CALLING ME FAT???????????
- Mike: my eety beety truffletrot
- Erin: i hate your face
- Mike: calm thyself trinket!
