Skip to content

Instantly share code, notes, and snippets.

@gsf
gsf / gist:51776e85bc6dc62ec32b
Created July 16, 2014 12:23
FI9821W VLC web streaming
cvlc rtsp://xxx:[email protected]:88/videoMain --sout="#transcode{vcodec=theo,acodec=vorb,ab=128,channels=2,samplerate=44100}:std{access=http{mime=video/ogg},mux=ogg,dst=:8080/vid.ogg}"
@gsf
gsf / ed.md
Last active August 29, 2015 14:03
ed is the standard text editor
$ ps aux | grep Iptab
root 2487 0.0 0.0 1216 32 ? S 17:17 0:00 /boot/.IptabLes
root 2489 0.0 0.0 50368 252 ? Sl 17:17 0:00 /boot/.IptabLes
root 2493 0.0 0.0 852 32 ? S 17:17 0:00 /boot/.IptabLex
root 4013 0.0 0.0 9040 188 ? Sl 18:04 0:00 /boot/.IptabLex
root 4209 163 0.0 50952 604 ? Sl 18:19 0:01 /boot/.IptabLes
gsf 4215 0.0 0.0 3428 772 pts/5 R+ 18:19 0:00 grep --color=auto Iptab
$ ps aux | grep Iptab
root 2487 0.0 0.0 1216 32 ? S 17:17 0:00 /boot/.IptabLes
root 2489 0.0 0.0 50368 256 ? Sl 17:17 0:00 /boot/.IptabLes
@gsf
gsf / .xinitrc
Last active August 29, 2015 14:01
fullscreen x
matchbox-window-manager -use_titlebar no &
exec xterm
@gsf
gsf / avi2mp4.sh
Last active August 29, 2015 14:01
avi2mp4
$ for f in *.avi; do ffmpeg -i $f -strict -2 `basename $f .avi`.mp4; done

With etagres and streaming:

$ nab http://localhost:1041/about
REQ NUM: 100 RTN NUM: 100 QPS: 33 BODY TRAF: 517KB per second
REQ NUM: 300 RTN NUM: 290 QPS: 48 BODY TRAF: 750KB per second
$ ps aux | grep node                                                                          
gsf       8938 25.2  2.6 757788 104256 pts/8   Sl+  12:52   0:07 node server.js
$ node-tick-processor
...
   ticks parent  name
@gsf
gsf / deva.md
Created December 27, 2013 04:09
deva notes

Dev script that does the following:

  1. Restarts the server on changes (a la node-dev)
  2. Bundles up browserify
  3. Restarts and re-bundles on template changes
  4. Compiles lesscss files
  5. Reload browser on any change
@gsf
gsf / try.sh
Last active December 29, 2015 03:29
sh/bash try/catch on error message grep
#!/bin/sh
# Attempt command, printing all output to stdout, catching errors
# based on a regex, erroring out on all other errors
if output=`some-command 2>&1`
then
echo "$output"
else
if echo "$output" | grep 'regex string'
then
something --other --than bailing
@gsf
gsf / gist:6958141
Last active December 25, 2015 09:59
Death tracks

[Originally posted in a comment at http://www.westphillylocal.com/2013/10/11/a-woman-critically-injured-in-hit-and-run-accident-near-38th-and-spruce/.]

I'm not kidding. Road-level trolley tracks and cyclists simply do not mix. I've been in accidents due to tracks in Philadelphia and San Francisco -- the two cities I've lived in with tracks in the streets. Nearly every cyclist I know in Philadelphia has been in at least one minor accident involving tracks, and several have real horror stories. A friend broke several bones in her face due to a slip on the tracks just weeks ago.

But you're right. I may be overestimating in my "thousands of injuries" claim. Unfortunately, we don't have solid data around this issue to reason from. No one keeps track of the number of bicycle accidents caused by trolley tracks, and cycling accidents in general are sorely under-reported. According to the 2012 PennDot Crash Facts & Statistics [1], there were 1,369 total bicycle accidents in Pennsylvania. Considering the estimated 36

@gsf
gsf / PluginConnector.class.php
Last active December 23, 2015 08:59
updateUserEvents
// ...
/**
* Updates UserEvents that are in the past and if the selection strategy of
* first is used will update, but not mark as incomplete, encounters that are
* ongoing. This method does not normally need to be modified.
*/
protected function updateUserEvents()
{
//$this->updateExpiredUserEvents();