linux – Tea-Driven Development https://blog.mattwynne.net Matt Wynne taking it one tea at a time Wed, 21 Aug 2019 13:07:17 +0000 en-US hourly 1 https://wordpress.org/?v=6.2 165828820 Ubuntu Eee – The OS Your EEE Should Have Been Born With https://blog.mattwynne.net/2008/10/27/ubuntu-eee-the-os-your-eee-should-have-been-born-with/ https://blog.mattwynne.net/2008/10/27/ubuntu-eee-the-os-your-eee-should-have-been-born-with/#respond Mon, 27 Oct 2008 00:18:47 +0000 http://blog.mattwynne.net/2008/10/27/ubuntu-eee-the-os-your-eee-should-have-been-born-with/ Continue reading "Ubuntu Eee – The OS Your EEE Should Have Been Born With"

]]>
On finishing a long contract and project at the BBC a few months ago, I was incredibly touched to be given a brand new Asus EEE PC as a leaving gift by my colleagues.

Although I loved the tiny form factor and take it with me practically everywhere, I was never quite satisfied with the default Xandros Linux and have fidgeted around ever since trying out different options, spending way too much time on the on the excellent eeeuser.com community site, zapping the flash drive with different distros.

Finally this evening I think I found the answer: http://www.ubuntu-eee.com/

Slick, easy to install, great looking, and of course a proper operating system under the hood. Props to the team who put this together, it’s terrific. If you have one of these little beauties yourself, I highly recommend checking it out.

]]>
https://blog.mattwynne.net/2008/10/27/ubuntu-eee-the-os-your-eee-should-have-been-born-with/feed/ 0 83
Fetch and Parse HTML Web Page Content From Bash. Wow. https://blog.mattwynne.net/2008/04/26/fetch-and-parse-html-web-page-content-from-bash-wow/ https://blog.mattwynne.net/2008/04/26/fetch-and-parse-html-web-page-content-from-bash-wow/#comments Sat, 26 Apr 2008 22:47:57 +0000 http://blog.mattwynne.net/2008/04/26/fetch-and-parse-html-web-page-content-from-bash-wow/ Continue reading "Fetch and Parse HTML Web Page Content From Bash. Wow."

]]>
Okay, this is another one of those linux newbie posts where I tried to figure out how to do something that’s probably really obvious to all you seasoned hackers out there.

Anyway here I go clogging up the internet with a post that somebody, somewhere will hopefully find useful.

Are you that person? Well… have you ever used the shell command curl to fetch a web page? It’s cool, isn’t it, but you do end up with a splurge of ugly HTML tags in your terminal shell:

Eugh!

So… how about we parse that HTML into something human-readable?


Enter my new friend, w3m, the command-shell web browser!

If you’re using OS X, you can install w3m using darwinports thusly:

sudo port install w3m

Linux hackers, I’m going to assume you can figure this out for yourselves.
So, with a brand-new blade in our swiss-army knife, let’s pipe the curl command into the standard input for w3m and see what happens:

Hmm… two problems here: because I’ve grabbed its output and piped it off to w3m, curl has started blethering on about how long it took. I can fix that with swift but ruthless the flick of a -s switch to silence it. How about all that raw HTML though – I thought this w3m thing was supposed to parse my html, not just regurgitate it?

It turns out that w3m assumes its input is of MIME-type text/plain, unless told otherwise. Let’s set the record straight:

Aw yeah. Now we’re talking. Old-skool green-screen meets nu-school interweb. It’s like being back on the BBS network of yore.

What’s the point of all this? Well, that’s up to you. I have a couple of ideas, but you’re going to have to start coming up with your own you know. Why are you reading this anyway? Haven’t you got anything better to do?

]]>
https://blog.mattwynne.net/2008/04/26/fetch-and-parse-html-web-page-content-from-bash-wow/feed/ 11 56
Use Rsync to Copy Your ASP.NET Website https://blog.mattwynne.net/2008/03/23/use-rsync-to-copy-your-aspnet-website/ https://blog.mattwynne.net/2008/03/23/use-rsync-to-copy-your-aspnet-website/#comments Sun, 23 Mar 2008 01:34:29 +0000 http://blog.mattwynne.net/2008/03/23/use-rsync-to-copy-your-aspnet-website/ Continue reading "Use Rsync to Copy Your ASP.NET Website"

]]>
If you’ve ever tried to copy the source files from a Visual Studio 2005 ASP.NET solution, especially if you’re using TFS and Resharper, you’ll have probably noticed all great steaming heaps of fluff and nonsense these tools leave all over your hard drive. Not to mention all the built assemblies lurking in your bin/Debug folders.

If you have a unix/linux/apple machine handy, or have at least had the sense to instal cygwin or coLinux on your quaint old PC, then give this a rumble.

Prepare a file with the inclusion / exclusion rules for the files / folders you want to copy. For my solution, it looks like this:

  • *.cs
  • **/lib/.
  • *.csproj
  • *.sln
  • *.resx
  • *.jgp
  • *.gif
  • *.gif
  • *.aspx
  • *.ashx
  • *.js
  • *.ascx
  • *.config
  • *.xml
  • *.txt
  • *.html
  • *.htm
  • *.dbp
  • *.sql
  • */
  • *

