Skip to content

Instantly share code, notes, and snippets.

View narkisr's full-sized avatar
⌨️
bashing keybindings

Ronen narkisr

⌨️
bashing keybindings
View GitHub Profile
@narkisr
narkisr / scanning.sh
Created April 21, 2013 13:41
Document scanning 101
# printer setup
sudo aptitude install hplip simple-scan
# Batch scan
sudo scanimage -b --batch-count=5 --batch-start=1 --source ADF --mode Gray
# converting to PDF
/usr/bin/gm convert *.pnm result.pdf
@narkisr
narkisr / jdk.pp
Last active October 13, 2015 23:58
Setting JDK on Ubuntu or Centos/Redhat systems
# Setting up sun-jdk
class backend::jdk {
if($operatingsystem =~ /Ubuntu|Debian/){
include apt
apt::ppa { 'ppa:webupd8team/java': }
package{'oracle-java6-installer':
ensure => present,
require => [Apt::Ppa['ppa:webupd8team/java'],Exec['skipping license approval']]
@narkisr
narkisr / install-mapnik-amazon-ami.sh
Created December 10, 2012 15:09 — forked from springmeyer/install-mapnik-amazon-ami.sh
Mapnik on Amazon Linux AMI (Fedora)
# http://aws.amazon.com/amazon-linux-ami/
# http://aws.amazon.com/amazon-linux-ami/faqs/
# login
ssh -i key.pem ec2-user@ec2...compute.amazonaws.com
# update
sudo yum -y update
sudo yum -y upgrade
@narkisr
narkisr / build_mysql51.sh
Created December 4, 2012 22:12 — forked from kamermans/build_mysql51.sh
Build MySQL 5.1 on Ubuntu 12.04 and later (5.1 is not available in Ubuntu repo)
#!/bin/bash
set -e
cd ~/
wget http://downloads.mysql.com/archives/mysql-5.1/mysql-5.1.65.tar.gz
tar -zxf mysql-5.1.65.tar.gz
cd mysql-5.1.65
./configure '--prefix=/usr' '--exec-prefix=/usr' '--libexecdir=/usr/sbin' '--datadir=/usr/share' '--localstatedir=/var/lib/mysql' '--includedir=/usr/include' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-system-type=debian-linux-gnu' '--enable-shared' '--enable-static' '--enable-thread-safe-client' '--enable-assembler' '--enable-local-infile' '--with-fast-mutexes' '--with-big-tables' '--with-unix-socket-path=/var/run/mysqld/mysqld.sock' '--with-mysqld-user=mysql' '--with-libwrap' '--without-readline' '--with-ssl' '--without-docs' '--with-extra-charsets=all' '--with-plugins=max' '--with-embedded-server' '--with-embedded-privilege-control'
make
@narkisr
narkisr / .Xdefaults
Created November 24, 2012 20:15 — forked from yevgenko/.Xdefaults
URxvt settings with solarized theme
!-------------------------------------------------------------------------------
! Xft settings
!-------------------------------------------------------------------------------
Xft.dpi: 96
Xft.antialias: false
Xft.rgba: rgb
Xft.hinting: true
Xft.hintstyle: hintslight
@narkisr
narkisr / Monaco_Linux-Powerline.ttf
Created November 24, 2012 18:49 — forked from epegzz/Monaco_Linux-Powerline.ttf
Monaco for vim-powerline
@narkisr
narkisr / dissoc-idx.clj
Created August 28, 2012 16:24
A index selection from a vector in Clojure
(defn index-exclude [r ex]
"Take all indices execpted ex"
(filter #(not (ex %)) (range r)))
(defn dissoc-idx [v & ds]
(map v (index-exclude (count v) (into #{} ds))))
(dissoc-idx [1 2 3] 1 2)
'(1)
@narkisr
narkisr / incanter-webui.clj
Created August 15, 2012 13:59
Using Noir and incanter
(ns simple_server
(:gen-class)
(:use [noir.server :only (start load-views)])
)
(load-views "src/simple_web_app")
(defn -main [& m]
(let [port (Integer. (get (System/getenv) "PORT" "8080"))]
(start port {:mode :dev :ns 'stats-web})))
@narkisr
narkisr / gemspec-fix.sh
Created August 10, 2012 23:49
Fixing invalid gemspec
# see http://biboyatienza.blogspot.co.il/2011/11/invalid-gemspec-in-varlibgems18specific.html
sudo sed -i 's/ 00:00:00.000000000Z//' /var/lib/gems/1.8/specifications/*
@narkisr
narkisr / phpvirtualbox upstart
Created July 31, 2012 23:35
Loading phpvirtualbox and vms on boot using upstart
#/etc/init.d/vboxdrv, add to the end of the start function
/sbin/initctl emit vboxdrv-started
# this triggers two upstart jobs
# /etc/init/phpvirtualbox.conf
description "php virtualbox server"