Skip to content

Instantly share code, notes, and snippets.

@pythoninthegrass
pythoninthegrass / smb.sh
Last active January 24, 2025 09:53
Edited QNAP TS-453A /etc/init.d/smb.sh config to automatically generate a more performant /etc/config/smb,conf.
#!/bin/sh
# SOURCES:
# QNAP persistent smb.conf commands @ https://forum.qnap.com/viewtopic.php?t=132175
# Socket options @ https://calomel.org/samba_optimize.html
# Server multichannel support / AIO @ https://blog.chaospixel.com/linux/2016/09/samba-enable-smb-multichannel-support-on-linux.html
# Min receivefile, RW raw, AIO switched aio to 16384 @ https://superuser.com/a/928126
netbios_wrapper()
{
@chrisswanda
chrisswanda / WireGuard_Setup.txt
Last active May 8, 2025 19:21
Stupid simple setting up WireGuard - Server and multiple peers
Install WireGuard via whatever package manager you use. For me, I use apt.
$ sudo add-apt-repository ppa:wireguard/wireguard
$ sudo apt-get update
$ sudo apt-get install wireguard
MacOS
$ brew install wireguard-tools
Generate key your key pairs. The key pairs are just that, key pairs. They can be
@itSQualL
itSQualL / postgres_dumps.md
Last active April 10, 2025 14:51
How to backup and restore postgres from docker

Docker & PostgreSQL

How to backup PostgreSQL database from Docker container

  1. Go to the directory with docker-compose file.

  2. Execute the next command to get db dump (note that the next command is an example for actual docker-compose config):

docker-compose run postgres pg_dump -h postgres -U postgres db_development > db_development.dump
@kvnxiao
kvnxiao / awesome-selfhosted-sorted-by-stars.md
Last active May 14, 2025 11:32
awesome-selfhosted-sorted-by-stars.md

Awesome-Selfhosted

Awesome

Selfhosting is the process of locally hosting and managing applications instead of renting from SaaS providers.

This is a list of Free Software network services and web applications which can be hosted locally. Non-Free software is listed on the Non-Free page.

See Contributing.

@mirajehossain
mirajehossain / ubuntu-server-hardening.md
Last active April 11, 2025 08:37
ubuntu-server-hardening checklist

Ubuntu-Server-Hardening

1. Secure Shared Memory

What is shared memory?

Shared memory is an efficient means of passing data between programs. Because two or more processes can use the same memory space, it has been discovered that, since shared memory is, by default, mounted as read/write, the /run/shm space can be easily exploited. That translates to a weakened state of security.

If you’re unaware, shared memory can be used in an attack against a running service. Because of this, you’ll want to secure that portion of system memory.

@kiler129
kiler129 / README.md
Last active May 6, 2025 16:02 — forked from seeker2921/ilo-console.sh
Run iLO remote console from shell

iLO Remote Console

This small script lets you start iLO Java-based console from shell.

But why not HTML5?

  • iLO 2/3 doesn't have HTML5 console
  • Mounting local (from the client computer) ISOs is PAINFULLY slow via HTML5 client

TL;DR

If you just start it, it will ask you for everything:

@hugefiver
hugefiver / set_proxy.ps1
Last active August 12, 2024 02:53
powershell set default proxy for `Invoke-WebRequest`
# set to system default proxy
[System.Net.WebRequest]::DefaultWebProxy = [System.Net.WebRequest]::GetSystemWebProxy()
[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
# or a custom one
[System.Net.WebRequest]::DefaultWebProxy = New-Object System.Net.WebProxy("http://localhost:8080")
# or use username and password auth
[System.Net.WebRequest]::DefaultWebProxy = New-Object System.Net.WebProxy("http://localhost:8080",$true)
[System.Net.WebRequest]::DefaultWebProxy.Credentials = New-Object System.Net.NetworkCredential($user, $passwd)
@lynsei
lynsei / .gitignore
Last active November 19, 2024 20:41
[cloud-init] #Ubuntu #Hard #CIS #hardened 20.04 #splunk #lynslang
node_modules
@xgp
xgp / Dockerfile
Last active April 23, 2025 11:17
Keycloak 17 example using JGroups JDBC_PING discovery protocol for Infinispan
FROM quay.io/keycloak/keycloak:17.0.0 as builder
ENV KC_METRICS_ENABLED=true
ENV KC_FEATURES=preview
ENV KC_DB=postgres
ENV KC_HTTP_RELATIVE_PATH=/auth
# specify the custom cache config file here
ENV KC_CACHE_CONFIG_FILE=cache-ispn-jdbc-ping.xml
# copy the custom cache config file into the keycloak conf dir

[guide] keycloak authentication for proxmox

How to setup Proxmox to use Keycloak as authentication realm.

Proxmox Setup

root@proxmox:/etc/pve# cat domains.cfg
pam: pam
        comment Linux PAM standard authentication