Skip to content

Instantly share code, notes, and snippets.

View Voronenko's full-sized avatar
turning coffee into code since late 90s

Vyacheslav Voronenko

turning coffee into code since late 90s
View GitHub Profile
@Voronenko
Voronenko / download.sh
Created January 15, 2017 17:29
m3u stream downloader
#/bin/bash
# $1 like https://xxx/vods3/_definst_/smil:box/cdnstore/modules/xxx.smil/chunklist_b400000.m3u8
CURRENT_COURSE_DIR=xxx
current=${CURRENT_COURSE_DIR-current}
mkdir -p $current/0
@Voronenko
Voronenko / link_node_globally.sh
Last active January 20, 2017 14:54
Link node globally

Keybase proof

I hereby claim:

  • I am voronenko on github.
  • I am voronenko (https://keybase.io/voronenko) on keybase.
  • I have a public key whose fingerprint is 7987 884A 8EC6 0346 95C5 0969 2B36 E227 66B1 8148

To claim this, I am signing this object:

@Voronenko
Voronenko / nvm_build.sh
Created May 9, 2017 13:40
nvm yarn build bootstrap
#!/bin/bash
exists()
{
command -v "$1" >/dev/null 2>&1
}
. ~/.nvm/nvm.sh
node_version="$(nvm version)"
@Voronenko
Voronenko / megaraid.txt
Created May 10, 2017 21:21
Prepare dell raid for smartctl inspection
Detect Raid info:
`lspci`
```03:00.0 RAID bus controller: LSI Logic / Symbios Logic MegaRAID SAS-3 3108 [Invader] (rev 02)```
RAID bus controller: LSI Logic / Symbios Logic MegaRAID SAS 2208 [Thunderbolt] (rev 05)
Note: on some servers - starts from 0, on some from 1
@Voronenko
Voronenko / etc_hosts_inventory.py
Created May 18, 2017 07:34
ansible /etc/hosts inventory
#!/usr/bin/env python
import json
hosts = open('/etc/hosts','r')
result={}
allservers=[]
for line in hosts:
if line[0].isdigit():
host = line.split()
result[host[1]]= {}
result[host[1]]["hosts"] = [host[0]]
@Voronenko
Voronenko / debian
Last active May 25, 2017 07:45
Python2 ansible workarounds
tasks:
- name: install python and deps for ansible modules
raw: test -e /usr/bin/python || (apt -qqy update && apt install -qy python-minimal)
- name: gather facts
setup:
if [ ! -e "/usr/bin/python" ]
then
apt -qqy update && apt install -qy python-minimal
fi
@Voronenko
Voronenko / centos_unbrick
Created June 2, 2017 14:44
Unbricking centos minimal
# /etc/config/network
# add line NETWORKING=yes
#
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
# ensure
# BOOT_PROTO=dhcp
# ONBOOT=yes
# optionals:
@Voronenko
Voronenko / single_object_inspect.py
Last active September 25, 2017 09:53
XLDeploy inspect globals with jython
# #######################
import inspect
def dig(obj):
if not inspect.ismodule(obj) and not inspect.isclass(obj) and not inspect.isroutine(obj):
if isinstance(obj, str) or isinstance(obj, unicode):
print "STRING OBJECT, VALUE : " + str(obj)
else:
print "COMPLEX OBJECT, TYPE : " + str(type(obj))
if dir(obj).__contains__("_delegate"):
[main]
# main domain
domain=lcl.io
# default ttl
ttl=432000
# default IP address for non-wildcard entries
ipaddress=127.0.0.1