Skip to content

Instantly share code, notes, and snippets.

sudo sh -c "ulimit -n 65535 && exec su $LOGNAME"
@sblask
sblask / firegesture-logically-open-link-or-duplicate-tab-next-to-current.js
Last active August 29, 2015 13:57
Firegesture script to logically open link or duplicate tab in background next to current tab, meaning it will be selected if current tab is closed or minimized. Requires tab deque extension.
@sblask
sblask / firegesture-open-link-or-duplicate-tab-in-background.js
Last active August 29, 2015 13:57
Firegesture script to open link or duplicate tab in background.
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "precise"
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "trusty"
@sblask
sblask / Image Forward Regexp
Created August 14, 2015 09:50
Enhanced value for the extensions.imageforward.linkURLRegExp setting of https://addons.mozilla.org/en-US/firefox/addon/image-forward/
(^[^#\?]+\.(jpg|jpeg|png)((#|\?).*)?$|^[^#\?]+(#|\?).+\.(jpg|jpeg|png)(&;#)?.*$)
@sblask
sblask / Mount NAS
Last active November 5, 2015 19:37
install nfs-common
sudo mkdir --parents /mnt/nfs/nas
sudo vim /etc/fstab
192.168.1.2:/data/Documents /mnt/nfs/nas/Documents nfs auto,bg,noatime,nolock 0 0
192.168.1.2:/data/Music /mnt/nfs/nas/Music nfs auto,bg,noatime,nolock 0 0
192.168.1.2:/data/Pictures /mnt/nfs/nas/Pictures nfs auto,bg,noatime,nolock 0 0
192.168.1.2:/data/Transmission /mnt/nfs/nas/Transmission nfs auto,bg,noatime,nolock 0 0
192.168.1.2:/data/Videos /mnt/nfs/nas/Videos nfs auto,bg,noatime,nolock 0 0
@sblask
sblask / national_geographic_photo_contest_2012_wallpaper_download.sh
Last active December 25, 2015 13:28
Download all available wallpapers from National Geographic's photo contest 2012
#!/bin/bash
root=http://ngm.nationalgeographic.com
path=ngm/photo-contest/2012/entries/wallpaper
type=(nature places people)
for kind in "${type[@]}"
do
for week in {1..13}
do
@sblask
sblask / spark_read_avro_example
Last active December 26, 2015 21:09
How to read Avro files using Spark.
import org.apache.avro.generic.GenericRecord
import org.apache.avro.mapred.AvroKey
import org.apache.avro.mapreduce.AvroKeyInputFormat
import org.apache.hadoop.io.NullWritable
import org.apache.spark.SparkContext
private def readAvro(sparkContext: SparkContext, path: String) = {
sparkContext.newAPIHadoopFile[
AvroKey[GenericRecord],
NullWritable,
@sblask
sblask / redshift.conf
Last active December 28, 2015 03:19
Redshift Settings
redshift -l 59.29:18.01 -t 5800:4500