Skip to content

Instantly share code, notes, and snippets.

get-childitem "C:\windows\System32" -recurse | where {$_.extension -eq ".exe"} | % {
Write-Host $_.FullName
}
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
@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]
@ViktorOgnev
ViktorOgnev / choco_and_cmder
Created September 28, 2015 10:34
install chocolatey and cmder
#!powershell
powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))"
$env:PATH="$env:PATH;$env:ALLUSERSPROFILE\chocolatey\bin"
choco install cmder
@ViktorOgnev
ViktorOgnev / install pygit
Last active September 24, 2015 12:01
install pygit
apt-get install -y build-essential cmake python-dev libffi6 libffi-dev
wget https://github.com/libgit2/libgit2/archive/v0.23.0.tar.gz
tar xzf v0.23.0.tar.gz
cd libgit2-0.23.0/
cmake .
make
make install
ldconfig
pip install pygit2
@ViktorOgnev
ViktorOgnev / build ubuntu-32bit
Created July 3, 2015 14:07
build 32bit-ubuntu docker images, run this script on trusty or newer
#!/bin/bash -ex
### Build a docker image for ubuntu i386.
### settings
arch=i386
suite=${1:-trusty}
chroot_dir="/var/chroot/$suite"
mkdir -p $chroot_dir
mkdir -p $chroot_dir/etc
mkdir -p $chroot_dir/etc/apt
@ViktorOgnev
ViktorOgnev / dockercleanup
Last active September 23, 2015 16:07
remove stopped containers and untagged images
#!/bin/bash
# stop all
docker stop $(docker ps -a | awk '{print $1}')
# remove all containers
docker rm $(docker ps -a | awk '{print $1}')
# remove untagged images
docker rmi $(docker images -a | grep "^<none>" | awk '{print $3}')
@ViktorOgnev
ViktorOgnev / parsereg.py
Last active October 20, 2017 14:01
parse windows registry file
with open("/Users/viktorognev/work/Workspace/ci/chef/cookbooks/ci/files/default/pssconfig.reg") as fp:
res = ""
for line in fp.readlines():
if '=' in line:
print line
name, value = line.split('=', 1)
if ':' in value:
if 'C:\\' in value:
vtype, data = "expand_string", value
else:
@ViktorOgnev
ViktorOgnev / instal_docker_debian_wheezy
Created March 25, 2015 09:52
Install docker on debian
echo "deb http://http.debian.net/debian wheezy-backports main" >> /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -t wheezy-backports linux-image-amd64
curl -sSL https://get.docker.com/ | sh
Vagrant.configure("2") do |config|
config.vm.define 'ubuntu-14.04' do |c|
c.vm.hostname = "ubuntu-1404"
c.vm.box = "ubuntu-14.04"
c.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
c.vm.provision :shell, inline: "apt-get update"
end
end