The goal of efficiency is more slack.

Friday, June 23, 2017

Convert an mp3 into an audiobook in iTunes 12

Convert a long mp3 into an audiobook so your device can keep track of where you are. These instructions are tested with iTunes 12.6.1.25.
  1. Right click the mp3 in iTunes > Get info.
  2. Select the "Options" tab.
  3. Change "media kind" from "Music" to "Audiobook". Make sure "Remember playback position" and "Skip when shuffling" are checked.
  4. Select the "Details" tab.
  5. Change the fields "title" and "author". The "chapter" field can have the same value as "title".
  6. Click OK.
  7. Drag the audiobook to your iPhone or iPad. (optional)
Audiobooks appear in the iBooks app on the iPhone whereas podcasts appear in the Podcast app.

Saturday, June 19, 2010

Blog from the command line

GoogleCL allows you to post to your Blogger blog from the command line. To install:
  1. Install Python gdata libraries. This entails downloading, untarring, and sudo python setup.py
  2. Install GoogleCL. Same as above.
  3. Copy googlecl-0.9.5/build/scripts-2.6/google (version numbers subject to change) to /usr/local/bin or anywhere else in you PATH.
Now you can open a terminal and run a command like:

google blogger post --tags "online, shell" --title "Frist post using GoogleCL" "Can you believe I'm posting this from the command line?"

Or write your post in a text editor, saving it as ~/tmp/post.html, then:

google blogger post --tags "online, shell" --title "Blog from the command line" ~/tmp/post.html

Thursday, June 10, 2010

Writing a TiddlyWiki plugin

It was easier than I thought to write a simple TiddlyWiki plugin. I wanted to create a shortcut for the "Close all" button on the sidebar.
  1. Hack (a backup of) the core TiddlyWiki html or javascript to make it do what you want. Take note of the functions or objects you edited.
  2. Copy the plugin template [TiddlyWiki.org].
  3. Paste the template into a new tiddler in a stock TiddlyWiki html (not the one you edited).
  4. File out the boilerplate stuff like the plugin's name and author.
  5. Override the functions or objects you noted in step 1 by writing code in !Code section of the tiddler.
  6. Add "systemConfig" to the tag field of the tiddler and save the tiddler.
  7. Save changes to the TiddlyWiki and refresh.
For your convenience, here's the plugin template. Be sure to replace SamplePlugin with the name of your plugin.

/***
|''Name''|SamplePlugin|
|''Description''|<...>|
|''Icon''|<...>|
|''Author''|<...>|
|''Contributors''|<...>|
|''Version''|<...>|
|''Date''|<...>|
|''Status''||
|''Source''|<...>|
|''CodeRepository''|<...>|
|''Copyright''|<...>|
|''License''|<...>|
|''CoreVersion''|<...>|
|''Requires''|<...>|
|''Overrides''|<...>|
|''Feedback''|<...>|
|''Documentation''|<...>|
|''Keywords''|<...>|
!Description
<...>
!Notes
<...>
!Usage
{{{
<>
}}}
!!Parameters
<...>
!!Examples
<>
!Configuration Options
<...>
!Revision History
!!v<#.#> ()
* <...>
!To Do
<...>
!Code
***/
//{{{
if(!version.extensions.SamplePlugin) { //# ensure that the plugin is only installed once
version.extensions.SamplePlugin = { installed: true };

if(!config.extensions) { config.extensions = {}; } //# obsolete from v2.4.2

config.extensions.SamplePlugin = {
sampleFunction: function() {
/* ... */
}
};

config.macros.SampleMacro = {
handler: function(place, macroName, params, wikifier, paramString, tiddler) {
/* ... */
}
};

} //# end of "install only once"
//}}}

Wednesday, May 19, 2010

Upgrading X11 Server on Mac OS X 10.5.8 Leopard

