Skip to content

Instantly share code, notes, and snippets.

@abakum
abakum / 03-fstab
Last active April 9, 2016 22:44
openWRT CC 15.05.1 with installed block-mount auto mount ntfs cifs nfs for Banana Pi
#!/bin/sh
#place it to /etc/hotplug.d/block/
#opkg update ; opkg install blkid block-mount
#block detect > /etc/config/fstab ; uci set fstab.@global[0].anon_mount=0 ; uci commit fstab
#. /lib/functions/blk.sh
logit(){
$@ | logger -t fstab
@abakum
abakum / install_peerflix
Created April 10, 2016 16:21
Use peerflix for kodi@OSMC on raspberry Pi
#!/bin/bash
mkdir -p ~/ins
cd ~/ins
wget http://node-arm.herokuapp.com/node_latest_armhf.deb
sudo dpkg -i node_latest_armhf.deb
sudo npm install -g peerflix
@echo off
setlocal enableDelayedExpansion
set debug=
set Yandex=y:
set Google=z:
rem Please do not use path with space
set unxU=%Yandex%\PortableApps\UnxUtils\usr\local\wbin
set x64=32
if EXIST "%windir%\SysWOW64" set x64=64
set msys=c:\msys%x64%\usr\bin
@abakum
abakum / mkvtoolnix.sh
Last active May 14, 2016 08:38
Build back-end (CLI) of mkvtoolnix from git on MSYS2
#!/usr/bin/bash
update-core
pacman -Suu
if [ "$MSYSTEM" == "MSYS" ] ; then
pacman -S git
pacman -S base-devel
pacman -S ruby
else
cd ~
@abakum
abakum / exiftool.bat
Created June 3, 2016 11:09
EXIFtool helper
@echo off
set codePage=1251
chcp %codePage%>nul
"%~dpn0.exe" -charset cp%codePage% %1
pause
@abakum
abakum / cut.py
Last active April 13, 2017 20:45
How to store, backup, cut (GOP-accurate with no quality loss) and tagging HD videos, convert it to MP3 (for music clips)
#!/usr/bin/python
# coding=cp1251
#
#pip install plumbum eyed3
from __future__ import unicode_literals
from __future__ import print_function
#from __future__ import division
import platform
win=platform.DEV_NULL=="nul"
import codecs
@abakum
abakum / st.bat
Last active August 22, 2016 18:45
bat wrapper around st
:dad's style :)
@echo off
set args=
:loop
set s=%~1
set s=%s:\=/%
if not "%s:~1,1%"==":" goto noDrv
set d=%s:~0,1%
set d=%d:A=a%
set d=%d:B=b%
@abakum
abakum / mingw.py.bat
Last active August 26, 2016 06:52
Helpers for start python
@echo off
set args=
:loop
if "%~1"=="" goto run
call :repl %1
set args=%args% "%s%"
shift
goto loop
:run
@abakum
abakum / Cyrillic.py
Created August 24, 2016 12:08
Bootstrap for ANSI python script
#!/usr/bin/python -i
# coding=cp1251
#
from __future__ import unicode_literals
from __future__ import print_function
import os
import codecs
import sys
reload(sys)
print("if sys.stdout.isatty():")
@abakum
abakum / sshd_config
Last active December 3, 2017 14:07
openSSH on Win with RSA authorization for sftp
Protocol 2
StrictModes no
PubkeyAuthentication yes
AuthorizedKeysFile c:\PortableApps\OpenSSH\authorized_keys
PasswordAuthentication no
PermitEmptyPasswords no
UsePAM yes
PidFile sshd.pid
Subsystem sftp sftp-server.exe