Skip to content

Instantly share code, notes, and snippets.

Avatar
⌨️
bashing keybindings

Ronen narkisr

⌨️
bashing keybindings
View GitHub Profile
@narkisr
narkisr / scanning.sh
Created Apr 21, 2013
Document scanning 101
View scanning.sh
# 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 Oct 13, 2015
Setting JDK on Ubuntu or Centos/Redhat systems
View jdk.pp
# 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']]
View install-mapnik-amazon-ami.sh
# 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 Dec 4, 2012 — forked from kamermans/build_mysql51.sh
Build MySQL 5.1 on Ubuntu 12.04 and later (5.1 is not available in Ubuntu repo)
View build_mysql51.sh
#!/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 Nov 24, 2012 — forked from yevgenko/.Xdefaults
URxvt settings with solarized theme
View .Xdefaults
!-------------------------------------------------------------------------------
! Xft settings
!-------------------------------------------------------------------------------
Xft.dpi: 96
Xft.antialias: false
Xft.rgba: rgb
Xft.hinting: true
Xft.hintstyle: hintslight
@narkisr
narkisr / dissoc-idx.clj
Created Aug 28, 2012
A index selection from a vector in Clojure
View dissoc-idx.clj
(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 Aug 15, 2012
Using Noir and incanter
View incanter-webui.clj
(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 Aug 10, 2012
Fixing invalid gemspec
View gemspec-fix.sh
# 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 Jul 31, 2012
Loading phpvirtualbox and vms on boot using upstart
View phpvirtualbox 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"