Skip to content

Instantly share code, notes, and snippets.

View naumvd95's full-sized avatar
🐙
breaking things, fixing things

Vladislav Naumov naumvd95

🐙
breaking things, fixing things
View GitHub Profile
@naumvd95
naumvd95 / pushkin_elastic_stub_gen.sh
Created April 7, 2017 12:30 — forked from rkhozinov/pushkin_elastic_stub_gen.sh
Pushkin elastic fake notification generator
host=172.16.10.254
port=9200
title=$(python -c "import random_words; print ' '.join(random_words.RandomWords().random_words(count=2))")
content=$(python -c "import random_words; print ' '.join(random_words.RandomWords().random_words(count=10))")
app=$(($RANDOM % 3 + 1))
timestamp=$(date +"%Y-%m-%d %H:%M:%S")
data="
\"title\": \"${title}\",
\"content\": \"${content}\",
#!/bin/bash
# this small file explain step-by step , how-to use ssh-fs
#create mount dir and set up environment
sudo mkdir /media/stark1
sudo chown vnaumov:vnaumov /media/stark1
apt-get install sshfs
# attach remote dir using sshfs
sshfs vnaumov@172.18.184.42:/home/vnaumov/stark1/ /media/stark1 -o reconnect
@naumvd95
naumvd95 / who-remove-dat.sh
Created January 16, 2018 12:33
helpful script to investigate who remove file)
#!/bin/bash
#set -ex
echo 'firstly find out remove type (ssh/nfs/locally etc..)!'
echo -e '-----------------------------------------------------\n'
echo 'take a look on history command in /root/.bash_history'
HISTFILE=/root/.bash_history
set -o history
history | grep -n "rm\|mv"
echo -e '-----------------------------------------------------\n'
@naumvd95
naumvd95 / pure-salt.sh
Created January 16, 2018 12:49
refresh salt entities
echo 'clear cache-------------'
salt '*' saltutil.clear_cache
echo 'clear refresh beacons--------'
salt '*' saltutil.refresh_beacons
echo 'clear refresh grains--------'
salt '*' saltutil.refresh_grains
echo 'clear refresh modules--------'
salt '*' saltutil.refresh_modules
echo 'clear refresh pillars--------'
salt '*' saltutil.refresh_pillar
@naumvd95
naumvd95 / remove-clone-cron.sh
Last active January 17, 2018 14:21
remove duplicating jobs from crontab
crontab -l | sort -u | crontab -
@naumvd95
naumvd95 / logging.py
Created February 11, 2018 14:55 — forked from kingspp/logging.py
Python Comprehensive Logging using YAML Configuration
import os
import yaml
import logging.config
import logging
import coloredlogs
def setup_logging(default_path='logging.yaml', default_level=logging.INFO, env_key='LOG_CFG'):
"""
| **@author:** Prathyush SP
| Logging Setup
@naumvd95
naumvd95 / gist:021227e3cb4761945be999faf0a8e9c7
Created March 7, 2018 10:36 — forked from jessedearing/gist:2351836
Create self-signed SSL certificate for Nginx
#!/bin/bash
echo "Generating an SSL private key to sign your certificate..."
openssl genrsa -des3 -out myssl.key 1024
echo "Generating a Certificate Signing Request..."
openssl req -new -key myssl.key -out myssl.csr
echo "Removing passphrase from key (for nginx)..."
cp myssl.key myssl.key.org
openssl rsa -in myssl.key.org -out myssl.key
@naumvd95
naumvd95 / AKS_public_ip
Last active March 22, 2018 11:37 — forked from tsaarni/README.md
How to connect to Azure AKS Kubernetes node VM by SSH
# How to connect to Azure AKS Kubernetes worker node by SSH
Nodes are not assigned public IP. If you have accessible VM in the same VNET as worker nodes,
then you can use that VM as jump host and connect the worker via private IP.
Alternatively public IP can be assigned to a worker node. This readme shows how to do that.
## Steps how to attach public IP to a worker node
find out the resource group that AKS created for the node VMs
@naumvd95
naumvd95 / iterm2-solarized.md
Last active February 3, 2022 09:36 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k