Skip to content

Instantly share code, notes, and snippets.

@i026e
i026e / doc_cleaner.py
Created December 30, 2020 15:54
Remove images and disable links in MS Word files using LibreOffice
#!/usr/bin/env python3
# Remove links and images from Word files
# Requirements:
# pip install unotools Wand
import io
import atexit
import time
import logging
#!/usr/bin/env bash
# install xclip xdotool xkb-switch
function fix_layout {
# сохраняем выделение в файл
xclip -o -selection primary > /tmp/~sel.tmp
# сохраняем буфер обмена в файл
xclip -o -selection clipboard > /tmp/~clip.tmp
@i026e
i026e / build_resocks.sh
Created October 24, 2020 13:36
Build redsocks2
#!/usr/bin/bash
set -xe
REDSOCKS_DIR="./redsocks"
PACKAGE_DIR="./debian_package"
VERSION=$(date "+%Y.%m")
# Dependencies
sudo apt install -y git libevent-dev libssl-dev
@i026e
i026e / plot_term_tree.py
Created January 24, 2019 12:35
Plot MPTT tree
import argparse
import psycopg2
import psycopg2.extras
try:
import igraph
except ImportError:
print("""
Please install igraph library
@i026e
i026e / dropbox-docker
Last active March 2, 2017 13:04
Runnig dropbox inside docker container
#!/usr/bin/env bash
##https://hub.docker.com/r/janeczku/dropbox/
#Modify this
DROPBOX_FOLDER="${HOME}/Dropbox"
MEMORY_LIMIT="300m"
CONTAINER="dropbox"
@i026e
i026e / python_player.py
Created January 15, 2017 13:29
Linux python3 script to play audio files (e.g. .mp3, .ogg, .wav) using GStreamer
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 14 17:38:42 2015
@author: pavel
"""
import os
@i026e
i026e / git_clear_history
Created January 12, 2017 08:36
clear history
#! /usr/bin/env sh
#http://stackoverflow.com/questions/13716658/how-to-delete-all-commit-history-in-github
#Checkout
git checkout --orphan latest_branch
#Add all the files
git add -A
@i026e
i026e / swf2browser.py
Created January 8, 2017 16:55
(Linux) Wrap .swf file with a html and open in web-browser
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 8 18:58:23 2017
@author: pavel
"""
import os
import sys
import subprocess
@i026e
i026e / create_env
Last active January 11, 2017 05:35
Bash script to create python3 virtual environment
#! /usr/bin/env sh
name="$1"
mkdir -p "./$1"
mkdir -p "./$1/src"
cd "./$1"
#pyvenv --system-site-packages --symlinks "$@"
@i026e
i026e / udev-notify-py3
Created December 19, 2016 12:16
PKGBUILD for udev-notify-py3
# Maintainer: Pavel Klevakin [email protected]
pkgname=udev-notify-py3
pkgver=0.4
pkgrel=1
epoch=
pkgdesc=""
arch=("i686" "x86_64")
url="http://bazaar.launchpad.net/~skss/udev-notify/udev-notify/"
license=("unknown")