Skip to content

Instantly share code, notes, and snippets.

@oneman
oneman / xmms2rcc.rb
Created November 25, 2008 20:26
xmms2 ruby curses client
#!/usr/bin/env ruby
#
# xmms2 ruby curses client
#
# wrotted by David Richards
#
# oneman on #xmms2
#
# give me some money license
[homeview@ey01-s00152::/data/sandbox/current]$ ps ux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
homeview 3410 0.0 0.1 41908 2388 ? S 2008 0:25 nginx: worker process
homeview 3411 0.0 0.1 41812 2416 ? S 2008 0:25 nginx: worker process
homeview 3412 0.0 0.1 42128 2308 ? S 2008 0:24 nginx: worker process
homeview 3414 0.0 0.1 42096 2352 ? S 2008 0:24 nginx: worker process
homeview 3737 0.0 0.0 24844 248 ? Ss 2008 0:00 SCREEN
homeview 3738 0.0 0.0 19212 260 pts/1 Ss 2008 0:00 -/bin/bash
homeview 3745 0.0 0.0 4852 272 pts/1 S+ 2008 0:01 /home/homeview/beanstalkd-0.11/beanstalkd
homeview 3749 0.0 0.0 24908 1008 ? Ss 2008 0:00 SCREEN
#!/usr/bin/env ruby
# This is a wrapper script for beanstalkd to drop a .pid file so it can be used by monitoring programs ( like monit )
# customise to your needs below
# usage: beanstalkd {start|stop} (chmod +x the file )
# assumed file is placed in RAILS_ROOT/script
#RAILS_ROOT = "#{File.dirname(__FILE__)}/.."
# your choice
[oneman@blackbox::~]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 28G 8.6G 18G 33% /
tmpfs 3.0G 0 3.0G 0% /lib/init/rw
varrun 3.0G 396K 3.0G 1% /var/run
varlock 3.0G 0 3.0G 0% /var/lock
udev 3.0G 180K 3.0G 1% /dev
tmpfs 3.0G 0 3.0G 0% /dev/shm
lrm 3.0G 2.2M 3.0G 1% /lib/modules/2.6.28-15-server/volatile
/dev/sda3 45G 28G 15G 66% /extra
Encoding Autechre - Amber (1994) [FLAC]/audio/ flacs to ogg with 4 threads
Started Encoding: 07 - Nine.flac
./oggit.rb:21: warning: Insecure world writable dir /home/oneman in PATH, mode 040777
Started Encoding: 08 - Further.flac
Started Encoding: 05 - Glitch.flac
Started Encoding: 10 - Nil.flac
Finished Encoding: 07 - Nine.flac took 7.982414
Started Encoding: 01 - Foil.flac
Finished Encoding: 05 - Glitch.flac took 14.687249
Started Encoding: 09 - Yulquen.flac
#!/usr/bin/ruby
# encode dir of flacs to ogg and move to an ogg dir
require 'fileutils'
$oggdir = "/home/oneman/Music/Ogg/"
$maxthreads = 4
$total_thread_time = 0
#!/usr/bin/env ruby
# xmms2-gnome-mediakeys-listener.rb
#
# this xmms2 client connects to the gnome settings daemon
# which broadcast out a dbus signal when those prev, play/pause, next keys are hit on your keyboard
# this listens for those signals and tells xmms2 to do something via simple command line
#
# 2010 rawdod / oneman / drr
/*
xmms2-gnome-mediakeys-listener.c
this xmms2 client connects to the gnome settings daemon
which broadcast out a dbus signal when those prev, play/pause, next keys are hit on your keyboard
this listens for those signals and tells xmms2 to do something via simple command line
2010 rawdod / oneman / drr
/*
xmms2-gnome-mediakeys-listener.c
this xmms2 client connects to the gnome settings daemon
which broadcast out a dbus signal when those prev, play/pause, next keys are hit on your keyboard
this listens for those signals and tells xmms2 to do something via the client lib
now uses the xmms2 client lib
#!/bin/sh
# CONVERT VIDEO FOR DROID
# LOOKS LIKE FRIGGIN PERFECT
# ANY VIDEO MPLAYER CAN PLAY
# 848x480 1700k h264 / 192k aac
# Sanity check
if [ -z "${2}" ]; then
echo "2-pass x264 video converter for Motorola Droid"