Skip to content

Instantly share code, notes, and snippets.

💭
:octocat:

Selivanov Pavel selivan

💭
:octocat:
Block or report user

Report or block selivan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View .bashrc.local
# change shell title before running ssh
function ssh() {
# mess with title only if shell is interactive
# .bashrc should have a guard against non-interactive execution
# so this is just for additional safety - not good idea to break ssh
if [[ $- == *i* ]]; then
local host=$(echo "$@" | sed 's/-[a-zA-Z] //' | tr -d ' ' | cut -d' ' -f1)
echo -ne "\033]0;$host\007"
fi
$(type -f -p ssh || echo /usr/bin/ssh) "$@"
View smtp-test.py
#!/usr/bin/env python3
import sys
import os
import smtplib
from email.mime.text import MIMEText
mail_host = 'email-smtp.eu-west-1.amazonaws.com'
mail_port = 465
View gist:a2522e9b11bb5c8133d0a34c6af80b6d
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: UnicodeEncodeError: 'ascii' codec can't encode characters in position 57566-57569: ordinal not in range(128)
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):
File \"/root/.ansible/tmp/ansible-tmp-1563092412.49-239477708342027/AnsiballZ_zabbix_template.py\", line 125, in <module>
_ansiballz_main()
File \"/root/.ansible/tmp/ansible-tmp-1563092412.49-239477708342027/AnsiballZ_zabbix_template.py\", line 117, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File \"/root/.ansible/tmp/ansible-tmp-1563092412.49-239477708342027/AnsiballZ_zabbix_template.py\", line 54, in invoke_module
imp.load_module('__main__', mod, module, MOD_DESC)
File \"/tmp/ansible_zabbix_template_payload_StS_pq/__main__.py\", line 742, in <module>
File \"/tmp/ansible_zabbix_template_payload_StS_pq/__main__.py\", line 689, in main
@selivan
selivan / auditd.conf
Created Apr 21, 2019 — forked from sakalajuraj/auditd.conf
Logstash configuration for auditd messages received via syslog
View auditd.conf
# Content of the file /etc/logstash/conf.d/auditd.conf
# Tested on the CentOS 7 auditspd logs forwarded to logstash via rsyslog
input {
syslog {
type => AUDITD
port => xxxx
host => "xxx.xxx.xxx.xxx"
}
}
@selivan
selivan / upwork.profile
Created Jan 22, 2019
upwork firejail profile
View upwork.profile
noblacklist ${HOME}/.Upwork
mkdir ${HOME}/.Upwork
whitelist ${HOME}/.Upwork
noblacklist ${HOME}/.config/Upwork
mkdir ${HOME}/.config/Upwork
whitelist ${HOME}/.config/Upwork
noblacklist ${HOME}/.cache/Upwork
mkdir ${HOME}/.cache/Upwork
View new-cadir.sh
#!/bin/bash
#set -x
function die {
echo "ERROR: $*";
exit 1
}
usage_info="Usage: $0 ca_dir
View new-cert.sh
#!/bin/bash
#set -x
function die {
echo "ERROR: $*";
exit 1
}
usage_info="Usage: $0 ca_dir client|server certificate_name
@selivan
selivan / music.yandex.ru userstyle
Last active Aug 11, 2018
Userstyle for music.yandex.ru - remove all shit but leave side ads. Use with https://github.com/openstyles/stylus/
View music.yandex.ru userstyle
@-moz-document domain("music.yandex.ru") {
.bar-below_plus {
position: absolute !important;
z-index: -100;
}
.ads-block{
display: none !important;
}
.d-overhead{
position: absolute !important;
@selivan
selivan / rsyslog.conf
Last active Aug 1, 2018
config for rsyslog/rsyslog issue 2899
View rsyslog.conf
# Default logging rules can be found in /etc/rsyslog.d/50-default.conf
#################
#### MODULES ####
#################
module(load="imuxsock") # provides support for local system logging
module(load="imklog" PermitNonKernelFacility="on") # provides kernel logging support
#module(load="immark") # provides --MARK-- message capability
module(load="omrelp") # provides support for RELP protocol
@selivan
selivan / letsencrypt-update.sh
Created Jun 11, 2018
Letsencrypt update certs using webroot
View letsencrypt-update.sh
#!/bin/bash
DOMAINS=example.net
WEBROOT=/var/www/html
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
certbot certonly --webroot --webroot-path "$WEBROOT" --register-unsafely-without-email -d "$DOMAINS"
iptables -D INPUT -p tcp --dport 80 -j ACCEPT
apache2ctl graceful
You can’t perform that action at this time.