Before:
After:
Some programs found in the MacPorts repository use X. If you followed the default directions on the site as I did and decided to use Apple's X instead of MacPort's, your X is outdated and may cause some problems on those MacPorts installed apps. I got the upgrade in an easy-to-use installer by going to http://xquartz.macosforge.org/, clicking on Latest Release, and downloading the dmg (X11-2.5.0.dmg at the time of this writing).

Be warned that an Apple update will clobber this install. Therefore, you should get the latest X from http://xquartz.macosforge.org/ and install it after an Apple update.

git


My gitk (which uses X) stopped working after the update. I'm not sure if it was the update as I forgot if I ever ran it successfully before the update. Fix: I simply went to the git-osx-installer site on Google Code and downloaded the latest installer under Featured downloads on the sidebar.

Wednesday, March 17, 2010

Using Firefox to view man pages on OS X

Prerequisites:

  • Apache web server running
  • perl

Download man2html

man2html
Mac version I used

Install it

cd to the directory containing contents of tarball.
sudo perl install.me

Put man.cgi into local cgi-bin

Mac: cp man.cgi /Library/WebServer/CGI-Executables/

Configure man.cgi

First line:
#!/usr/bin/perl

Around line 126, add paths to your man pages, including programs you've installed (usually in /usr/local/), e.g. I've installed git:

@ManPath = qw(
/usr/share/man
/opt/local/man
/opt/local/share/man
/usr/local/git/share/man
);

Configure Apache

In /etc/apache2/httpd.conf:

<Directory "/Library/WebServer/CGI-Executables">
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</Directory>

Restart the server to reload the httpd.conf.

Configure Firefox

(source: tips4linux.com)

Go to Bookmarks > Organize Bookmarks;
Open a bookmark folder then right-click and chose New Bookmark;
Name the new bookmark man;
In the Location field paste this line:

http://localhost/cgi-bin/man.cgi?section=all&topic=%s

In the Keyword field type man;
Click Add.

Done. Sweet.

To view a man page, just type in the URL bar of Firefox:
man some-command

For example:
man ls

Saturday, July 22, 2006

GeoShell

GeoShell is an amazing minimalistic Windows shell replacement. No more stupid taskbar. Just about everything can be keyboard shortcutted. I've set it up so my desktop is basically just a wallpaper. The main keys I use are alt-shift-F for task switcher and alt-shift-S for my customized start menu. I'm using the geoXWM plugin to use virtual desktops like in most Linux window managers.

So happy. My efficiency: up 25%, productivity: -300%. I waste so much time mucking around with my UI.

Wednesday, July 05, 2006

The Yuppies are coming

A poetic post from slashdot comparing Macs, *nix, and Windows to real-world locales:

The yuppies are coming

