Skip to content

Instantly share code, notes, and snippets.

View olegbuevich's full-sized avatar

Aleh Buyevich olegbuevich

View GitHub Profile
@olegbuevich
olegbuevich / audit.rules
Created February 13, 2021 23:43 — forked from Neo23x0/audit.rules
Linux Auditd Best Practice Configuration
# IMPORTANT!
# This gist has been transformed into a github repo
# You can find the most recent version there:
# https://github.com/Neo23x0/auditd
# ___ ___ __ __
# / | __ ______/ (_) /_____/ /
# / /| |/ / / / __ / / __/ __ /
# / ___ / /_/ / /_/ / / /_/ /_/ /
# /_/ |_\__,_/\__,_/_/\__/\__,_/
@olegbuevich
olegbuevich / get-temporary-credentials.sh
Last active February 3, 2020 12:50
get temporary credentials for using aws resources with force mfa policy
#!/bin/bash
set -eu
# USAGE:
# ./get-temporary-credentials.sh TOKEN
# sample: ./get-temporary-credentials.sh 123456
# AWS named profile
AWS_PROFILE=personal
# The identification number of the MFA device that is associated with the IAM user who is making the GetSessionToken call
@olegbuevich
olegbuevich / install.sh
Created December 5, 2019 09:31
Install kexts from terminal
# Catalina only
sudo spctl --master-disable
sudo mount -uw
sudo killall Finder
# All
sudo cp -R *.kext /Library/Extensions
# fix permissions
sudo chown -v -R root:wheel /System/Library/Extensions
@olegbuevich
olegbuevich / daemon.json
Created December 3, 2019 08:00
set docker and docker-compose address pool
{
"default-address-pools" : [
{
"base" : "172.31.0.0/16",
"size" : 24
}
]
}
@olegbuevich
olegbuevich / openssh_rpm_build.sh
Last active December 2, 2022 19:30
Build openssh 8 rpms for centos 6
#!/bin/bash
set -eu
OPENSSH_VERSION="8.0p1"
sudo yum install -y epel-release
sudo yum install -y mock rpm-build
mkdir -p ~/rpmbuild/SOURCES
cd ~/rpmbuild/SOURCES
@olegbuevich
olegbuevich / fix.sh
Created October 19, 2018 11:24
fix VS Code is default app for directories
# get current value
xdg-mime query default inode/directory
#set new value
xdg-mime default org.gnome.Nautilus.desktop inode/directory
@olegbuevich
olegbuevich / create_swapfile.sh
Created October 10, 2018 11:51
create swap file
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo "/swapfile swap swap sw 0 0" | sudo tee -a /etc/fstab
@olegbuevich
olegbuevich / passenger@.service
Created October 1, 2018 12:30 — forked from ejangi/passenger@.service
systemd file for standalone passenger apps
[Unit]
Description=Passenger Standalone Application Server
After=network.target
[Service]
Type=forking
PrivateTmp=yes
User=nginx
Group=nginx
WorkingDirectory=/srv/www/%i
@olegbuevich
olegbuevich / fix_slack_icon_snapd.sh
Created June 12, 2018 09:57
fix slack no icon in snapd
#!/bin/bash
echo "StartupWMClass=Slack" | sudo tee -a /var/lib/snapd/desktop/applications/slack_slack.desktop
@olegbuevich
olegbuevich / jenkins.conf
Created June 6, 2018 09:31
jenkins + nginx proxy (JENKINS_ARGS=--prefix=/jenkins)
server {
listen 80 default_server;
server_name dev.example.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl default_server;
server_name dev.example.com;
ssl_certificate /etc/letsencrypt/live/dev.example.com/fullchain.pem;