Skip to content

Instantly share code, notes, and snippets.

View ravnoor's full-sized avatar

Ravnoor Singh Gill ravnoor

View GitHub Profile
@ravnoor
ravnoor / spreadWallpaper
Created November 20, 2015 18:10
Spread wide wallpapers across 2 screens
gconftool-2 --set "/desktop/gnome/background/picture_options" --type string "spanned"
% http://www.dualmonitorbackgrounds.com/nature/
@ravnoor
ravnoor / csvjoin.sh
Created December 16, 2015 20:57
Column-wise concatenation of text files
#!/bin/bash
paste -d, *.csv > output.csv
@ravnoor
ravnoor / osx-for-hackers.sh
Created December 17, 2015 19:54 — forked from matthewmueller/osx-for-hackers.sh
OSX for Hackers (Mavericks/Yosemite)
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
@ravnoor
ravnoor / osx-for-hackers.sh
Last active December 20, 2015 22:58 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: El Capitan Edition [Hopefully]. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned. Also, please don't email me about this script, my poor inbox...
#!/bin/bash
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# and here
# https://gist.github.com/brandonb927/3195465
# Set the colours you can use
black='\033[0;30m'
#!/bin/tcsh
#flip monitor left to right in dual-monitor configuration
xrandr --output VGA-0 --right-of DVI-I-1
@ravnoor
ravnoor / openvpn-connect.sh
Created January 29, 2016 03:48
Switch VPN servers on openWRT
#!/bin/sh
display_usage() {
echo "Usage:"
echo " ovpn.sh <server-prefix>"
echo " ovpn.sh ca"
echo " server examples: ca, us, ca1, ca2 ..."
}
if [ $# -le 0 ]; then
@ravnoor
ravnoor / prepare_images
Created January 31, 2016 23:31 — forked from xpac27/prepare_images
Prepare images for Francoiscogne.com's backoffice
#!/bin/bash
# Requires: brew install imagemagick --with-little-cms --with-little-cms2
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo ""
echo ""
echo ""
echo ""
echo "All the images in the following folder will be changes: "
@ravnoor
ravnoor / eps2tiff.sh
Last active January 31, 2016 23:39
Convert EPS to TIFF with LZW compression
#!/bin/bash
# Convert EPS to TIFF using GraphicsMagick
DIR="$( pwd )"
`unalias gm` # gm is aliased to gitmerge in OSX 10.11.3 with Homebrew
find "$DIR" -iname "*.eps" | sed 's/^.\///g' | while read EPS
do
echo "converting to TIFF ($i)"
TIFF=`echo "$EPS" | sed "s/.eps$/.tiff/"`

Keybase proof

I hereby claim:

  • I am ravnoor on github.
  • I am ravnoor (https://keybase.io/ravnoor) on keybase.
  • I have a public key ASDfW4iPgbNsyHxffEVzAoml6Nn1kNtYjukuXw3hQL7QUgo

To claim this, I am signing this object:

@ravnoor
ravnoor / pubmed_ask.r
Created August 11, 2016 23:15 — forked from briatte/pubmed_ask.r
pubmed scraper
#' Get a PubMed search index
#' @param query a PubMed search string
#' @return the XML declaration of the search
#' @example
#' # Which articles discuss the WHO FCTC?
#' pubmed_ask("FCTC OR 'Framework Convention on Tobacco Control'")
pubmed_ask <- function(query) {
# change spaces to + and single-quotes to URL-friendly %22 in query
query = gsub("'", "%22", gsub(" ", "+", query))