Skip to content

Instantly share code, notes, and snippets.

@ViktorOgnev
ViktorOgnev / install_docker_centos7.sh
Created August 13, 2018 10:30
install docker centos 7
sudo su
yum check-update || yum update
curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh
systemctl start docker
@ViktorOgnev
ViktorOgnev / test_webview.py
Created February 7, 2018 13:34
do webview stuff in separate process
import multiprocessing
import os
import threading
import time
import webview
def get_current_url():
@ViktorOgnev
ViktorOgnev / edit_mp3.py
Created October 20, 2017 13:41
Edit mp3 names via mutagen
import os
import re
from mutagen import easyid3
path = '/Users/name/Downloads/Book'
def compf(s: str) -> int:
num = next(re.finditer(r"\d+_\d+", s)).group()
track, disc = [int(i) for i in num.split('_')]
@ViktorOgnev
ViktorOgnev / imports_profilerv1.py
Last active October 20, 2017 13:46
import memory consumption profiling script
import argparse
import logging
import os
import re
import subprocess
import sys
from common.utils import imputil
from stdlib_list import stdlib_list
@ViktorOgnev
ViktorOgnev / calc_tax.py
Created March 29, 2016 11:14
calculate taxes
income = {
'1': 3.0,
'2': 3.0,
'3': 3.0,
'4': 3.0,
'5': 3.0,
'6': 3.0,
'7': 3.0,
'8': 3.0,
'9': 3.0,
import os
import pprint
import subprocess
# input
custom_reqs_current = ""
omnibus_reqs_old = ""
fatmouse_agent_reqs = []
@ViktorOgnev
ViktorOgnev / gcs_clenaup.py
Created November 15, 2015 21:32
python cleanup gcs repository
def cleanup_gcs():
branches = _get_git_branches()
project_bucket = '{}/{}'.format(env.ci.bucket, env.ci.project)
for obj in local(
'gsutil ls -R {}'.format(project_bucket), capture=True):
if any([branch in obj for branch in branches]):
continue
else:
local('gsutil -m rm -R {}'.format(obj))
@ViktorOgnev
ViktorOgnev / strider_migration_config.sh
Last active October 20, 2017 13:51
StriderCD configuration. Builds all packages for stable and win-only for latest
version=`python setup.py --version`
export EMBED_FAM_AGENT=yes
hosts="windows"
pkg_types="msi"
fab clone_fam
if [[ version -eq "3.10" ]]; then
fab -H root@centos-5,root@centos-5-32 -P build_rpm_deps --colorize-errors --ssh-config-path=/root/.ssh/config --user=root
hosts="$hosts,root@ubuntu-1004,root@ubuntu-1004-32,root@centos-5,root@centos-5-32"
@ViktorOgnev
ViktorOgnev / comparepipfreeze.py
Created October 30, 2015 08:08
Copmare output of 2 pip freeze commands
def compare_deps(freeze1, freeze2):
freeze1 = freeze1.splitlines()
freeze2 = freeze2.splitlines()
print('arg1 contains {} items, arg2 contains {} items'.format(len(freeze1), len(freeze2)))
for item1 in freeze1:
if '==' not in item1:
continue
name1, ver1 = item1.split('==')
for item2 in freeze2:
if '==' not in item2:
@ViktorOgnev
ViktorOgnev / cmderconfig.xml
Created October 19, 2015 08:59
my cmder cfg
<?xml version="1.0" encoding="UTF-8"?>
-<key name="Software">
-<key name="ConEmu">
-<key name=".Vanilla" build="140707" modified="2015-10-19 08:57:27">