James Fishwick

  •  Minimal
  •  CSS Tomfoolery

jolicloud as music server

linux, media server, review

No Comments


Share this post

Got an old IBM Thinkpad T41, probably 6 or 5 six years old: Intel Pentium 1.6GHz, 748.8Mb RAM, 30GB harddrive. Had plans for some sort of media server: maybe VortexBox, maybe Plex, maybe XBMC (I didn’t really actually know much about any of these, just that they could run on old machines, and you know, stream shit). The machine has XP on it, completely wiped of any and all anything else than then day it was first turned on. So at first I just did some driver updates and installed iTunes and Chrome. iTunes was just playing our shared iTunes libraries via Home Sharing and I had Chrome for MOG. Whee, except even using MOG with the latest version of Chrome was horribly slow, and I realized more than ever what a sluggish, bloated POS iTunes has become.

So the laptop is old and slow, and we don’t really watch movies or TV or play video games. So these heavy duty media server installs are too much, clearly. We want to play music, and maybe be able to hop onto allmusic.com or wikipedia for some fact-checking. We want to use mainly web-based streaming apps like MOG, Spotify and last.fm, be able to listen to NPR and other podcasts, watch/listen to stuff on youtube, and play from our iTunes libraries remotely. Hmm, barring that last requirement, doesn’t it just sound like what I really need is a Chromebook (Google’s netbook? Say, can I install Chrome OS on my machine? No, but you can install Chromium OS and it might not work amazingly well. Read through that post and its one of those that keeps us all afraid of Linux. But check the comments and enter Jolicloud OS!

Read more

total directory size hold the extra foo

CLI, Code Snippet

No Comments


Share this post
du -h | tail -n 1

Read more

bash find and boolean operators

CLI, Code Snippet, Note to Self

No Comments


Share this post

Just because it took me way too long this morning to figure out how Boolean operators work with find.

Suppose I want to find the files with .png and .jpg extensions.

Its not

$ find /path/ -name '*.png' -and -name '*.jpg'

but

$ find /path/ -name '*.png' -or -name '*.jpg'

The “-and” refers to one set of file names where both conditions are met (as if we didn’t use the boolean at all). The “-or” says I’m looking for either/both of two sets.

So to explain further:

Read more

On the Cloud

Networking

No Comments


Share this post

Yes, now running a Bitnami WordPress package on an Amazon EC2 instance. Still tweaking, but very cool stuff so far!

Read more

Download a list of HTML pages with dependencies

CLI, Code Snippet

No Comments


Share this post
wget --page-requisites -i list.txt

Where ‘list.txt’ is a list of URLs separated by line breaks.

If you aren’t interested in certain files, say images, there is a further flag to reject certain file types:

--reject=gif,jpg,png

I love wget!

 

Read more

Conditional Tags for Custom Post Types & Taxonomies

Code Snippet, Note to Self, WordPress

No Comments


Share this post

Most WordPress instances used to power a full site or shop will hopefully take advantage of the power combination of Custom Taxonomies and Custom Posts. Often you want to style a list of your Custom Posts by Custom Taxonomy and have the single view styled in the same way, or perhaps have the same sidebar. You can do this with by leveraging the Template Hierarchy and registering tons of sidebars. However, before long, you can find your theme folder bloated with extra templates. I don’t like having tons of templates in my themes. Too much code duplication usually. Rather, I like to use Conditional Tags and get_template_part. When dealing with Custom Taxonomies & Post Types it may not be clear at first how one can best use Conditional Tags to good use. Lets take a look.

Read more

check if checkbox/radio is checked using jQuery

Code Snippet, jQuery, Note to Self

No Comments


Share this post
//returns true or false
$('"input[type=radio]').is(':checked');

$("input[type=checkbox]:checked").each(
    function() {
       // do something at each checked radio or checkbox
    }
);

Read more

Modernizr and jQuery and wp_enqueue_script oh my

Code Snippet, Javascript, Note to Self, WordPress

No Comments


Share this post

Some questions on the best way to use Modernizr with jQuery in the context of WordPress…

I want to be able to use jQuery in my complete callbacks. I, of course, want to be able to use wp_enqueue_script.

Read more

Committing to WordPress svn via proxy

Networking, Note to Self, WordPress

No Comments


Share this post

Multiple times when I was recently updating my svn repository for my Jetpack Easy Playlists plugin, I wasunable to connect to the WordPress SVN repository and execute basic svn commands. Kept getting warnings that looked like this:

svn: warning: Error handling externals definition for XXXX
svn: warning: PROPFIND of '/!svn/XXXX/default': could not connect to server (http://plugins.svn.wordpress.org)

Strangely, I was able to browse the repository via my browser, as well as checkout other public svns. I’m not behind a proxy, with a normal COMCAST connection.

What gives and how did I get around it?

Read more

textutil use cases

CLI, Note to Self, Production Automation

No Comments


Share this post

I don’t use my Mac as my main development/production workstation anymore, but its still my one-stop shop for all matter of text conversions.

While I have a very specific and regular use-case for textutil, namely converting Word .docs into barebones HTML or PDFS, there are plenty of features that make it a highly useful and general purpose tool. textutil can convert from/to txt, html, rtf, rtfd, doc, docx, wordml, odt and webarchive.

The basic syntax is:

textutil -convert fmt filename

Read more