Skip to content

Instantly share code, notes, and snippets.

@ViktorOgnev
ViktorOgnev / freesshd_config
Created September 29, 2015 08:23
Configure fresshd on windows host to work with pubkey auth
[Telnet server]
TelnetListenAddress=0.0.0.0
TelnetListenPort=23
TelnetMaxConnections=0
TelnetTimeout=0
TelnetBanner=
TelnetCMD=C:\Windows\system32\cmd.exe
TelnetRun=0
TelnetNewConsole=1
[SSH server]
docker run --privileged --rm \
-e OVERLAY_MOUNT="mount -t overlayfs overlayfs -o lowerdir=/overlay,upperdir=/var/cache/omnibus /var/cache/omnibus" \
-e OMNIBUS_PROJECT=scalarizr -e OMNIBUS_VERSION=3.9.b98.658f21b -e OMNIBUS_INSTALL_DIR=/opt/scalarizr -e OMNIBUS_LOG_LEVEL=debug \
-v /omnibus/cache/persistent/scalarizr/feature-SA-96-strider-to-drone/ubuntu-1204:/overlay \
-v /omnibus/data/scalarizr/feature-SA-96-strider-to-drone/658f21b3ad8bcf7d97205af242de07e3dfc4eab5:/project \
overlay_test
get-childitem "C:\windows\System32" -recurse | where {$_.extension -eq ".exe"} | % {
Write-Host $_.FullName
}
@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">
@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 / 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 / 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))
import os
import pprint
import subprocess
# input
custom_reqs_current = ""
omnibus_reqs_old = ""
fatmouse_agent_reqs = []
@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,
@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