Skip to content

Instantly share code, notes, and snippets.

View shaposhnikoff's full-sized avatar
🏠
Working from home

Shaposhnikoff shaposhnikoff

🏠
Working from home
  • Kiev,Ukraine
View GitHub Profile
docker run -i -t gitlab/gitlab-ce:8.9.6-ce.0 /bin/bash
curl -sSL https://get.docker.com/ | sh
curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.deb.sh | sudo bash
@shaposhnikoff
shaposhnikoff / rPi3-ap-setup.sh
Created November 9, 2016 11:11 — forked from Lewiscowles1986/rPi3-ap-setup.sh
Raspberry Pi 3 access-point-setup
#!/bin/bash
#
# This version uses September 2016 rpi jessie image, please use this image
#
if [ "$EUID" -ne 0 ]
then echo "Must be root"
exit
fi
#!/bin/bash
if [ -e /sys/class/power_supply/BAT0 ]; then
zenity --warning --text "STARTED MONITORING BATERY"
while true;do
CAPACITY=$( cat /sys/class/power_supply/BAT0/uevent | grep -i capacity | cut -d'=' -f2|head -1 )
case $CAPACITY in
[0-9]|11)
STATUS=$( cat /sys/class/power_supply/BAT0/uevent | grep -i status | cut -d'=' -f2 | head -1)
@shaposhnikoff
shaposhnikoff / Jenkinsfile.groovy
Created January 25, 2017 18:49 — forked from intel352/Jenkinsfile.groovy
Demandware Jenkinsfile build
node {
stage 'Checkout'
checkout scm
env.BUILD_TAG_CLEANED = "${env.BUILD_TAG}".replaceAll(/\%\d[a-zA-Z]/, "-").replaceAll(/[^\w-]+/, "")
env.ENABLE_TWO_FACTOR = 'false'
env.ENVIRONMENT_INSTANCE = 'dev03' // test build sandbox for branches != develop
if (env.BRANCH_NAME == 'develop') {
#!/bin/bash
CF=~/.git-dprz.sh
function info {
cat <<- INFO
-- Script for downloading PRIVATE(!) git-repos as tar-archive on old systems (like Debian Etch)
-- That only have old git - binaries
--
import os,sys,time,math
def radius_dl(radius):
return (int(math.pi * 2 *int(radius)))
def polovina_kruga(radius):
return (int(math.pi * (int(radius) ** 2))/2)
def banner():
print("*"*50)
# Функция расчета площади эллипса, то-есть лицевого фасада
@shaposhnikoff
shaposhnikoff / gist:568669f6d1f9bfe23c51036c3738fc5a
Created February 8, 2017 16:49 — forked from thomaslee/gist:1631057
Building Debian Packages
Notes from here: http://www.webupd8.org/2010/01/how-to-create-deb-package-ubuntu-debian.html
This assumes you're using autotools to build your project.
1. sudo apt-get install build-essential autoconf automake autotools-dev dh-make debhelper devscripts fakeroot xutils lintian pbuilder
2. We want a source folder with the pattern: <package>-<version>
$ cd ginvoke
$ git archive --format=tar --prefix=ginvoke-$(date +'%Y%m%d')/ master | tar xvf - -C ..
ansible-playbook -vv -i inventory/kubernetis.ini provision.yml --extra-vars="hostName=all" \
-e is_sys_prepare=true \
-e is_install_deps=true \
-e is_install_master=true \
-e is_install_minion=true \
-e is_create_config=true \
-e is_last_step=true
@shaposhnikoff
shaposhnikoff / img2base64.py
Created February 13, 2017 23:14 — forked from alexmill/img2base64.py
Create a base64 thumbnail from image URL (Python)
import numpy as np
import base64
import urllib
from PIL import Image
#Convert image to base64 thumbnail
def img2base64(img_link):
with open("/tmp/img_file.jpg", "wb") as f:
f.write(urllib.request.urlopen(img_link).read())
tmp_img = np.asarray(Image.open("/tmp/img_file.jpg"))
@shaposhnikoff
shaposhnikoff / sync.py
Created February 14, 2017 13:20 — forked from kennethreitz/sync.py
GitHub Syncer. Clones or Pulls all GitHub repos (including watched list).
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Kenneth Reitz's GitHub Syncer
This script uses the GitHub API to get a list of all forked, mirrored, public, and
private repos in your GitHub account. If the repo already exists locally, it will
update it via git-pull. Otherwise, it will properly clone the repo.
It will organize your repos into the following directory structure: