Skip to content

Instantly share code, notes, and snippets.

@jaka
jaka / install_sublime_text.sh
Created January 13, 2015 23:38
Simple script for installing sublime text editor on Debian (and probably on some another distro)
#!/bin/sh
URL="http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.2.tar.bz2"
URL64="http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.2%20x64.tar.bz2"
LOCALDIR=/usr/local
[ "`uname -m`" = "x86_64" ] && URL="$URL64"
[ "`id -u`" = "0" ] || (echo "You should run this script as root" && exit 1)
wget -nv $URL -O - | tar -C "$LOCALDIR" -xvjf -
127.0.0.1 fsr.lenovomm.com
127.0.0.1 lds.lenovomm.com
127.0.0.1 susapi.lenovomm.com
/var/log/dnsmasq/dnsmasq.log {
daily
rotate 30
compress
delaycompress
missingok
notifempty
postrotate
[ -r /var/run/dnsmasq/dnsmasq.pid ] && kill -USR2 `cat /var/run/dnsmasq/dnsmasq.pid`
endscript
#!/bin/sh
LOWER=15
BANTIME=5000
iw event | while read line; do
case "$line" in
*": new station "*)
iface="${line%%:*}"
mac=`echo "${line##* }" | tr [a-f] [A-F]`
apt-key adv --fetch-keys http://repos.codelite.org/CodeLite.asc
echo 'deb http://repos.codelite.org/debian/ jessie contrib' >/etc/apt/sources.list.d/codelite.list
apt-get update
apt-get install -y codelite
@jaka
jaka / bash
Created November 5, 2016 19:42
is_number() {
case "$1" in
""|*[!0-9]*) return 1 ;;
*) return 0 ;;
esac
}
#!/bin/sh
# kicad2dp: Renames the Gerber files generated by KiCad to meet
# the naming convention required by DirtyPCBs.com PCB service.
#
# Usage: kicad2dp project_name
# project_name is the substring common to the all generated Gerber files.
#
# Note: This script works only for two layer PCBs, but could be easily
# extended for 4-layer boards.
#!/usr/bin/env python
import serial
import random
from time import sleep
wait = 0.1
sp = serial.Serial(port='/dev/ttyACM0', baudrate=9600, timeout=2, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS)
def clean_buffer(sp):
from onvif import ONVIFCamera
mycam = ONVIFCamera('192.168.0.199', 80, 'admin', '12345', '/usr/local/wsdl')
media = mycam.create_media_service()
media.GetSnapshotUri()