Skip to content

Instantly share code, notes, and snippets.

View svlasov's full-sized avatar

Sergey Vlasov svlasov

  • Israel
View GitHub Profile
@svlasov
svlasov / decorator.py
Created May 18, 2014 11:44
Parameterized decorator
def decoratorFunctionWithArguments(arg1, arg2, arg3):
def wrap(f):
print "Inside wrap()"
def wrapped_f(*args):
print "Inside wrapped_f()"
print "Decorator arguments:", arg1, arg2, arg3
f(*args)
print "After f(*args)"
return wrapped_f
return wrap
  1. General Background and Overview
@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
@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'
#
# 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 / 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
@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 / 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 / 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 / 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"