Author Archives: timwarnock

VLC remote control

Recently I was using VLC to listen to music, as I often do, and I wanted to pause without getting out of bed. Lazy? Yes! I learned that VLC includes a slew of remote control interfaces, including a built-in web … Continue reading

Posted in shell tips | Comments Off on VLC remote control

datsize, simple command line row and column count

Lately I've been working with lots of data files with fixed rows and columns, and have been finding myself doing the following a lot: Getting the row count of a file, twarnock@laptop:/var/data/ctm :) wc -l lda_out/final.gamma 3183 lda_out/final.gamma twarnock@laptop:/var/data/ctm :) … Continue reading

Posted in bash, shell tips | Comments Off on datsize, simple command line row and column count

Getting the most out of your ssh config

I typically find myself with voluminous bashrc files filled with aliases and functions for connecting to specific hosts via ssh. I would like an easier way to manage the various ssh hosts, ports, and keys. I typically maintain an ssh-agent … Continue reading

Posted in shell tips, ssh | Comments Off on Getting the most out of your ssh config

git, obliterate specific commits

I would like to obliterate a series of git commits between two points, we'll call these the START and END commits. First, determine the SHA1 for the two commits, we'll be forcefully deleting everything in between and preserving the END … Continue reading

Posted in shell tips | Comments Off on git, obliterate specific commits

vim: Visual mode

I have been using vim for years and am consistently surprised at the amazing things it can do. Vim has been around longer than I have been writing code, and its predecessor (Vi) is as old as I am. Somehow … Continue reading

Posted in shell tips, vim | Comments Off on vim: Visual mode

vim: tags and tabs

Previously, I discussed using vim and screen with automagic titles. The great part about working with vim and screen is that I can work from anywhere with minimal setup, and when working remotely I can pick up the cursor exactly … Continue reading

Posted in shell tips, vim | Comments Off on vim: tags and tabs

vim and screen, automagic titles

Previously, I discussed using multiuser screen so that I could concurrently access a shared screen session across multiple remote hosts (from work, from home, from my phone, etc). I would like to augment screen such that the titles would always … Continue reading

Posted in bash, shell tips, vim | Comments Off on vim and screen, automagic titles

node.js redirect with query string

Previously, I discussed javascript appending to query string, where we serialized an associative array to a query string. I would now like to leverage this technique within node.js as a redirect service. Specifically, I am using express to make a … Continue reading

Posted in javascript | Comments Off on node.js redirect with query string

javascript appending to query string

I would like to append an associative array to a URL's query string. For whatever reason, there is no native javascript method to accomplish this task. This needs to be done manually or using a common web framework such as … Continue reading

Posted in javascript | Comments Off on javascript appending to query string

multiuser screen

Previously, I discussed using GNU screen as a window manager. I would like to access my screen session concurrently from multiple hosts (say, at work, at home, and even remotely on my phone). I would also like to define default … Continue reading

Posted in bash, shell tips | Comments Off on multiuser screen

scripting Photoshop for stop motion

I would like a simple and quick way to save a copy of an image in Photoshop, with an auto-incrementing filename. Ideally, a single button to capture a frame in a stop motion animation. In other words, I would like … Continue reading

Posted in html, javascript, shell tips | Comments Off on scripting Photoshop for stop motion

locking and concurrency in python, part 2

Previously, I created a "MultiLock" class for managing locks and lockgroups across a shared file system. Now I want to create a simple command-line utility that uses this functionality. To start, we can create a simple runone() function that leverages … Continue reading

Posted in python, shell tips, software arch. | Comments Off on locking and concurrency in python, part 2

locking and concurrency in python, part 1

I would like to do file-locking concurrency control in python. Additionally, I would like to provide a "run-once-and-only-once" functionality on a shared cluster; in other words, I have multiple batch jobs to run over a shared compute cluster and I … Continue reading

Posted in python, software arch. | Comments Off on locking and concurrency in python, part 1

zip archive in python

I would like to create zip archives within a python batch script. I would like to compress individual files or entire directories of files. You can use the built-in zipfile module, and create a ZipFile as you would a normal … Continue reading

Posted in python, shell tips | Comments Off on zip archive in python

chaining ssh tunnels

Imagine you're working within a private home network and need to connect to an Oracle database within a corporate network accessible only through a bastion host hidden within the corporate network. Odd as that sounds, it's a typical network configuration, … Continue reading

Posted in bash, shell tips, ssh | Comments Off on chaining ssh tunnels