Skip to content

Instantly share code, notes, and snippets.

View beppe9000's full-sized avatar

beppe9000

View GitHub Profile
@jaywilliams
jaywilliams / dumprequest.php
Last active November 8, 2023 12:28 — forked from magnetikonline/dumprequest.php
PHP script to dump full HTTP request to file (method, HTTP headers and body).
<?php
// https://gist.github.com/jaywilliams/bee2512f0f12d6791315d6939119e135
// Forked: https://gist.github.com/magnetikonline/650e30e485c0f91f2f40
// Usage: php -S localhost:8080 dumprequest.php
// Path to store all incoming requests
define('LOG_OUTPUT', __DIR__ . '/requests.log');
$data = sprintf(
"[%s]\n%s %s %s\n\nHTTP HEADERS:\n",
@avoidik
avoidik / README.md
Last active March 12, 2024 13:21
Compile vaultwarden (ex. bitwarden_rs) on Raspberry Pi

How to build and install vaultwarden (ex. bitwarden_rs) on Raspberry Pi

Best advise ever: make a backup before doing any operations described below

Steps

Prepare prerequisites

sudo apt-get update
@gorgos
gorgos / ExampleSlidingWindowOracleDaiWethKovan.sol
Created January 9, 2021 20:16
ExampleSlidingWindowOracle with DAI + WETH for Kovan.
pragma solidity 0.6.6;
pragma experimental ABIEncoderV2;
import "https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/interfaces/IUniswapV2Pair.sol";
import "https://github.com/Uniswap/uniswap-lib/blob/master/contracts/libraries/FixedPoint.sol";
import "https://github.com/Uniswap/uniswap-lib/blob/master/contracts/libraries/FullMath.sol";
import "https://github.com/Uniswap/uniswap-lib/blob/master/contracts/libraries/Babylonian.sol";
import "https://github.com/Uniswap/uniswap-lib/blob/master/contracts/libraries/BitMath.sol";
library SafeMath {
@kekru
kekru / 01-Openshift3-WSL2.md
Last active March 30, 2024 06:51
Openshift 3.11 in WSL2

Running Openshift 3.11 inside WSL2

This is not running yet, but nearly almost

Install WSL2 and oc client

First install a WSL2 with Ubuntu 20.04 as described at Microsoft

Enter wsl shell

@o5
o5 / dump.sh
Last active February 21, 2024 04:52
MySQL / MariaDB Dump Helper
#!/usr/bin/env bash
# MySQL / MariaDB Dump Helper
# ===========================
# FEATURES: Progress bar with ETA, support multiple databases (dump into separated files) and password as argument
# REQUIREMENTS:
# =============
# GNU Core Utilities, mysql, mysqldump, pv (https://github.com/icetee/pv)
@QuiteZeal
QuiteZeal / Change SSH port on CentOS 8.md
Last active December 18, 2023 20:40
Change SSH port on CentOS 8

Change SSH port on CentOS 8

The key step is to turn your want listen-port and close the default ssh-port. For CentOS 8, will use firewalld

Open your want listen-port and close the default

sudo firewall-cmd --zone=public --permanent --add-port=30000/tcp
sudo firewall-cmd --zone=public --permanent --remove-service=ssh

If firewalld not installed, you can manually install and enable it.

@cerebrate
cerebrate / README.md
Last active December 2, 2023 08:17
Recompile your WSL2 kernel - support for snaps, apparmor, lxc, etc.

WARNING

THIS GIST IS EXTREMELY OBSOLETE. DO NOT FOLLOW THESE INSTRUCTIONS. SERIOUSLY.

IF YOU IGNORE THE ABOVE WARNING, YOU AGREE IN ADVANCE THAT YOU DIDN'T GET THESE INSTRUCTIONS FROM ME, THAT I WARNED YOU, AND THAT I RESERVE THE RIGHT TO POINT AND LAUGH MOCKINGLY IF AND WHEN SOMETHING BREAKS HORRIBLY.

I'll do a write-up of current custom-kernel procedures over on Random Bytes ( https://randombytes.substack.com/ ) one day soon.

NOTE

msys2 vs msys vs msysgit
MinGW doesn't provide a linux-like environment, that is MSYS(2) and/or Cygwin
Cygwin is an attempt to create a complete UNIX/POSIX environment on Windows.
MinGW is a C/C++ compiler suite which allows you to create Windows executables - you only
need the normal MSVC runtimes, which are part of any normal Microsoft Windows installation.
MinGW provides headers and libraries so that GCC (a compiler suite,
not just a "unix/linux compiler") can be built and used against the Windows C runtime.
@thomasdarimont
thomasdarimont / docker-compose.yml
Created January 25, 2019 17:52
Docker OpenLDAP + phpldapadmin example
version: '2'
services:
openldap:
image: osixia/openldap:1.2.3
container_name: openldap
environment:
LDAP_LOG_LEVEL: "256"
LDAP_ORGANISATION: "Example Inc."
LDAP_DOMAIN: "example.org"
LDAP_BASE_DN: ""
@rigwild
rigwild / selfbot.js
Last active April 9, 2022 20:37
This has moved to https://github.com/rigwild/discord-self-bot-console --- A simple Discord Self-bot using console
// Due to some interest, I created a proper repo.
// Check it out! :)
// https://github.com/rigwild/discord-self-bot-console