Skip to content

Instantly share code, notes, and snippets.

Avatar

Roman Sokolkov r7vme

View GitHub Profile
@r7vme
r7vme / monitor.sh
Created Feb 2, 2017
Script to switch between high and low dpi displays
View monitor.sh
#!/bin/bash
LAPTOP_DISP="eDP-1"
LAPTOP_DISP_DPI=120
# Get first active display
EXTERN_DISP=$(xrandr -q | grep ' connected' | cut -f1 -d' ' | grep -v $LAPTOP_DISP | tail -1)
EXTERN_DISP_DPI=96
if [ $EXTERN_DISP ]; then
@r7vme
r7vme / collect_info_script.sh
Last active Feb 10, 2017
Script to collect configuration from OpenStack nodes (Only for Fuel 9.X+)
View collect_info_script.sh
#!/bin/bash
# This script used to gather info about cloud. You should provide gathered info to support team.
INFO_PATH=nodes_info
CLEAN_DIR=true
NODES_ADDRESSES=$(fuel node|awk -F'|' '$2~/ready/ && $9~/1/ {gsub(/[ \\t]+/, "", $5); print $5;}')
if [ -d "${INFO_PATH}" ]; then
echo "Deleting old info from ${INFO_PATH} directory..."
rm -rf ${INFO_PATH}
fi
View salt-master-xenial-git.sh
#!/bin/bash
NODE_NAME=$(hostname -f)
FORMULA_PATH=/usr/share/salt-formulas
FORMULA_BRANCH=master
# Sanity checks
test -d /srv/salt/reclass || (echo "Please put relass model in /srv/salt/reclass"; exit 1)
# Redirect all outputs
View salt-minion-xenial.sh
#!/bin/bash
NODE_NAME=$(hostname -f)
CONFIG_HOST=10.8.0.4
echo "Preparing base OS ..."
which wget >/dev/null || (apt-get update; apt-get install -y wget)
echo "deb [arch=amd64] http://apt.tcpcloud.eu/nightly/ xenial main security extra tcp tcp-salt" > /etc/apt/sources.list
@r7vme
r7vme / blueprint-matchbox-machine-list.md
Last active Apr 19, 2017
blueprint-matchbox-machine-list.md
View blueprint-matchbox-machine-list.md

Matchbox machine registry

TBD

Problem description

Currenly Matchbox doesn't provide any machine discovery mechanism. Matchbox operators should manually create groups with appropriate mac address selectors.

View gist:d4524b28708016d9459c777fd3a25bee
[Unit]
Description=DataDog monitoring agent
After=network.target
[Service]
ExecStart=/root/.datadog-agent/bin/agent
[Install]
WantedBy=default.target
View keybase.md

Keybase proof

I hereby claim:

  • I am r7vme on github.
  • I am r7vme (https://keybase.io/r7vme) on keybase.
  • I have a public key whose fingerprint is 2EA9 731D DF60 0EF5 2A53 AD48 2A56 2388 20F5 F22E

To claim this, I am signing this object:

@r7vme
r7vme / haproxy.service
Last active Jun 16, 2017
systemd unit for haproxy running in docker container
View haproxy.service
[Unit]
Description=Haproxy container
After=docker.service
Requires=docker.service
ConditionFileNotEmpty=/etc/haproxy/haproxy.cfg
[Service]
TimeoutStartSec=0
Restart=always
Environment=CONFIG_DIR=/etc/haproxy
View gist:bcba3380fd33694906c4f63faa607e41
#!/bin/bash
# Script to restore keys to etcd
#
# To dump keys use:
# etcdctl get "" --prefix=true > kv
etcdctl="ETCDCTL_API=3 etcdctl --endpoints=http://127.0.0.1:2379"
# Input filename
F=${1:-'kv'}
View gist:bf7b9d8baf5e709f137a23ec6c105b05
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: nginx-for-ingress-deployment
spec:
replicas: 3
template:
metadata:
labels:
app: nginx
You can’t perform that action at this time.