Tag: Linux

Thursday Quote: Mike Solomon

May 24, 2012 » Geek

“Linux is good in terms of manholes, there’s always a way to get in and see how your system is behaving.”

– Mike Solomon
Scalability at YouTube

Sneaker-netting Huge Files with split and cat

February 27, 2012 » Geek

Big files happen, and sometimes they need to be moved.

I’ve found that moving big files between local computers is often fastest with a USB drive and my shoes, especially since I don’t really have access to a wired network usually.

But sometimes, files are just too big for your thumb drive. Some of us don’t carry huge drives around, I usually only have a spare 2GB on me.

Suppose you have a 4.4GB ZIP file (don’t ask, just suppose). I’ve only got a 2GB (1.9GB usable) thumb drive on me, but I need to move it over to another machine and I don’t have all day.

In the past I’ve use dd tricks, but I knew there had to be a better way.

Enter split and cat. cat concatenates files, and it’s cousin split, well, splits them.

Perfect! Just what I needed! I’ll split my file into chunks with split, sneaker it over the other machine and cat it all back together.

Split

Move

Sneaker

Join

Enjoy!

Tags: , ,

On Linux? Do yourself a favor and try Hotot.

May 29, 2011 » Consume, Geek, Life

I’ve used a lot of twitter clients over the years, I even wrote one back in ’08. TweetDeck is pretty good, but Air is shoddy on 64-bit Linux, and so it didn’t integrate well and would crash.

I rejected Gwibber and Choqok, just not my style. My old web standby Brizzly seems pretty lame these days too. Then I found Hotot. It’s awesome. It’s like a Linux native TweetDeck, but with a friendlier, more welcoming feel.

If you are looking for a Linux twitter client, you have got to give Hotot a try.

Hotot

Tail In PHP

December 3, 2010 » Geek

So I’m working on a little admin interface and I decided to tail some logs. It’s in PHP and Google came up with some stuff, but they were all a bit finickey and not well documented. So I wrote my own!

Here’s the basic concept:

  1. Open File
  2. Seek To End
  3. Loop:
    1. Seek Back By Chunk Size
    2. Read Chunk
    3. Count Newlines
    4. Stash In Buffer
    5. Break If Enough Newlines Total
  4. Trim Extra Line & Cruft
  5. Done!

Here’s the code:

You can give it a try on some junk data here: http://static.velvetcache.org/pages/2010/12/03/tail-in-php/

Exim Cheat Sheet

September 3, 2010 » Geek

I did some tinkering with an Exim server today, and it’s been probably a year at least since I las touched one. Found an invaluable cheat sheet at http://bradthemad.org/tech/notes/exim_cheatsheet.php but it’s not terribly printer friendly.

I knocked up a more printable one for myself with Abiword, hope it can help you too.

Exim Cheat Sheet