Skip to content

Instantly share code, notes, and snippets.

@sblask
sblask / national_geographic_wallpaper_archive_download.sh
Created November 26, 2013 01:01
Download national geographic wallpaper archive
#!/bin/bash
root=http://ngm.nationalgeographic.com/wallpaper/img/
year_number=07
months_letters=(jan feb march april may june july aug sept oct nov dec)
for month in {1..12}
do
month_letters=${months_letters[month - 1]}
for index in {1..20}
http://redir.xing.com/link/*
https://slack-redir.net/link*
https://*.facebook.com/l.php*
https://deref-gmx.net/mail/client/*
https://outgoing.prod.mozaws.net/*
https://www.google.com/url*
# decrease speed
xinput set-prop "AlpsPS/2 ALPS DualPoint Stick" "Device Accel Profile" 6
xinput set-prop "AlpsPS/2 ALPS DualPoint Stick" "Device Accel Velocity Scaling" 1
xinput set-prop "AlpsPS/2 ALPS DualPoint Stick" "Device Accel Constant Deceleration" 7
xinput set-prop "AlpsPS/2 ALPS DualPoint Stick" "Device Accel Adaptive Deceleration" 60
# set mouse scroll speed
xinput set-prop "AlpsPS/2 ALPS DualPoint Stick" "Evdev Wheel Emulation Inertia" 100
@sblask
sblask / clone_init
Last active February 22, 2016 00:46
curl --silent https://api.github.com/users/sblask/repos | jq --raw-output ".[] | .ssh_url" | xargs -L 1 git clone
xbacklight -dec 1
xbacklight -inc 1
@sblask
sblask / .gtkrc-2.0
Created December 28, 2013 01:18
Remove pixel to the right of scroll bar to simplify scrolling using mouse pointer. (Xfce/Gtk)
style "scrollbar"
{
GtkScrollbar::trough-border = 0
}
class "Gtk*Scrollbar" style "scrollbar"
@sblask
sblask / national_geographic_wallpaper_download.sh
Last active December 29, 2015 09:39
Download all wallpapers from national geographic
#!/bin/bash
root=http://ngm.nationalgeographic.com
months=(january february march april may june july august september october november december)
download() {
year=$1
from=$2
to=$3
for month in $(seq $from $to)
@sblask
sblask / redshift.conf
Last active December 28, 2015 03:19
Redshift Settings
redshift -l 59.29:18.01 -t 5800:4500
@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 / 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