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
#!/usr/bin/env python
"""Basic Python Cheat Sheet by Filip Kral on 2015/02/16"""
"""
Python is a cross-platform, interpreted, object-oriented programming language.
That means you can run it on Linux, Windows, Mac, and other platforms,
you don't need to compile your code to execute it because it is compiled on
the fly, and you can use classes and objects.
@shaposhnikoff
shaposhnikoff / dockviz-containers-images.sh
Created February 17, 2017 09:50 — forked from rpherrera/dockviz-containers-images.sh
docker dockviz view containers images gnome
#!/bin/bash
# Install dockviz:
# https://github.com/justone/dockviz
# You can import it from .bashrc with the following commands (assuming you saved this script in '~/bin':
# echo ". ~/bin/dockviz-containers-images.sh" >>~/.bashrc
# source ~/.bashrc
function dockviz_containers() {
@shaposhnikoff
shaposhnikoff / bank.gov.ua_exchange_rate.py
Created February 20, 2017 01:17
Exchange rate as of the current date
#!/usr/bin/python
import requests
rates = requests.get("https://bank.gov.ua/NBUStatService/v1/statdirectory/exchange?json").json()
for i in range(len(rates)):
print ((rates[i]["rate"] ,rates[i]["txt"]))
@shaposhnikoff
shaposhnikoff / olx.py
Created February 23, 2017 11:30
books parser
from bs4 import BeautifulSoup
import re, requests,sys
import time
headers = {'Accept': '*/*',
'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'es-ES,es;q=0.8,en;q=0.6',
'Connection': 'keep-alive',
'Content-Type': 'text/html',
'Origin': 'http://olx.com.co',
@shaposhnikoff
shaposhnikoff / skydns-rc.yaml
Created March 18, 2017 15:02 — forked from ae6rt/skydns-rc.yaml
SkyDNS Kubernetes replication controller resource
---
apiVersion: v1
kind: ReplicationController
metadata:
labels:
k8s-app: kube-dns
kubernetes.io/cluster-service: "true"
version: v5
name: kube-dns-v5
namespace: kube-system
@shaposhnikoff
shaposhnikoff / delete-core.sh
Created March 18, 2017 18:42 — forked from leedavis81/delete-core.sh
Delete a solr core
#!/bin/bash
clear
echo "*************************************************************************"
echo "*************************************************************************"
echo
echo " You are about to *permanently* delete a core!"
echo " There is no going back"
echo
echo "*************************************************************************"
@shaposhnikoff
shaposhnikoff / mutt-gmail-yandex.md
Last active January 21, 2021 14:29 — forked from lazyfrost/mutt-gmail-yandex.md
Configuring mutt to work with gmail and yandex
@shaposhnikoff
shaposhnikoff / create.sh
Created March 30, 2017 17:02 — forked from slivero/create.sh
Creating Mysql SSL Certificates
openssl req -newkey rsa:2048 -days 1000 -nodes -keyout client-key.pem -out client-req.pem
openssl genrsa 2048 > ca-key.pem
openssl req -new -x509 -nodes -days 1000 -key ca-key.pem -out ca-cert.pem
openssl req -newkey rsa:2048 -days 1000 -nodes -keyout server-key.pem -out server-req.pem
openssl rsa -in server-key.pem -out server-key.pem
openssl x509 -req -in server-req.pem -days 1000 -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 -out server-cert.pem
CREATE USER 'ssluser'@'%' IDENTIFIED BY 'mypass';
GRANT ALL PRIVILEGES ON *.* TO 'ssluser'@'%' IDENTIFIED BY 'mypass' REQUIRE SSL;
sudo mysqld --ssl-ca=/etc/mysql/ca-cert.pem --ssl-cert=/etc/mysql/server-cert.pem --ssl-key=/etc/mysql/server-key.pem
# Setup SSL http://askubuntu.com/questions/194074/enabling-ssl-in-mysql
# Generate a CA key and certificate with SHA1 digest
openssl genrsa 2048 > ca-key.pem
openssl req -sha1 -new -x509 -nodes -days 3650 -key ca-key.pem > ca-cert.pem
@shaposhnikoff
shaposhnikoff / ffmpeg-minimalist-build-nvenc-static.md
Created April 5, 2017 21:12
Static FFmpeg build on Ubuntu 16.04 with Nvidia NVENC enabled.

Minimalist static FFmpeg build on Ubuntu 16.04 with Nvidia NVENC enabled.

Original guide with a standard build is here.

With this guide, I'm adding more instructions to enable support for NVIDIA CUVID and NVIDIA NPP for enhanced encode and decode performance.

First, prepare for the build and create the work space directory:

cd ~/