Skip to content

Instantly share code, notes, and snippets.

View m0zgen's full-sized avatar

/:) m0zgen

View GitHub Profile
@m0zgen
m0zgen / centos8-9.sh
Created August 30, 2022 07:21 — forked from yodermk/centos8-9.sh
Commands to live-upgrade CentOS Streams 8 -> 9
# The general procedure here is adapted from the 7->8 guide here. https://www.tecmint.com/upgrade-centos-7-to-centos-8/
#
# It is a curated list of my bash history. I entered other commands so hopefully I got the right ones here.
yum upgrade
reboot
dnf install epel-release
dnf install rpmconf
dnf install yum-utils
rpmconf -a # answer "n" to both things
@m0zgen
m0zgen / nginx.conf
Created July 25, 2022 07:47 — forked from phamquocbuu/nginx.conf
NGINX Proxy with Geo module
# https://serverfault.com/questions/545441/nginx-geo-location-module-configuration-using-geo-database
# http://nginx.org/en/docs/http/ngx_http_geo_module.html#directives
# https://www.howtoforge.com/nginx-how-to-block-visitors-by-country-with-the-geoip-module-debian-ubuntu
# https://dev.maxmind.com/geoip/legacy/geolite/
geoip_country /usr/share/GeoIP/GeoIP.dat;
map $geoip_country_code $backend {
default US;
US US;
CN DE;
@m0zgen
m0zgen / kresd-config.lua
Created June 20, 2022 11:34 — forked from catap/kresd-config.lua
An example configuration to random selection between Quad9, Cloudflare and Google DNS-over-TLS for knot-resolver (kresd)
require 'math'
math.randomseed(os.time())
dns_providers = {
{ -- Quad9
{'9.9.9.9', hostname='dns.quad9.net', ca_file='/usr/local/etc/kresd/DigiCertECCSecureServerCA.pem'},
{'149.112.112.112', hostname='dns.quad9.net', ca_file='/usr/local/etc/kresd/DigiCertECCSecureServerCA.pem'}
},
{ -- Cloudflare
{'1.1.1.1', hostname='cloudflare-dns.com', ca_file='/usr/local/etc/kresd/DigiCertECCSecureServerCA.pem'},
@m0zgen
m0zgen / nginx.minimal.conf
Created June 19, 2022 11:37 — forked from ysmood/nginx.minimal.conf
nginx minimal reverse proxy config
events {}
http {
server {
listen 8080;
server_name a.com;
location / {
proxy_pass http://127.0.0.1:8888;
}
@m0zgen
m0zgen / config
Created June 18, 2022 15:56 — forked from jzelinskie/config
generate a knot-resolver (kresd) blacklist.rpz from pihole sources
-- Refer to manual: https://knot-resolver.readthedocs.io/en/latest/daemon.html#configuration
-- Listen on all interfaces (localhost would not work in Docker)
net.listen('0.0.0.0')
net.listen('0.0.0.0', 853, {tls=true})
-- Auto-maintain root TA
trust_anchors.file = '/data/root.keys'
-- Load Useful modules
@m0zgen
m0zgen / etc-monit-monitrc.d-redis
Created May 31, 2022 12:29 — forked from tivnet/etc-monit-monitrc.d-redis
Monitoring Redis with Monit : /etc/monit/monitrc.d/redis
check host redis.host with address 127.0.0.1
if failed port 6379 protocol redis then alert
check process redis-server with pidfile "/var/run/redis/redis-server.pid"
start program = "/etc/init.d/redis-server start"
stop program = "/etc/init.d/redis-server stop"
if failed host 127.0.0.1 port 6379 then restart
if 5 restarts within 5 cycles then timeout
@m0zgen
m0zgen / README.md
Created March 15, 2022 07:48 — forked from okaufmann/README.md
Fix `warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)` error on Raspberry PI

Run the following:

echo "LC_ALL=en_US.UTF-8" | sudo tee -a /etc/environment > /dev/null
echo "en_US.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen > /dev/null
echo "LANG=en_US.UTF-8" | sudo tee /etc/locale.conf > /dev/null
sudo locale-gen en_US.UTF-8
@m0zgen
m0zgen / BlockYouTubeHostsFile
Created February 9, 2022 14:18 — forked from tibovanheule/BlockYouTubeHostsFile
Block YouTube Hosts File
0.0.0.0 host.youtube.com
0.0.0.0 mx.youtube.com
0.0.0.0 admin.youtube.com
0.0.0.0 devel.youtube.com
0.0.0.0 stats.youtube.com
0.0.0.0 http.youtube.com
0.0.0.0 mx0.youtube.com
0.0.0.0 administration.youtube.com
0.0.0.0 development.youtube.com
0.0.0.0 svn.youtube.com
@m0zgen
m0zgen / chmod-400.cmd
Created October 12, 2021 10:04 — forked from jaskiratr/chmod-400.cmd
Set permission of file equivalent to chmod 400 on Windows.
# Source: https://stackoverflow.com/a/43317244
$path = ".\aws-ec2-key.pem"
# Reset to remove explict permissions
icacls.exe $path /reset
# Give current user explicit read-permission
icacls.exe $path /GRANT:R "$($env:USERNAME):(R)"
# Disable inheritance and remove inherited permissions
icacls.exe $path /inheritance:r