Skip to content

Instantly share code, notes, and snippets.

View helloimalemur's full-sized avatar
🦊

helloimalemur helloimalemur

🦊
View GitHub Profile
@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))));

General OpenSSL Commands

These commands allow you to generate CSRs, Certificates, Private Keys and do other miscellaneous tasks.

Generate a new private key and Certificate Signing Request

openssl req -out CSR.csr -new -newkey rsa:2048 -nodes -keyout privateKey.key
@helloimalemur
helloimalemur / pgp.md
Last active December 13, 2022 14:23 — forked from spencerdodd/pgp.md
pgp file encryption / decryption with GPG

generate new key-pair

gpg --full-generate-key #If you are not on version 2.1.17 or greater, the gpg --full-generate-key command doesn't work.
gpg --default-new-key-algo rsa4096 --gen-key

list keys

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH