Skip to content

Instantly share code, notes, and snippets.

# If Debian 11 is ran on a LXC container (Proxmox), SSH login and sudo actions can be slow
# Check if in /var/log/auth.log the following messages
Failed to activate service 'org.freedesktop.login1': timed out (service_start_timeout=25000ms)
-> Run systemctl mask systemd-logind
-> Run pam-auth-update (and deselect Register user sessions in the systemd control group hierarchy)
@georgepaoli
georgepaoli / nginx-lua-get-token-body-json.conf
Created May 11, 2020 19:27
Get json field in body request using Lua in NGINX
server {
listen 80;
server_name localhost;
location / {
default_type application/json;
access_by_lua_block {
ngx.req.read_body()
local cjson = require "cjson"
local body = cjson.decode(ngx.req.get_body_data())
@chrisswanda
chrisswanda / WireGuard_Setup.txt
Last active May 2, 2024 01:13
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
@AnnoyingTechnology
AnnoyingTechnology / Multi-threaded-compression-unix.md
Last active December 12, 2019 07:51
Multi-threaded CLI cheatsheet for gzip, bz2, xz (lzma)

.gz (GNU zip)

Medium compression ratio, fast speed.

apt install pigz 
tar -I pigz -cvf archive.tar.gz folder-or-document
@AnnoyingTechnology
AnnoyingTechnology / debian-security-tools.sh
Last active April 12, 2024 09:57
Install debian basic security utilities. You still need to configure some of those, and a lot of other things have to be manually tweaked across a system to keep it secure.
#!/bin/bash
# !!!!!!!!!!!!!!!! DISCLAIMER !!!!!!!!!!!!!!!!!!!!!
# !! THIS WILL NOT SECURE YOUR SYSTEM ON ITS OWN !!
# !! Most of these tools should be set up and/or !!
# !!!!!! ran by a cron with proper repporting !!!!!
# update apt
apt update
# rkhunter : rootkit scanner
apt install rkhunter
# chkrootkit : another rootkit scanner
@AnnoyingTechnology
AnnoyingTechnology / debian-10-post-install-script-first.sh
Last active September 6, 2018 09:49
Debian 10, install lovely software and tools
#!/bin/bash
# Compatible with Debian Buster (10) only (current testing).
# Does not work with Ubuntu 18.04, does not work with Debian 9.5 stretch.
# preliminary tool
apt install dirmngr
# add Flat Remix repo and keys
echo "deb http://ppa.launchpad.net/daniruiz/flat-remix/ubuntu $(lsb_release -sc) main" | tee /etc/apt/sources/list.d/flat-remix.list
@alexlee-gk
alexlee-gk / configure_cuda_p70.md
Last active March 19, 2024 17:47
Use integrated graphics for display and NVIDIA GPU for CUDA on Ubuntu 14.04

This was tested on a ThinkPad P70 laptop with an Intel integrated graphics and an NVIDIA GPU:

lspci | egrep 'VGA|3D'
00:02.0 VGA compatible controller: Intel Corporation Device 191b (rev 06)
01:00.0 VGA compatible controller: NVIDIA Corporation GM204GLM [Quadro M3000M] (rev a1)

A reason to use the integrated graphics for display is if installing the NVIDIA drivers causes the display to stop working properly. In my case, Ubuntu would get stuck in a login loop after installing the NVIDIA drivers. This happened regardless if I installed the drivers from the "Additional Drivers" tab in "System Settings" or the ppa:graphics-drivers/ppa in the command-line.

@webprogramozo
webprogramozo / blur.css
Last active May 5, 2024 18:06
Bootstrap 3 modal with blurry background
body.modal-open > :not(.modal) {
-webkit-filter: blur(1px);
-moz-filter: blur(1px);
-o-filter: blur(1px);
-ms-filter: blur(1px);
filter: blur(1px);
}
@NickCraver
NickCraver / BotLovin.cs
Last active January 5, 2023 11:36
Some bot/crawler fun on Stack Overflow. 10 hours of fun, to be precise.
private static readonly string[] tenHoursOfFun =
{
"https://www.youtube.com/watch?v=wbby9coDRCk",
"https://www.youtube.com/watch?v=nb2evY0kmpQ",
"https://www.youtube.com/watch?v=eh7lp9umG2I",
"https://www.youtube.com/watch?v=z9Uz1icjwrM",
"https://www.youtube.com/watch?v=Sagg08DrO5U",
"https://www.youtube.com/watch?v=5XmjJvJTyx0",
"https://www.youtube.com/watch?v=IkdmOVejUlI",
"https://www.youtube.com/watch?v=jScuYd3_xdQ",
@aeris
aeris / privacy.sieve
Last active March 6, 2017 19:49
Sieve filter for privacy
# Licence : AGPLv3+
# rule:[Privacy]
if anyof (
address :is :domain "From" "gmail.com",
address :is :domain "From" "live.com",
address :is :domain "From" "msn.com",
address :is :domain "From" "hotmail.com",
address :is :domain "From" "hotmail.fr",
address :is :domain "From" "yahoo.com",
address :is :domain "From" "yahoo.fr"