Skip to content

Instantly share code, notes, and snippets.

View olback's full-sized avatar
🦀
https://youtu.be/LDU_Txk06tM

Edwin olback

🦀
https://youtu.be/LDU_Txk06tM
View GitHub Profile
@ThirdPartyNinjas
ThirdPartyNinjas / PiDay.cs
Last active March 12, 2018 20:52
Calculating Pi from random numbers
using System;
namespace PiDay
{
// The probability of two random numbers to be coprime is P = 6 / Pi^2
// So let's generate a bunch of random numbers. Figure out how often they're coprime.
// Use that percentage as our probabilty and solve for Pi.
// Pi = sqrt(6 / P)
// For more info, watch the video where I stole the idea: https://youtu.be/RZBhSi_PwHU
# Generic Makefile for compiling an executable, with pkg-config dependencies.
CC := clang
PKGS := gtk+-3.0
SRCDIR := src
BUILDDIR := build
CFLAGS := -g -Wall `pkg-config --cflags $(PKGS)`
LIBS := `pkg-config --libs $(PKGS)`
TARGET := app
@christhomas
christhomas / scr_to_gif.sh
Last active May 13, 2020 07:38
Easy script to convert a video into a GIF. Great for screen-recordings that can be shared in bug tickets
#!/usr/bin/env bash
self=$(basename $0)
[ "$1" = "help" ] && [ ! -f "$1" ] \
&& echo -e "scr_to_gif: v1.0" \
&& echo -e "usage: ${self} <filename.mov> <scale> <speed>\n" \
&& echo -e "scale: - Range 100-9999" \
&& echo -e " - A single number to denote the desired width, the height will be automatic. E.g: 300, 500, 640, 800, 1024, 1280, 1600" \
&& echo -e " - Also both dimensions with numbers within range. Separated by a colon. Example: 100:100, 512,512, 800:600" \
@zaxebo1
zaxebo1 / README.md
Created October 28, 2017 15:28
How to enable SecureBoot with own keys in KVM and on a laptop (T450s)

UEFI SecureBoot on ArchLinux

For KVM and Laptop

Rationale

I want full control what boots the computer to avoid the so called evil maid attack. That requires setting SecureBoot with only my own keys.

Intro

@thingsiplay
thingsiplay / rscript
Last active December 1, 2021 15:12
Run Rust source code like a script
#!/bin/sh
# rscript: Rust script interpreter
# Shebang in rust.rscript: #!/usr/bin/env -S rscript 2018
# Directory where compiled binaries are saved to.
# Example: /var/tmp/rscript or /tmp
output_dir=/var/tmp/rscript
# -C panic=abort
# abort, unwind
@nl5887
nl5887 / transfer.fish
Last active March 22, 2022 09:07
Bash and zsh alias for transfer.sh. Transfers files and directories to transfer.sh.
function transfer
if test (count $argv) -eq 0
echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"
return 1
end
## get temporarily filename, output is written to this file show progress can be showed
set tmpfile ( mktemp -t transferXXX )
## upload stdin or file
@gnremy
gnremy / CVE-2021-44228_IPs.csv
Last active April 26, 2023 07:01
CVE-2021-44228 Apache Log4j RCE Attempts Dec 20th 9:27PM ET
ip tag_name
162.155.56.106 Apache Log4j RCE Attempt
223.111.180.119 Apache Log4j RCE Attempt
213.142.150.93 Apache Log4j RCE Attempt
211.154.194.21 Apache Log4j RCE Attempt
210.6.176.90 Apache Log4j RCE Attempt
199.244.51.112 Apache Log4j RCE Attempt
199.101.171.39 Apache Log4j RCE Attempt
197.246.175.186 Apache Log4j RCE Attempt
196.196.150.38 Apache Log4j RCE Attempt
@Neo23x0
Neo23x0 / log4j_rce_detection.md
Last active January 28, 2024 08:19
Log4j RCE CVE-2021-44228 Exploitation Detection

log4j RCE Exploitation Detection

You can use these commands and rules to search for exploitation attempts against log4j RCE vulnerability CVE-2021-44228

Grep / Zgrep

This command searches for exploitation attempts in uncompressed files in folder /var/log and all sub folders

sudo egrep -I -i -r '\$(\{|%7B)jndi:(ldap[s]?|rmi|dns|nis|iiop|corba|nds|http):/[^\n]+' /var/log
@belst
belst / rocketguide.md
Last active March 13, 2024 22:09
Deploy Rocket in production

Deploy Rocket using Letsencrypt and nginx

Information

This guide uses the domain your-domain.tld and its www. prefixed version. It starts the rocket application on 127.0.0.1:1337 and as the user www-data. The proxy listens on port 80 and 443 though.
If you need other values, update them accordingly in your nginx and systemd configs.

Prerequisites

You need to have nginx, certbot and rust installed.

@mattiaslundberg
mattiaslundberg / arch-linux-install
Last active March 29, 2024 08:38
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap