Skip to content

Instantly share code, notes, and snippets.

View helloimalemur's full-sized avatar
🦊

Koonts helloimalemur

🦊
View GitHub Profile
@helloimalemur
helloimalemur / mac-linux-nfs.md
Last active December 18, 2023 23:34 — forked from betweenbrain/mac-linux-nfs.md
Mac backup to Linux NFS via Time Machine

Server

apt update
apt install nfs-kernel-server
mkdir /mnt/nfs -p
chown nobody:nogroup /mnt/nfs
chmod 777 /mnt/nfs
nano /etc/exports
@helloimalemur
helloimalemur / gdb_cheat_sheet.txt
Created November 30, 2023 20:49
GDB cheat sheet
GDB commands by function - simple guide
---------------------------------------
More important commands have a (*) by them.
Startup
% gdb -help print startup help, show switches
*% gdb object normal debug
*% gdb object core core debug (must specify core file)
%% gdb object pid attach to running process
% gdb use file command to load object
@helloimalemur
helloimalemur / Default_Debian_Bullseye_Repositories.txt
Created November 15, 2023 17:00
Default Debian Bullseye Repositories
deb http://deb.debian.org/debian bullseye main contrib non-free
deb http://deb.debian.org/debian bullseye-updates main contrib non-free
deb http://deb.debian.org/debian bullseye-backports main contrib non-free
deb http://security.debian.org/debian-security/ bullseye-security main contrib non-free
@helloimalemur
helloimalemur / ssh_key_only_auth.conf
Last active November 9, 2023 15:26
Key Only SSHD
## key only auth
ChallengeResponseAuthentication no
PasswordAuthentication no
PermitRootLogin prohibit-password
PubkeyAuthentication yes
@helloimalemur
helloimalemur / BLAZINGLY_FAST_rsync.md
Created October 2, 2023 15:47
BLAZINGLY FAST rsync
rsync -e "ssh -p8888 -o Compression=no" 127.0.0.1:/mnt/1TB/backup.tar.gz -P ./backup.tar.gz
rsync -P ./backup.tar.gz -e "ssh -p8888 -o Compression=no" 127.0.0.1:/mnt/1TB/backup.tar.gz
@helloimalemur
helloimalemur / interfaces
Created August 22, 2023 14:59 — forked from kernelsmith/interfaces
example etc/network/interfaces config
# always start with interface up
auth eth0
# Static
iface eth0 inet static
address 192.168.1.5
netmask 255.255.255.0
gateway 192.168.1.254
dns-nameservers 192.168.1.250
@helloimalemur
helloimalemur / rocket-sqlx.rs
Created July 3, 2023 15:18 — forked from hendi/rocket-sqlx.rs
Rust: rocket with sqlx
#[macro_use] extern crate rocket;
use std::env;
use anyhow::Result;
use rocket::State;
use rocket::http::Status;
use sqlx::{Pool, Postgres};
@helloimalemur
helloimalemur / my.cnf
Created February 27, 2023 15:42
General MySQL config
# === Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers) ===
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated December 2021 ~
#
#
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#
@helloimalemur
helloimalemur / dumprequest.php
Created February 1, 2023 17:18 — forked from magnetikonline/dumprequest.php
PHP script to dump full HTTP request to file (method, HTTP headers and body).
<?php
// https://gist.github.com/magnetikonline/650e30e485c0f91f2f40
class DumpHTTPRequestToFile {
public function execute($targetFile) {
$data = sprintf(
"%s %s %s\n\nHTTP headers:\n",
$_SERVER['REQUEST_METHOD'],
$_SERVER['REQUEST_URI'],
$_SERVER['SERVER_PROTOCOL']
@helloimalemur
helloimalemur / example.cs
Created January 22, 2023 13:41 — forked from brandonmwest/example.cs
Generating base64-encoded Authorization headers in a variety of languages
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue(
"Basic",
Convert.ToBase64String(
System.Text.ASCIIEncoding.ASCII.GetBytes(
string.Format("{0}:{1}", username, password))));