Skip to content

Instantly share code, notes, and snippets.

View dpavlin's full-sized avatar

Dobrica Pavlinušić dpavlin

View GitHub Profile
@dpavlin
dpavlin / .xbindkeysrc
Created December 14, 2013 22:04
Example configuration for xbindkeys XF86* events
#b-
"xbacklight -inc 5"
m:0x0 + c:233
XF86MonBrightnessUp
#b+
"xbacklight -dec 5"
m:0x0 + c:232
XF86MonBrightnessDown
@dpavlin
dpavlin / DSLogic.Debian-sid-compile-fix.diff
Created January 10, 2014 18:10
quick fix to compile DSLogic-gui on Debian sid
commit 6e45af595937ed9a91d97f2490278844516bde3d
Author: Dobrica Pavlinusic <dpavlin@rot13.org>
Date: Fri Jan 10 19:07:11 2014 +0100
git compile on Debian sid fix
diff --git a/DSLogic-gui/CMakeLists.txt b/DSLogic-gui/CMakeLists.txt
index 5a4fb8f..748f2f0 100644
--- a/DSLogic-gui/CMakeLists.txt
+++ b/DSLogic-gui/CMakeLists.txt
@dpavlin
dpavlin / keybase.md
Created September 22, 2014 22:00
keybase.md

Keybase proof

I hereby claim:

  • I am dpavlin on github.
  • I am dpavlin (https://keybase.io/dpavlin) on keybase.
  • I have a public key whose fingerprint is 7CC8 934E 8AEA AAF0 231D 90B9 C97F AD45 059A 34B6

To claim this, I am signing this object:

#!/usr/bin/perl
# http://www.regos.hr/UserDocsImages/KONTROLA%20OIB-a.pdf
my $oib = 69435151530;
my ($nr,$ck) = ( substr($oib,0,10), substr($oib,-1,1) );
print "$oib -> $nr $ck\n";
@dpavlin
dpavlin / mount-rpi-image.sh
Last active December 20, 2023 18:21
mount Raspberry Pi image, copy qemu-arm-static and chroot into it to tweak it
#!/bin/sh -xe
# mount Raspberry Pi image, copy qemu-arm-static and chroot into it to tweak it
dir=/tmp/rpi
test "umount" = "$1" && sudo umount $dir/boot && sudo umount $dir
image=$1
test -r "$image" || ( echo "Usage: $0 /path/to/rpi.img" && exit 1 )
@dpavlin
dpavlin / cheali-scope.sh
Last active February 2, 2016 21:29
Convert cheali charger logview output into tab seperated values in clipboard for easy copy/paste into spreadsheet
#!/bin/sh -xe
# .i3/config
# for_window[title="^Gnuplot"] floating enable
# http://users.softlab.ntua.gr/~ttsiod/gnuplotStreaming.html
test -x driveGnuPlots.pl || wget http://users.softlab.ntua.gr/~ttsiod/driveGnuPlots.pl && chmod 755 driveGnuPlots.pl
width=600
file=$1
@dpavlin
dpavlin / sshfs.sh
Created February 1, 2016 16:45
create command to copy/paste into local termnial to cd into sshfs mounted directory
#!/bin/sh -xe
# create command to copy/paste into local termnial to cd into sshfs mounted directory
echo "test -d /mnt/`hostname -s` || mkdir /mnt/`hostname -s` && df -t fuse.sshfs /mnt/`hostname -s` || sshfs `hostname -f`:/ /mnt/`hostname -s`/ && cd /mnt/`hostname -s`/`pwd`/"
@dpavlin
dpavlin / openssl-speed-aes.txt
Created April 6, 2016 21:49
openssl speed aes
root@pine64:~# uname -a
Linux pine64 3.10.65-4-pine64-longsleep #16 SMP PREEMPT Sun Apr 3 10:56:40 CEST 2016 aarch64 GNU/Linux
root@pine64:~# openssl speed aes
Doing aes-128 cbc for 3s on 16 size blocks: 4984555 aes-128 cbc's in 2.95s
Doing aes-128 cbc for 3s on 64 size blocks: 2269135 aes-128 cbc's in 2.91s
Doing aes-128 cbc for 3s on 256 size blocks: 590071 aes-128 cbc's in 2.96s
Doing aes-128 cbc for 3s on 1024 size blocks: 148964 aes-128 cbc's in 2.95s
Doing aes-128 cbc for 3s on 8192 size blocks: 18671 aes-128 cbc's in 2.95s
Doing aes-192 cbc for 3s on 16 size blocks: 7192646 aes-192 cbc's in 2.95s
Doing aes-192 cbc for 3s on 64 size blocks: 1981523 aes-192 cbc's in 2.95s
@dpavlin
dpavlin / Makefile
Last active April 17, 2021 14:38 — forked from kost/esp8266-wifi-beacon-generator.ino
ESP8266 WiFi Beacon Generator - Generate SSID beacon frames on ESP8226
builder:
/opt/arduino-1.6.8/arduino-builder -dump-prefs -logger=machine -hardware "/opt/arduino-1.6.8/hardware" -hardware "/home/dpavlin/.arduino15/packages" -hardware "/home/dpavlin/Arduino/hardware" -tools "/opt/arduino-1.6.8/tools-builder" -tools "/opt/arduino-1.6.8/hardware/tools/avr" -tools "/home/dpavlin/.arduino15/packages" -built-in-libraries "/opt/arduino-1.6.8/libraries" -libraries "/home/dpavlin/Arduino/libraries" -fqbn=esp8266:esp8266:generic:CpuFrequency=80,FlashFreq=40,FlashMode=dio,UploadSpeed=115200,FlashSize=512K64,ResetMethod=nodemcu,Debug=Disabled,DebugLevel=None____ -ide-version=10608 -build-path "/tmp/build74183724a5572046762b09cc6849235c.tmp" -warnings=none -prefs=build.warn_data_percentage=75 -verbose "/home/dpavlin/Arduino/esp8266_spam/esp8266_spam.ino"
/opt/arduino-1.6.8/arduino-builder -compile -logger=machine -hardware "/opt/arduino-1.6.8/hardware" -hardware "/home/dpavlin/.arduino15/packages" -hardware "/home/dpavlin/Arduino/hardware" -tools "/opt/arduino-1.6.8/tools-builder" -to
@dpavlin
dpavlin / scan-A4.sh
Created October 14, 2016 11:33
Scan pages using Sane's scanimage and convert them to pdf (with page and pdf preview using qiv and mupdf)
#!/bin/sh -e
nr=1
mkdir $1
while true ; do
file=$1/`printf "%04d" $nr`.jpg
echo "scanning page $nr -> $file"
scanimage --progress --resolution 300 --format jpg -l 0mm -t 0mm -x 210mm -y 297mm > $file