Skip to content

Instantly share code, notes, and snippets.


Basri hbasria

View GitHub Profile
hbasria /
Last active Oct 5, 2022
Proxmox VE Removing cluster configuration
systemctl stop pve-cluster
systemctl stop corosync
pmxcfs -l
rm -rf /etc/pve/corosync.conf
rm -rf /etc/corosync/*

Client Side Config

Open up your vpn.ovpn config file, it should add nobind and look something like this:




View postgresql-read-access.sql
-- 1. Create a group
CREATE ROLE readaccess;
-- 2. Grant usage on schema:
GRANT USAGE ON SCHEMA schema_name TO readaccess;
-- 3.1 Grant select for a specific table:
GRANT SELECT ON table_name TO readaccess;
-- 3.2 Grant select for multiple tables:
View nginx_google_analytics
# send logs for all traffic (including non-html) to google analytics
# in server block:
# set $google_analytics_id "UA-THECORRECT-ID";
# include /srv/nginx/google_analytics;
# in location blocks:
# post_action @ga;
# notes: post_action has been referred to by nginx devs as a "dirty hack" and this approach may stop working one day.
hbasria / check-mysql-database-table-sizes.sql
Last active Sep 8, 2021
How to check MySQL database and table sizes
View check-mysql-database-table-sizes.sql
SELECT table_schema AS "Database",
ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Size (MB)"
FROM information_schema.TABLES
GROUP BY table_schema;
SELECT table_name AS "Table",
ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Size (MB)"
FROM information_schema.TABLES
WHERE table_schema = "database_name"
hbasria / gist:c2cb6451b29eefe083d1e34808f1047a
Created Mar 21, 2021
FreeIPA Password Expiry Notification Script for Red Hat Identity Management
View gist:c2cb6451b29eefe083d1e34808f1047a
# notifies people a set number of days before expiry, once via email
# open a kerberos ticket using keytab authentication
# the following keytab file was made using ktutil with rc4-hmac
/usr/bin/kinit admin@YOURDOMAIN.COM -k -t /sextoys/admin.keytab
View pf.conf
icmp_types = "{ echoreq unreach }"
table <bruteforce> persist
table <rfc6890> { \ \ \ }
hbasria /
Created Jun 22, 2020 — forked from mrbar42/
Secured HLS setup with Nginx as media server

Secured HLS setup with Nginx as media server

This example is part of this article.

This is an example for an HLS delivery with basic security. Nginx compiled with nginx-rtmp-module & secure-link is used as media server. Features:

  • Domain filtering
  • Referrer filtering
  • Embed buster
View postgres_queries_and_commands.sql
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'

Direct copy of pre-encoded file:

$ ffmpeg -i filename.mp4 -codec: copy -start_number 0 -hls_time 10 -hls_list_size 0 -f hls filename.m3u8

ffmpeg -i input.mp4 -profile:v baseline -level 3.0 -s 640x360 -start_number 0 -hls_time 10 -hls_list_size 0 -f hls index.m3u8