Skip to content

Instantly share code, notes, and snippets.

View shaposhnikoff's full-sized avatar
🏠
Working from home

Shaposhnikoff shaposhnikoff

🏠
Working from home
  • Kiev,Ukraine
View GitHub Profile
@shaposhnikoff
shaposhnikoff / gist:d05f9e7555cbf9d64cf7
Created August 24, 2015 14:05
create thumbs from mp4 files located in current dir
#!/bin/bash
for i in *.mp4; do
ffmpeg -i "${i}" -r 0.033 -vf scale=-1:240 -vcodec png capture-%002d.png
montage -title "Movie Name\nSubtitle" -geometry +4+4 capture*.png "$i".png
rm capture*.png
done
@shaposhnikoff
shaposhnikoff / local.conf
Last active September 1, 2015 19:59 — forked from etoews/local.conf
DevStack local.conf for OpenStack Icehouse
[[local|localrc]]
# Credentials
DATABASE_PASSWORD=devstack
ADMIN_PASSWORD=devstack
SERVICE_PASSWORD=devstack
SERVICE_TOKEN=devstack
RABBIT_PASSWORD=devstack
# Services
@shaposhnikoff
shaposhnikoff / gist:3caa00fc0bc11373f7a6
Last active September 22, 2015 10:20
Asterisk incoming call routing based on caller ID
exten => s,1,Answer
same=> n,NoOp("Caller ID IS: ${CALLERID(name)}")
same => n,MYSQL(Connect connid 127.0.0.1 root root asteriskdb)
same => n,MYSQL(Query resultid ${connid} SELECT name,ban FROM directory WHERE number='${CALLERID(name)}')
same => n,MYSQL(Fetch fetchid ${resultid} name ban)
same => n,NoOp("We found: ${name} ${ban}")
same => n,MYSQL(Clear ${resultid})
same => n,MYSQL(Disconnect ${connid});
same => n,Set(CALLERID(name)=${name})
same => n,NoOp()
mkdir bottle
cd bottle
pip install virtualenv==12.0.7
virtualenv venv
source venv/bin/activate
pip install bottle==0.12.8
pip freeze > requirements.txt
git init
git add .
git commit -m "initial commit"
@shaposhnikoff
shaposhnikoff / gist:017fe7aaac8ed9a8f19b
Created December 20, 2015 09:20
ffmpeg screenrecord
#!/bin/bash
DATE=`date +%Y-%m-%d_%Hh%Mm`
ffmpeg -f alsa -i pulse -f x11grab -acodec pcm_s16le -r 24 -s 1920*1080 -i :0.0+1366,0 -vcodec libx264 -preset ultrafast -threads 4 -y /home/max/video/out`date +%Y-%m-%d_%Hh%Mm`.mkv
@shaposhnikoff
shaposhnikoff / gtk-firefox.sh
Created February 7, 2016 20:26 — forked from joekiller/gtk-firefox.sh
INSTALL FIREFOX ON AMAZON LINUX X86_64 COMPILING GTK+
#!/bin/bash
# GTK+ and Firefox for Amazon Linux
# Written by Joseph Lawson 2012-06-03
# http://joekiller.com
# http://joekiller.com/2012/06/03/install-firefox-on-amazon-linux-x86_64-compiling-gtk/
# chmod 755 ./gtk-firefox.sh
# sudo ./gtk-firefox.sh
# Build environment. I use vagrant ubuntu/trusty64
sudo apt-get install build-essential git-core
sudo git clone https://github.com/raspberrypi/tools.git /opt/tools
export CCPREFIX="/opt/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-"
# Get ffmpeg and x264 repos
git clone git://source.ffmpeg.org/ffmpeg.git
cd ffmpeg
git clone git://git.videolan.org/x264
#######################################
Mangle, Queue Tree and prioritization
#######################################
As we know ‘simple queue’ marks packets from/to target ip and queues them using
global-in/global-out parents for packets at the local side of router. If we want
to queue services using ‘queue tree’ we can do it at the local or public side.
However if we want to use ‘simple queue’ and ‘queue tree’ for services we don’t
have that choice. Packets are marked at the local side and queued by ‘simple queue’
(we can’t see it in /ip firewall mange and /queue tree). The second marking and
@shaposhnikoff
shaposhnikoff / jdk_download.sh
Created May 15, 2016 17:45 — forked from P7h/jdk_download.sh
Script to download JDK / JRE / Java binaries from Oracle website from terminal / shell / command line / command prompt
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### #####
### Shell script to download Oracle JDK / JRE / Java binaries from Oracle website using terminal / command / shell prompt using wget.
### You can download all the binaries one-shot by just giving the BASE_URL.
### Script might be useful if you need Oracle JDK on Amazon EC2 env.
### Script is updated for every JDK release.
### Features:-
# 1. Resumes a broken / interrupted [previous] download, if any.
# 2. Renames the file to a proper name with including platform info.
sudo docker run --rm --publish 80:80 --publish 443:443 --name letsencrypt \
--volume "/tmp/letsencrypt/etc/:/etc/letsencrypt" \
--volume "/tmp/letsencrypt/var/:/var/lib/letsencrypt" \
quay.io/letsencrypt/letsencrypt:latest certonly --standalone \
-d domain.name -d www.domain.name --agree-tos --email [email protected]