Skip to content

Instantly share code, notes, and snippets.

View helloimalemur's full-sized avatar
🦊

Koonts helloimalemur

🦊
View GitHub Profile
@helloimalemur
helloimalemur / haproxy-log-request-body.md
Last active May 29, 2024 16:50 — forked from lazywithclass/blog-post.md
Logging request body in HAProxy

Logging request body in HAProxy

add the following to the frontend section of your haproxy configuration

## ------ LOG REQ BODY ----------
option http-buffer-request
declare capture request len 40000000
http-request capture req.body id 0
log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %[capture.req.hdr(0)]"
## --------------------
@helloimalemur
helloimalemur / archlinux-kvm.md
Last active May 26, 2024 22:58 — forked from tatumroaquin/archlinux-qemu-kvm.md
KVM Installation for Arch Linux

Arch Linux KVM

install all necessary packages

pacman -S virt-manager virt-viewer qemu

enable libvirt daemon

systemctl enable libvirtd.service
@helloimalemur
helloimalemur / openssl_commands.md
Created April 22, 2024 16:57 — forked from Hakky54/openssl_commands.md
Some list of openssl commands for check and verify your keys

OpenSSL 🔐

Install

Install the OpenSSL on Debian based systems

sudo apt-get install openssl
@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 / 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 / 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