Skip to content

Instantly share code, notes, and snippets.

@rejuvyesh
rejuvyesh / cabal2pkgbuild
Created April 17, 2014 10:44
automate habs a little
#!/usr/bin/env zsh
# Created by rejuvyesh <[email protected]>
usage="Usage: ./cabal2pkgbuild <HACKAGE_PACKAGES_FILE>"
if [[ -z $1 ]]; then
echo $usage
exit 1
fi
@rejuvyesh
rejuvyesh / getmu
Last active August 29, 2015 14:00
netcat-cpi-kernel-module to ogg
#!/usr/bin/python
# Convert `netcat-cpi-kernel-module` to actual oggs
import binascii
import re
import sys
try:
s = re.sub('0x', '', re.sub('[,\n]', '', open(sys.argv[1], 'r').read()))
@rejuvyesh
rejuvyesh / config
Created April 26, 2014 13:02
ssh config
# For turing and other cse servers
Host vyom
HostName vyom.cc.iitk.ac.in
User jayeshkg
IdentityFile ~/.ssh/cse
Host turing
HostName turing.cse.iitk.ac.in
User jayeshkg
IdentityFile ~/.ssh/cse
@rejuvyesh
rejuvyesh / userChrome.css
Created April 26, 2014 16:28
ff user chrome
.tabbrowser-tab {
-moz-appearance: none !important;
border-radius: 2px !important;
font-family: Open Sans !important;
font-size: 11px !important;
color: #808080 !important;
background: #dbdbdb !important;
max-height: 20px !important;
min-height: 20px !important;
border: none !important;
# convert multipage pdf to single page tiff
gs -q -dNOPAUSE -dBATCH -sDEVICE=tiffg4 -sOutputFile=%04d.tif source.pdf -c qui
# or use -sDEVICE=pgmraw to convert to pgm
# unpaper, rotate the logical page 90 degrees, each logical page contained two scanned physical pages, so we use --layout double (for input) and --output-pages 2 since we want to split these two pages.
unpaper -v --deskew-scan-deviation 3.0 --border-align top --deskew-scan-range 15 --no-grayfilter --no-blurfilter --no-noisefilter --overwrite --pre-rotate 90 --border-scan-step 4 --layout double --output-pages 2 %04d.pgm.pbm unpaper%04d.pbm
# trim the pages and convert the to single-page pdfs
find . -name 'unpaper*' | xargs -i -n1 -P6 convert -trim +repage {} {}.pdf
@rejuvyesh
rejuvyesh / config.nix
Created September 25, 2014 14:35
nix packages
{ pkgs }: {
packageOverrides = self: with pkgs; rec {
# standard environment
rejuvnix = pkgs.buildEnv {
name = "rejuvnix";
paths = let
hs = haskellPackages;
in [
@rejuvyesh
rejuvyesh / github-title.user.js
Last active August 29, 2015 14:10
append 'github' to all github pages
// ==UserScript==
// @name Github in Page Title
// @description Put the string 'Github' in each github page
// @include https://github.com/*
// @version 0.1
// @grant none
// ==/UserScript==
(function() {
if (!document.title.contains('GitHub')) {
document.title = document.title + ' - ' + ' GitHub';

Keybase proof

I hereby claim:

  • I am rejuvyesh on github.
  • I am rejuvyesh (https://keybase.io/rejuvyesh) on keybase.
  • I have a public key whose fingerprint is B974 B2C6 B0C8 289D 14C8 F460 F33B FCBE CEEA CD5D

To claim this, I am signing this object:

#!/bin/zsh
#
# File: start.sh
#
# Created: Saturday, January 10 2015 by rejuvyesh <[email protected]>
# License: GNU GPL 3 <http://www.gnu.org/copyleft/gpl.html>
#
PATH=/usr/bin:/home/rejuvyesh/.nix-profile/bin
MATHJAX=/home/rejuvyesh/src/www/mathjax/MathJax/
@rejuvyesh
rejuvyesh / custom.css
Created January 12, 2015 05:23
gitit custom css (inspired by bootstrap)
@import url("screen.css"); /* default gitit screen styles */
@import url("hk-pyg.css"); /* for syntax highlighting */
/* My custom Gitit CSS styling, in part based on Twitter Bootstrap */
body {
margin: 0;
font-family: "Noto Sans", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 20px;