There are a few fascinating points to note about this file:

  • The lines that begin with a ‘+’ character are include rules.
  • The second line copies anything in a /lib folder, which is where we keep dependencies in my world
  • The second-to-last line tells rsync to copy every folder. Without this, the last line would exclude all the folders (rsync works its way through the folder tree recursively) and you’d never get to the files you’d mentioned above. Read that bit again, it’s hard to understand at first, but important.
  • The last line excludes everything else.

Now fire up your terminal, and invoke the magic of rsync:

rsync -av –exclude-from=files.txt source/Projects/Widgets/ target/Projects/Widgets/

Which means

  • copy all files (recursively)
  • write verbose output

And there you have it. Yet more unix joy.

]]>
https://blog.mattwynne.net/2008/03/23/use-rsync-to-copy-your-aspnet-website/feed/ 2 44
Printing Your Todo.txt Lists to Index Cards at the Command Line https://blog.mattwynne.net/2007/10/07/printing-your-todotxt-lists-to-index-cards-at-the-command-line/ https://blog.mattwynne.net/2007/10/07/printing-your-todotxt-lists-to-index-cards-at-the-command-line/#respond Sun, 07 Oct 2007 21:05:10 +0000 http://blog.mattwynne.net/2007/10/07/printing-your-todotxt-lists-to-index-cards-at-the-command-line/ Continue reading "Printing Your Todo.txt Lists to Index Cards at the Command Line"

]]>
Like a few other people, I’m over kGTD. In the first flushes of my infatuation with the way of GTD she was good to me, showed me a few tricks I’d never seen before. We had some good times, syncing away. But my iCal started to fill up with billions of pointles calendars, my projects started to indent to the point where I couldn’t find them anymore, and I never quite got the hang of those… unique keyboard combos needed to navigate around Omni Outliner Pro. Sometimes, important things would go missing, and I gradually started to trust her less, and go back to paper and pens for my lists.

Until now. Todo.txt is a series of command-line scripts for slicing and dicing a text-based todo list. If you stick to a few conventions, you can use the scripts to suck out relevant information as and when you need it. Combined with the humble yet awesome power of the bash shell’s pipe, there are a multitude of ways you can shove your action lists in front of your lazy face. Trust me, if you keep or have ever kept your lists in a text file, you owe it to yourself to check the site out.

Something I always wanted to do with kGTD but never managed to in satisfactory manner was to sync my digital lists to index cards for perusing whilst (gasp!) off-line. Enter linux’s lp command:

todo.sh list | lp -o PageSize=Custom.3x5in -o page-top=10 -o page-bottom=10 -o page-left=5 -o page-right=5 -o lpi=8 -o cpi=15

See here for an explanation of all those crazy lp options.

I just love this stuff. Sometimes it’s almost as good as being back at the terminal of my faithful BBC Micro.

]]>
https://blog.mattwynne.net/2007/10/07/printing-your-todotxt-lists-to-index-cards-at-the-command-line/feed/ 0 18
Web-Based Backup… Via a Trickle https://blog.mattwynne.net/2007/09/29/web-based-backup-via-a-trickle/ https://blog.mattwynne.net/2007/09/29/web-based-backup-via-a-trickle/#respond Sat, 29 Sep 2007 17:27:18 +0000 http://blog.mattwynne.net/2007/09/29/web-based-backup-via-a-trickle/ Continue reading "Web-Based Backup… Via a Trickle"

]]>
A project I’ve been meaning to do for some time is set up a backup of the crucial folders on my home server to somewhere on the web. Preferably somewhere free, like my existing dreamhost space.

What I didn’t really consider is… and I bet you’ve already guessed it, dear reader: the piddly-poor upload speed on my ADSL connection. Quoted at 448 Kbps, by my reckoning that means I’ll get about 3.3GB up the wire in a 24 hour period… which means we may be here for quite some time. Better turn off that pesky Windows Update.

The nice thing is that, because I’m using rsync, once the initial sync is done, only the changes to files will be uploaded, so traffic should drop back to normal… some time in 2008.

]]>
https://blog.mattwynne.net/2007/09/29/web-based-backup-via-a-trickle/feed/ 0 17
SSH on Cygwin https://blog.mattwynne.net/2007/09/29/ssh-on-cygwin/ https://blog.mattwynne.net/2007/09/29/ssh-on-cygwin/#respond Sat, 29 Sep 2007 14:33:05 +0000 http://blog.mattwynne.net/2007/09/29/ssh-on-cygwin/ Continue reading "SSH on Cygwin"

]]>
I’m following Gina Trapani’s outstanding tutorials on lifehacker to get me some of that unix command-line joy on the rusty old windows box in the corner.

Note to other linux-naive cygwin users out there. If you want to install the ssh command, look for the package called ‘openssh’. No amount of staring at the packages squid and ssmtp is going to make it appear where you might expect it to.

]]>
https://blog.mattwynne.net/2007/09/29/ssh-on-cygwin/feed/ 0 16