Skip to content

Instantly share code, notes, and snippets.

View svlasov's full-sized avatar

Sergey Vlasov svlasov

  • Israel
View GitHub Profile
@svlasov
svlasov / stopper.py
Created July 25, 2018 08:05
stopper context manager
import datetime
import logging
import logging.config
from common.util.app_context import ConfigManager
STOPPER_LOGGER_NAME = "stopper"
_sdcc_config = ConfigManager(portal={'debug': True},
log={'logdir': '/var/log/sdcc',
'verbosity': 'DEBUG'},
@svlasov
svlasov / gcrgc.sh
Created February 8, 2018 12:03 — forked from ahmetb/gcrgc.sh
Script to clean up Google Container Registry images pushed before a particular date
#!/bin/bash
# Copyright © 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@svlasov
svlasov / install-docker.sh
Last active October 18, 2017 11:16
Install Docker CE on Ubuntu
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
@svlasov
svlasov / initial-setup.sh
Last active October 20, 2017 14:42
Install essential software on Ubuntu
#!/bin/bash
sudo apt-get update && \
sudo apt-get install -y \
ack-grep \
apt-transport-https \
build-essential \
ca-certificates \
curl htop git \
lsb-core \
@svlasov
svlasov / gcp-mgr-start.sh
Last active June 28, 2017 15:07
setup ubuntu 16.04 box
#!/usr/bin/env bash
CMD_USER=user
CMD_KEY=/root/.ssh/id_rsa.pub
GCP_PROJECT="cyberdam-154510"
GCP_ZONE="us-central1-c"
VS_DB_NAME=sd_cm_dev
VS_DB_HOST=172.18.0.10
@svlasov
svlasov / sshtest-playbook.yml
Created December 6, 2016 06:02 — forked from makmanalp/sshtest-playbook.yml
SSH agent forwarding tester for ansible / vagrant
---
- hosts: all
sudo: no
tasks:
- shell: echo "Client= [$SSH_CLIENT] Sock= [$SSH_AUTH_SOCK]"
register: myecho
- debug: msg="{{myecho.stdout}}"
- shell: ssh-add -l
register: myecho
- debug: msg="{{myecho.stdout}}"
@svlasov
svlasov / Untitled.py
Last active November 21, 2016 21:08
Python Notebook imports
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from pandas import Series, DataFrame
#
# Install Nginx for Cent OS 32bit
# ex) FC2 VPS
#
#
# If show under error the message when execute ./configure
#
# > You can either disable the module by using --without-http_rewrite_module
# > option, or install the PCRE library into the system, or build the PCRE library
@svlasov
svlasov / Vagrantfile
Created July 9, 2015 12:34
SD Centos-6.5 Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
config.ssh.username = 'root'
config.ssh.password = '123456'
@svlasov
svlasov / install_git.sh
Created July 6, 2015 11:55
Install Latest Git Release on Ubuntu
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git