Skip to content

Instantly share code, notes, and snippets.

@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
@infval
infval / emuparadise.download.user.js
Last active April 10, 2024 23:22
emuparadise.me download workaround (Most games + Sega Dreamcast, Books/Comics/Guides/Magazines)
// ==UserScript==
// @name EmuParadise Download Workaround
// @version 1.2.3
// @description Replaces the download button link with a working one
// @author infval (Eptun)
// @match https://www.emuparadise.me/*/*/*
// @grant none
// ==/UserScript==
// https://www.reddit.com/r/Piracy/comments/968sm6/a_script_for_easy_downloading_of_emuparadise_roms/

gif-from-tweet

There are so many great GIFs out there and I want to have copies of them. Twitter makes that harder than it should be by converting them to MP4 and not providing access to the source material. To make it easier, I made a bash pipeline that takes a tweet URL and a filename, extracts the MP4 from that tweet and uses ffmpeg to convert back to GIF.

Dependencies

  • ffmpeg
    • macOS: brew install ffmpeg
    • Ubuntu/Debian: apt install ffmpeg
@fracz
fracz / Readme.md
Last active May 2, 2023 07:25
Restore intentionally deleted commits in Git

Restore intentionally deleted commits in Git (remote)

Situation

  1. You own a Git repository server and the developers do not have access to it (i.e. they can only read & write to the repo, but not gc it).
  2. You had a developer that wrote a project for you.
  3. He got angry for whatever reason and deleted all branches from the remote repo. He also push -fed the master branch leaving only one silly commit there.
  4. He escaped from the country leaving you without any code at all (at least this is what he believe in).
  5. You have never cloned the repo to other machine. There were only two copies of it: the developer's one and the server's one.
@Herteby
Herteby / .nanorc
Created November 20, 2017 12:01
Modern keybindings etc. for nano
set morespace
set multibuffer
#set nohelp # perhaps comment out until comfortable
set quickblank
set regexp
set smooth
set suspend
set tabsize 2
unbind ^K main
@themanifold
themanifold / node-prune.sh
Last active October 1, 2022 02:47
Pruning useless node_modules with bash userland tools (find etc)
#!/usr/bin/env bash
find node_modules \( -name '__tests__' -o \
-name 'test' -o \
-name 'tests' -o \
-name 'powered-test' -o \
-name 'docs' -o \
-name 'doc' -o \
-name '.idea' -o \
-name '.vscode' -o \
-name 'website' -o \
@asukakenji
asukakenji / 0-go-os-arch.md
Last active April 24, 2024 06:51
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
@jeckel
jeckel / common.sh
Created May 10, 2017 08:17
Common bash functions
#!/bin/bash
# ----------------------------------------------------------
# Define common colors and styles
#
readonly RED='\033[0;31m'
readonly GREEN='\033[0;32m'
readonly ORANGE='\033[0;33m'
readonly BLUE='\033[0;34m'
readonly PURPLE='\033[0;35m'
@SteveMarshall
SteveMarshall / send-magic-packet.sh
Created April 7, 2017 12:28
Wake-On-Lan Magic Packet using netcat in bash
#!/usr/bin/env bash
mac_address=$1
# Strip colons from the MAC address
mac_address=$(echo $mac_address | sed 's/://g')
broadcast=$2
port=4343
# Magic packets consist of 12*`f` followed by 16 repetitions of the MAC address
@twolfson
twolfson / README.md
Last active November 12, 2022 01:32
Script to upload images to Imgur via curl

Last edited: Nov 15 2016

With visual testing we occasionally need to debug images in CI environments. We were previously using Imgur's v1 API:

https://github.com/twolfson/twolfson.com/blob/3.102.0/test/perceptual-tests/upload-screenshots.sh

but that's been shutdown and v2 and v3 seems like they need login for uploading images. We don't like that since these are rarely setup and we don't want to associate development content with personal content.

Thankfully Imgur supports uploading images via the browser without logging in. After trial/error, we got the following script for uploading a single image: