Skip to content

Instantly share code, notes, and snippets.

Avatar

Dobrica Pavlinušić dpavlin

View GitHub Profile
@dpavlin
dpavlin / git.sh
Created Apr 18, 2020
do same thing to multiple git repos
View git.sh
#!/bin/sh -e
ls -d */.git | cut -d/ -f1 | while read dir ; do
cd $dir
echo "# cd" `pwd`
git $*
cd ..
done
@dpavlin
dpavlin / saxonsoc-i2c-gpio.diff
Created Jan 2, 2020
SaxonSoc GPIO I2C work-in-progress
View saxonsoc-i2c-gpio.diff
# cd /klin/FPGA/saxonsoc/buildroot
diff --git a/board/spinal/saxon_ulx3s/linux.config b/board/spinal/saxon_ulx3s/linux.config
index 4608aeeb28..940cf271f7 100644
--- a/board/spinal/saxon_ulx3s/linux.config
+++ b/board/spinal/saxon_ulx3s/linux.config
@@ -88,3 +88,13 @@ CONFIG_MTD=y
CONFIG_MTD_SPI_NOR=y
CONFIG_MTD_M25P80=y
+# debug kernel
View xclip-htmlentities.sh
#!/bin/sh
xclip -out | sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g; s/"/\&quot;/g; s/'"'"'/\&#39;/g' | xclip -in -selection clipboard
View xclip-vi.sh
#!/bin/sh
# workflow:
# 1. focus textarea in browser you want to edit
# 2. press ctrl+a then ctrl+c
# 3. switch to terminal and start this script with optional extensioni for highlight: xclip-vi html
# 4. edit file in vi, and save it
# 5. switch back to browser, and press ctrl+v in already selected textarea
ext=$1
@dpavlin
dpavlin / ir-tv.pl
Created Nov 18, 2017
Control TV using command line tool on raspberry pi
View ir-tv.pl
#!/usr/bin/perl
use warnings;
use strict;
use Term::ReadKey;
use Data::Dump qw(dump);
my $direction = {
A => 'UP',
B => 'DOWN',
@dpavlin
dpavlin / scan-A4.sh
Created Oct 14, 2016
Scan pages using Sane's scanimage and convert them to pdf (with page and pdf preview using qiv and mupdf)
View scan-A4.sh
#!/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
@dpavlin
dpavlin / Makefile
Last active Nov 14, 2019 — forked from kost/esp8266-wifi-beacon-generator.ino
ESP8266 WiFi Beacon Generator - Generate SSID beacon frames on ESP8226
View Makefile
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
View openssl-speed-aes.txt
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 / sshfs.sh
Created Feb 1, 2016
create command to copy/paste into local termnial to cd into sshfs mounted directory
View sshfs.sh
#!/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 / cheali-scope.sh
Last active Feb 2, 2016
Convert cheali charger logview output into tab seperated values in clipboard for easy copy/paste into spreadsheet
View cheali-scope.sh
#!/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
You can’t perform that action at this time.