Skip to content

Instantly share code, notes, and snippets.

View aborilov's full-sized avatar
🕶️
Working from home

Pavel aborilov

🕶️
Working from home
View GitHub Profile
@aborilov
aborilov / k8s_tools.sh
Created December 18, 2020 09:07
k8s tools
#!/bin/sh
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
mv kustomize /usr/local/bin/
wget https://github.com/derailed/k9s/releases/download/v0.24.2/k9s_Linux_x86_64.tar.gz
tar -xvzf k9s_Linux_x86_64.tar.gz
chmod +x k9s
mv k9s /usr/local/bin/
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.9.0/kind-linux-amd64
chmod +x ./kind
@aborilov
aborilov / keybase.md
Created September 22, 2019 13:50
keybase.md

Keybase proof

I hereby claim:

  • I am aborilov on github.
  • I am aborilov (https://keybase.io/aborilov) on keybase.
  • I have a public key ASDvE4yRz5LBpBfLHtLaR8s91NbwmpGTVxrzz7IfKIFSQQo

To claim this, I am signing this object:

@aborilov
aborilov / README.md
Created August 9, 2018 09:02
artispy doc

ARTISPY

build docker images:

you should be in base directory with senseware, artispy and volatility_profile apps in it.

  • build docker image for volatility_profile
http --verify no PATCH https://95.164.68.50/api/podapi/a448d88b-649f-420e-8fb0-e4e7da30fb3a X-Auth-Token:`http --verify no https://95.164.68.50/api/auth/token2 username=test password=admin | jq -r '.token'` < redeploy.json
{
"command": "edit",
"edited_config": {
"containers": [
{
"args": [
"nginx",
"-g",
"daemon off;"
@aborilov
aborilov / etcd
Last active September 12, 2016 05:37
curl --cacert /etc/kubernetes/certs/ca.crt --header "Authorization: Bearer J9bAdaBGyQUEESCz7k412afmpskoHig7" -sS --cert /etc/pki/etcd/etcd -dns2.crt --key /etc/pki/etcd/etcd-dns2.key https://95.164.68.160:6443/api/v1/proxy/namespaces/2701e09a-b9f7-4b77-b4ad-8438a974ddfe/services/https:service-f1g5a:2379/v2/keys
@aborilov
aborilov / gist:3da5a26f94cebd6cfc7142af064ad8af
Created May 18, 2016 11:39
Count total lines changed by author in git
git log --author="paborilov@cloudlinux.com" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -
#!/usr/bin/env python2
import os
import requests
from urlparse import urlparse
from bs4 import BeautifulSoup
urls = ['https://energyplus.net/weather-region/north_and_central_america_wmo_region_4/USA',
'https://energyplus.net/weather-region/north_and_central_america_wmo_region_4/CAN']
dirname = 'weatherdata'
@aborilov
aborilov / pods.py
Created February 18, 2016 07:00
get pod from kubernetes
# coding: utf-8
import requests
resp = requests.get('https://127.0.0.1/api/podapi', auth=('test', '1'), verify=False)
pods = resp.json()
namespace = pods['data'][0]['id']
resp = requests.get('http://localhost:8080/api/v1/namespaces/{}/pods'.format(namespace))
pod = resp.json()
print pod['items'][0]['spec']['containers']
@aborilov
aborilov / gist:fcd5811fe8b345b316c7
Created February 9, 2016 07:12
cmd to postgresql
PGPASSWORD=pass psql -t -h 127.0.0.1 -U kuberdock -d kuberdock -c "select config from pods where status != 'deleted'" | jq
@aborilov
aborilov / nmcli.py
Created August 25, 2015 12:50
switch NetworkManager profiles
#!/usr/bin/env python2
import os
CHAR = "V "
cmd = 'nmcli -f name,devices con status|tail -n+2'
active_devices = os.popen(cmd).read().split('\n')
name_dev = {}
for name_device in active_devices:
if name_device:
name, device = name_device.split()
name_dev[name] = device