Skip to content

Instantly share code, notes, and snippets.

View vr000m's full-sized avatar
💥

Varun Singh vr000m

💥
View GitHub Profile
@vr000m
vr000m / gist:1a2bc658ff1ec5dafcdc
Created March 23, 2015 18:20
enable ECN on mac
sudo sysctl -w net.inet.tcp.ecn_initiate_out=1

Keybase proof

I hereby claim:

  • I am vr000m on github.
  • I am vr000m (https://keybase.io/vr000m) on keybase.
  • I have a public key whose fingerprint is 9039 C653 C363 44B7 04B2 E36A 0743 EA63 3B1C B2CB

To claim this, I am signing this object:

@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

@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 / 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 / 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 / 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 / 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
/*
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 / 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.