Skip to content

Instantly share code, notes, and snippets.

View vr000m's full-sized avatar
💥

Varun Singh vr000m

💥
View GitHub Profile
@vr000m
vr000m / gstreamer.cli
Created June 15, 2011 20:04
gstreamer cli
YUV -> MP4
gst-launch filesrc location=<YUV file name> ! videoparse height=144 width=176 framerate=15 ! x264enc name=encoder byte-stream=true bitrate=64 ! mp4mux ! filesink location=<mp4 file name>
gst-launch filesrc location=foreman15_600.yuv ! videoparse height=144 width=176 framerate=15 ! x264enc name=encoder byte-stream=true bitrate=64 ! rtph264pay name=packetiser ! fakesink
MP4 -> YUV
gst-launch filesrc location=<MP4 file name> ! qtdemux ! ffdec_h264 ! videoparse height=144 width=176 framerate=15 ! filesink locatiion=<YUV file name>
----
Stream MP4 file
gst-launch filesrc location=IM2-YT-2_128k_20.mp4 ! qtdemux ! rtph264pay seqnum-offset=0 timestamp-offset=0 ssrc=0xaaaabbbb mtu=1450 perfect-rtptime=true ! udpsink clients=172.16.183.134:4400
@vr000m
vr000m / README.md
Created August 20, 2012 14:29
ConMon Readme

Synopsis


ConMon is a command line utility that measures the traffic to and from an endpoint. ConMon passively monitors the IP packets and classifies them to measure the bit rate for each of the classifiers.

It is based on the Sniffer example in libpcap (tcpdump).

Current classifiers:

@vr000m
vr000m / gist:3776984
Created September 24, 2012 16:53
Converting MP3 to PCM A-law

There are many ways to do this, you can use:

  • FFMpeg
  • Gstreamer
  • lame
  • MPG123
  • Sox
  • Mplayer

Here is one example: Converting sample.mp3 to 8KHz sample rate PCM/16 file.

/*
History.js Native Adapter
@author Benjamin Arthur Lupton <contact@balupton.com>
@copyright 2010-2011 Benjamin Arthur Lupton <contact@balupton.com>
@license New BSD License <http://creativecommons.org/licenses/BSD/>
History.getInternetExplorerMajorVersion()
Get's the major version of Internet Explorer
@return {integer}
@vr000m
vr000m / dummynet_config.md
Last active December 15, 2015 11:29
Enabling dummynet and re-compiling your kernel

$sudo make menuconfig

  • "Processor type and features" ---> "Timer frequency" ---> 1000Hz [no 10000Hz option :(]
  • "Networking support" ---> "Networking Options" ---> "Network Packet Filtering framework" ---> enable options that you need
$sudo make oldconfig
$sudo make prepare
$sudo make scripts
$sudo make
@vr000m
vr000m / gist:7502737
Created November 16, 2013 17:19
converting blacks and greys to white (ImageMagick)
$ convert title.png -fill "white" -opaque "#1a1a1a" title-inv.png
$ convert title-inv.png -fill "white" -opaque "#000000" -fuzz 10% title-inv2.png
@vr000m
vr000m / gist:7502783
Created November 16, 2013 17:24
color schemes
https://kuler.adobe.com/create/color-wheel/?base=2&rule=Monochromatic&selected=2&name=My%20Kuler%20Theme&mode=rgb&rgbvalues=0.32124630674187477,0.32124630674193505,0.5862745098039215,0.32753961858716085,0.3275396185871742,0.38627450980392153,0.1568627450980392,0.1568627450980392,0.28627450980392155,0.49712865968305125,0.49712865968307157,0.5862745098039215,0.4856298683857104,0.4856298683858015,0.8862745098039215&swatchOrder=0,1,2,3,4
@vr000m
vr000m / osx-web-service
Last active August 29, 2015 14:06
turning on web sharing on mavericks
$ sudo defaults write /System/Library/LaunchDaemons/org.apache.httpd Disabled -bool false
$ sudo apachectl start
@vr000m
vr000m / psql-yosemite
Created October 18, 2014 10:54
PSQL folders missing in Yosemite
$ mkdir /usr/local/var/postgres/pg_tblspc
$ mkdir /usr/local/var/postgres/pg_twophase
$ mkdir /usr/local/var/postgres/pg_stat_tmp
$ pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
@vr000m
vr000m / apache-yosemite-websharing.md
Last active April 2, 2018 12:05
Enabling WebSharing on OSX 10.10 (Yosemite)

the horror!

The jist of starting and stoping apache:

$ sudo apachectl start
$ sudo apachectl stop
$ sudo apachectl restart

if you care about the HTTPD version