Skip to content

Instantly share code, notes, and snippets.

View mehdiMj-ir's full-sized avatar
🐧

mehdiMj mehdiMj-ir

🐧
View GitHub Profile
@jkstill
jkstill / proc_net_tcp_decode
Last active January 18, 2025 04:34
decode entries in /proc/net/tcp
Decoding the data in /proc/net/tcp:
Linux 5.x /proc/net/tcp
Linux 6.x /proc/PID/net/tcp
Given a socket:
$ ls -l /proc/24784/fd/11
lrwx------ 1 jkstill dba 64 Dec 4 16:22 /proc/24784/fd/11 -> socket:[15907701]
@plentz
plentz / nginx.conf
Last active April 21, 2025 13:23
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@nicolasramy
nicolasramy / bad-joke.sh
Last active August 19, 2020 11:55
This is why you should always lock your session -- https://twitter.com/tuxplanet/status/687702022905270272?s=09
#
#
fake-cd() {
echo "bash: cd: $1: No such file or directory"
}
#
#
fake-ls() {
echo "ls: cannot access $1: No such file or directory"
@achesco
achesco / generate-pg-ssl.md
Last active April 10, 2025 04:56
Generate self-signed SSL certificates for PostgreSQL server and client

CNs are important!!! -days 3650

Create a Certificate Signing Request (CN=localhost)

umask u=rw,go= && openssl req -days 3650 -new -text -nodes -subj '/C=US/ST=Massachusetts/L=Bedford/O=Personal/OU=Personal/[email protected]/CN=localhost' -keyout server.key -out server.csr

Generate self-signed certificate

umask u=rw,go= && openssl req -days 3650 -x509 -text -in server.csr -key server.key -out server.crt
@GAS85
GAS85 / nextcloud_fail2ban.md
Last active March 1, 2025 11:55
Harden Nextcloud 17+ with Fail2Ban, GUI and WebDAV - Ubuntu 20.04

Fail2ban and Nextcloud

Prerequsits

  • Ubuntu 20.04
  • nextcloud, fail2ban and e.g. iptables are installed

Note

@MaxXor
MaxXor / btrfs-guide.md
Last active April 19, 2025 23:29
Btrfs guide to set up an LUKS-encrypted btrfs raid volume with included maintenance & recovery guide

Encrypted Btrfs storage setup and maintenance guide

Initial setup with LUKS/dm-crypt

This exemplary initial setup uses two devices /dev/sdb and /dev/sdc but can be applied to any amount of devices by following the steps with additional devices.

Create keyfile:

dd bs=64 count=1 if=/dev/urandom of=/etc/cryptkey iflag=fullblock
chmod 600 /etc/cryptkey
@isaacarnault
isaacarnault / .gitignore
Last active October 31, 2020 14:10
PostgreSQL integration & setting up: an effective way
________ ________ ___ __ ___
|\_____ \|\ __ \|\ \|\ \ |\ \
\|___/ /\ \ \|\ \ \ \/ /|\ \ \
/ / /\ \ __ \ \ ___ \ \ \
/ /_/__\ \ \ \ \ \ \\ \ \ \ \
|\________\ \__\ \__\ \__\\ \__\ \__\
\|_______|\|__|\|__|\|__| \|__|\|__|
Ignore Azure and GCP. This gist was implemented on AWS.
@dmancloud
dmancloud / How to Install SonarQube in Ubuntu Linux.md
Last active March 22, 2025 21:09
How to Install SonarQube in Linux

How to Install Sonarqube in Ubuntu Linux

Prerequsites

Virtual Machine running Ubuntu 22.04 or newer

Install Postgresql 15

sudo apt update
sudo apt upgrade

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
@djamp42
djamp42 / Graylog 5.1 Config
Created July 1, 2023 03:23
Graylog 5.1 Install on Ubuntu 22.04 LTS
sudo nano /etc/graylog/server/server.conf
echo -n "Enter Password: " && head -1 </dev/stdin | tr -d '\n' | sha256sum | cut -d" " -f1
root_password_sha2 =
< /dev/urandom tr -dc A-Z-a-z-0-9 | head -c${1:-96};echo;
password_secret =
http_bind_address = 0.0.0.0