Skip to content

Instantly share code, notes, and snippets.

View vr000m's full-sized avatar
💥

Varun Singh vr000m

💥
View GitHub Profile
@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
Compile the Redis "notifications" branch on Github.
Start Redis with ./redis-server --notify-keyspace-events yes
Subscribe to all the events with:
redis-cli psubscribe '*'
In another terminal window, play with redis-cli: set, del, expire, ... Only a few already work.
anonymous
anonymous / gist:4473913
Created January 7, 2013 10:23
Bootstrap icons: take filename as commandline input and convert using ImageMagick
#!/bin/bash
# take filename as commandline input and convert using ImageMagick
echo $1
convert $1 -resize 16x16\! favicon.ico
convert $1 -resize 57x57\! apple-touch-icon-57-precomposed.png
convert $1 -resize 72x72\! apple-touch-icon-72-precomposed.png
convert $1 -resize 114x114\! apple-touch-icon-114-precomposed.png
convert $1 -resize 144x144\! apple-touch-icon-144-precomposed.png
@mbostock
mbostock / .block
Last active January 30, 2024 13:24
Calendar View
license: gpl-3.0
height: 2910
border: no
redirect: https://observablehq.com/@d3/d3-calendar-view
@vojto
vojto / gist:3954249
Created October 25, 2012 17:41
Cocoa script for getting definitions of words
int main(int argc, const char * argv[])
{
@autoreleasepool {
if (argc == 1) {
return 1;
}
NSString *word = [NSString stringWithCString:argv[1] encoding:NSUTF8StringEncoding];
CFStringRef result = DCSCopyTextDefinition(nil, (__bridge CFStringRef)word, CFRangeMake(0, word.length));
@zziuni
zziuni / stuns
Created September 18, 2012 08:05
STUN server list
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net
@benjchristensen
benjchristensen / index.html
Created August 9, 2011 05:38
Simple Sparkline using SVG Path and d3.js
<html>
<head>
<title>Simple Sparkline using SVG Path and d3.js</title>
<script src="http://mbostock.github.com/d3/d3.v2.js"></script>
<style>
/* tell the SVG path to be a thin blue line without any area fill */
path {
stroke: steelblue;
stroke-width: 1;
fill: none;
@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