Skip to content

Instantly share code, notes, and snippets.

@metajiji
metajiji / netdata_kickstart.sh
Created December 18, 2018 05:45
Install netdata on alpine oneliner
wget -qO- https://my-netdata.io/kickstart-static64.sh | sh -s -- --non-interactive
#!/bin/sh
SMTP_HOST=smtp.domain.ltd
SMTP_USER=user
SMTP_PASSWORD=ToPs3cR3t
# Edit main.cf
postconf -e 'mydestination = $myhostname, localhost.$mydomain, localhost'
postconf -e 'smtp_generic_maps = hash:/etc/postfix/smtp_maps'
postconf -e "relayhost = $SMTP_HOST"

for e in $(seq 0 1000); do sh -c "exit $e"; echo $e:$?; done

@metajiji
metajiji / ANSIBLE_COW_PATH.sh
Last active March 21, 2019 18:19
lolcat wrap cowsay
#!/bin/sh
cowsay $@ | lolcat -f
@metajiji
metajiji / README.md
Created March 23, 2019 18:52
nspawn or docker containers reboot host

systemd 231-4

Reboot host-system from container:

[root@box ~]# echo b > /proc/sysrq-trigger 

Other things m - Will dump current memory info to your console.

  1. Install OS requirements:
yum install -y openssl-devel gcc apr-devel
  1. Check java version:
# /opt/atlassian/jira/jre/bin/java -version
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
@metajiji
metajiji / powerdns_to_ansible.py
Created August 24, 2019 14:19
Powerdns database to ansible vars
import sqlite3
import yaml
def dict_factory(cursor, row):
d = {}
for idx, col in enumerate(cursor.description):
d[col[0]] = row[idx]
return d
@metajiji
metajiji / generate_ca.sh
Created December 3, 2019 13:12
self signed certificates
#!/bin/sh
#
# Required OpenSSL 1.1.1, providing subjectAltName directly on command line:
# https://security.stackexchange.com/questions/74345/provide-subjectaltname-to-openssl-directly-on-the-command-line
#
openssl req -x509 \
-nodes \
-subj "/CN=$1" \
@metajiji
metajiji / speedtest.sh
Last active January 4, 2021 08:31
speedtest oneliner
curl -sL https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | (python2 || python3 || python2)
@ECHO OFF
:: Значения по умолчанию :::::::::::::::::::::::::::
SET TCP_WINDOW=64k
SET TARGET_IP=127.0.0.1
SET TARGET_PROTO=tcp
::::::::::::::::::::::::::::::::::::::::::::::::::::
:: https://ritchielawrence.github.io/mtee/