(Score:5, Insightful)
by BlueStraggler (765543) on Monday July 03, @04:15PM (#15653193)

What's really happening is that Mac "nerds" are becoming versed enough in Unixisms because of OS X that they can take a walk on the wild side with Linux and not get completely freaked out. They have just enough street smarts to take a walk through the OS inner city with the tough nerds, and not get shot or beat up. And they've discovered that, hey, wow there's a lot of cool shit happening on the mean streets of Linuxville.

But what they don't know is that downtown Linuxville hasn't been a rough a place for a few years now. It still clings to its tough reputation, but it's all college kids and coffee bars now. The place is gentrifying, and has a bit of that yuppie stench to it these days. It's not yet all Wonderbread and Wal-mart, like Windowsland, up the highway, but the Windowsland folks are moving in, and it's starting to get that feel.

The old-timers who gave Linux the frightening reputation that it carries, have long since settled down, had kids, and moved out to the leafy lanes and plush lawns of Mactown, to get away from the plastic Windowsland people. As a result, the Mactown folks have realized those Linux guys aren't so scary after all, beards and sandles notwithstanding. Maybe, some of the Mactown folks think, we could get a condo in Linuxville, and try some of that inner city living. Just on weekends for a start.

So they get a luxury condo in Linuxville, right on Ubuntu Street, which was built by a big-name property developer who saw that all the starving artists were living in the area, building cool lofts and studios from the abandoned tenements and factories of old Unixville. So he bottled up that artsy mojo and built a condo development with new appliances, and hardwood floors, and put in a Starbucks on the ground floor, and marketed it heavily to Mactown and Windowsland people looking for a change. Come to Linuxville! Not as scary as you think! But every bit as edgy! Now with taskbars! Sometimes you get contemptuous looks from the mean looking men who still hang out on Slackware Road, but it's best not to go down there if you can help it. If you can avoid them (and ignore the snotty punks on Gentoo Avenue), then it's all terrifically edgy and artsy, and just so-o-o-o nerdy cool in that certain je-ne-sais-quoi kind of way. It feels like they're right on the cutting edge, where the culture is created, where everything happens, just like they read in Wired Magazine in 1996.

Thursday, June 15, 2006

I Love Programming

I just finished a tutorial on making a Java chat server and client. My first attempt at network programming, and it works like a charm! Yea, I know it's nothing to brag about, but I thought it would be so hard to do any kind of network programming because it was hard enough to do interprocess communication in Visual C++. But Java is so clean and simple! And to think, it's free as in beer, and Eclipse is free as in freedom.

Damn, I should've gotten into Java a long time ago. I wouldn't have had to detour into these other crazy interests of mine. Not that I regret them, but I could've saved them for later, after I get a regular programming gig.

Friday, May 05, 2006

Gnaural vs. NNS

I like Neural Noise Synthesizer but but it's $35 price tag is a bit hefty for a simple noise/tone generator, so I'm feeling like contributing to Gnaural and making it as powerful as NNS. What a perfect way to contribute to the open source community as well as expand my brain wave entrainment experiments! Okay, now someone tell me how to program in GTK.

Thursday, May 04, 2006

LyX for Math

I just discovered LyX and its math editor, and I'm in love. I was looking for a math editor to do my physics homework. A teacher recommended MathType. It costs $100. Heck no! So I searched for a GNU alternative, and wham, I saw a picture of AbiWord with a LaTeX popup editing a math formula! Beautiful.

Unfortunately, I'm not too familiar with LaTeX or plugins/customizing AbiWord. I decided to just use LaTeX, which is when I discovered a frontend for it called LyX.

Wow, keyboard shortcuts for every symbol (e.g. \infty for infinity symbol)! Wow, subscripts (^) and superscripts (_)! Why math with pencil and paper sucks:
  • Writing tiny sub- and superscript numbers can get messy.
  • Big matrices are a huge waste of paper.
  • Make a mistake near the top, eat a fraction of an eraser.
  • No copy & paste means more tedium and more errors.
I think I'm going to like math again.

Friday, April 14, 2006

FreeDOS to the Rescue

I installed Ubuntu 5.10 again on my good old laptop, but I made a booboo. I told it to overwrite the MBR. It overwrote the Windows 2000 MBR. I used my Windows 98 boot disk to fdisk /mbr. Destroyed the partition table. I tried booting with W2K boot disk, but it could never read the 2nd disk for some reason. I used Partition Magic 8.0 Boot Disks to recreate the partition in hopes of repairing the table. Still broken. Worse still, the Windows 98 boot disk doesn't recognize my 2nd partition, a FAT32 with a Norton Ghost image on it of the C: drive.

Didn't sleep well last night. Today, I downloaded a boot disk that used FreeDOS. It could read the (broken?) partition table and loaded my D: partition with the Ghost image!

Wednesday, April 05, 2006

Palm V Battery Replaced

Replaced the battery on my Palm V PDA finally. I had the new battery for almost a year. I thought it was going to be harder to open the Palm, but it wasn't a big deal. I just put a blow dryer to the sides for about 2 minutes to melt the glue with the Palm V face down and then pried open the back with a blade, starting from a corner. I only needed to remove the back panel. (There's a middle and front piece as well.)

To put it back together, I heated it up again with the blow dryer and pressed the panels together. Remember to use gloves because it's hot.

Thursday, February 09, 2006

Palm vs Laptop for Writing

The Palm is so much harder to use for note taking because of its setup time (I use a portable keyboard) and lack of a backlit display, but I like how small it is and how I don't have to worry about the battery drain as much. If only I could make this laptop use as little power as the Palm. Hm, I think I can if I install a very minimal Linux on this laptop. It could avoid accessing the hard drive except for explicit saves. It could run without X to facilitate boot time, although Ion doesn't take much time to load at all. Another benefit would be that I could type in Dvorak. One annoyance is that I won't be able to use metapad, which is for Windows. Vim is not great for prose, its text-wrapping has to be fixed after an edit. Nano doesn't word wrap. Nedit is for X. Anyone know of a lightning fast (to load) word processor for console Linux?

Wednesday, December 07, 2005

Efficiency Can Be Unproductive

I don't know whether I should concentrate on user-friendly programs or my own crazy preference for minimalistic but keyboard-shortcut-filled programs. I like customizing my laptop to be super-efficient, but it doesn't help anyone except me and other extreme nerds since usability has an inverse relationship with the number of shortcuts and jury-rigging present.

For example, I'm using mocp for playing mp3s and wrote a perl script that deletes the currently played song on the pressing of a hotkey. Who would use this? It's not even written robustly. Another example: I removed some pauses in w3m by editing a couple lines in its source code. I don't feel like sending a patch because maybe others find those pauses useful. I didn't make it an option--I just hardcoded it. I guess I'm not confident enough in my coding to post anything, but maybe later. Plus, I don't even know how to use diff/patch. The docs are tremendous. Arg.

The benefit of working with user-friendly apps is that I can provide support for people who want to try Linux. If I learn Gnome in and out, I can evangelize GNU so much more easily since I wouldn't be punishing my computer semiliterate friends by forcing the command line (or some obscure window manager) on them. Not everyone wants to spend 20 hours of research to produce a shortcut that trims a task by a mere 2 seconds. Not everyone wants a lightning fast browser that has trouble displaying Flash and RealMedia, regardless of how evil proprietary formats are or how fat and slow common browsers are.

If I use common apps, I don't get to feel fast and efficient, but what is efficiency anyway? Twenty hours to save two seconds? I really need to stop trying to be efficient since it's making me incredibly unproductive. I had just used Windows to create a website in about 3 hours without too much thought or hassle. If I had done it the Right Way, it would've taken two days probably. I have to strike a balance between meta-productivity ("efficiency") and measurable, invoiceable productivity. Currently, I spend way too much time getting ready for tomorrow's projects by working on new skills, technologies, and processes that I don't get today's projects done.

Thursday, November 17, 2005

Free your mind

N. showed me his KDE. Looks sweet, kinda like OS X. I tunnelled X thru SSH to see it. That was slow. Bad.
  • Caps Lock into ESC: Good for vim and everything else. Used xmodmap.
  • Freemind: Hot stuff! I can finally create mind maps with ease. I hate doing them on paper. There just isn't enough room. Highly recommended notetaking program.
  • dict, dictd, dict-wn, dict-gcide: Command line dictionary. Screw gnome-dictionary and its slowness.
To do:
  • OSS: (Maybe) I removed it to get rid of the buzz, but now some old programs won't have sound. :(
  • Learn more about notetaking with vim.
  • Sleep better.

Tuesday, November 15, 2005

Learn Incrementally

Steve Litt shows how to learn incrementally, add to or modify configuration files one step at a time and see the result. Hey this is what I do, but I don't document as well as he does. I need a way to organize my notes. Maybe I'll look into Tuomo's "Riot" note-taking software. Or maybe I'll just use blogger.

Popular Posts

Recent Posts

Unordered List

Text Widget

Pages

Powered by Blogger.
Scroll To Top