Skip to content

Instantly share code, notes, and snippets.

javascript:void%20function(){(function(){const%20a=`.flex-shrink-0.overflow-x-hidden[style^=%22width:%20260px%22]`,b=(`/*%20Message%20body%20width%20*/%40media%20(min-width:%201280px)%20{.xl\\:max-w-3xl%20{max-width:%2090%25%20!important;}}%40media%20(min-width:%201024px)%20{.lg\\:max-w-\\[38rem\\]%20{max-width:%2090%25%20!important;}}%40media%20(min-width:%20768px)%20{.md\\:max-w-2xl%20{max-width:%2090%25%20!important;}.md\\:max-w-3xl%20{max-width:%2090%25%20!important;}}/*%20Code%20blocks%20font%20*/code,%20pre%20{font-family:%20Consolas,S%C3%B6hne%20Mono,Monaco,Andale%20Mono,Ubuntu%20Mono,monospace!important;/*%20font-family:%20Iosevka%20Custom,%20S%C3%B6hne%20Mono,Monaco,Andale%20Mono,Ubuntu%20Mono,monospace!important;%20*//*%20font-size:%2012px%20!important;%20*/}/*%20Code%20blocks%20background%20color%20*/pre%20%3E%20div.rounded-md%20{background-color:%20%231e1e1f;}/*%20Code%20blocks%20headings%20background%20color%20*/pre%20%3E%20div.rounded-md%20%3E%20div.flex.items-center.relative%20{background-color
@ChieftainY2k
ChieftainY2k / myscreen.sh
Last active July 2, 2024 09:14
Namespaced screen with separate bash history
set -e
NAMESPACE=${N:-${NAMESPACE:-default}}
echo "************************************************************************************************************"
echo "This screen session is for namespace \"${NAMESPACE}\" "
echo "If you are not the owner of this namespace please exit now (Ctrl-C) , thanks :)"
echo "If you want to use your own screen namespace, use: NAMESPACE=yourname $0 or N=yourname $0"
echo "Press ENTER to continue or Ctrl-C to exit"
echo "************************************************************************************************************"
# create the ~/.screenrc file in your home directory.
hardstatus on
hardstatus alwayslastline
hardstatus string '%{= kG}[%H] %{= kw}%?%-Lw%?%{= bw}[%n*%f %t]%{= kw}%?%+Lw%? %= %D, %d %M %Y %C%a'
shell -/bin/bash
@ChieftainY2k
ChieftainY2k / filename_converter.sh
Last active November 15, 2023 10:02
Convert filenames based on the modification timestamp (this is important for multimedia files to be sorted right)
#!/bin/bash
set -e
# Directory containing .AVI files
SOURCE_DIR="./"
# Directory where files will be copied
TARGET_DIR="./sorted"
# Create target directory if it doesn't exist
@ChieftainY2k
ChieftainY2k / visChangeBlocker.js
Last active September 21, 2023 07:34
Bookmarklet to disable visibility change events (to keep websites playing content even when out of focus) (based on https://greasyfork.org/en/scripts/429635-always-on-focus/code )
javascript:(function(){window.onblur=null;window.blurred=false;Object.defineProperty(document,"hasFocus",{get:function(){return true}});Object.defineProperty(document,"webkitHidden",{get:function(){return false}});["hidden","mozHidden","msHidden","webkitHidden"].forEach(function(t){Object.defineProperty(document,t,{value:false,configurable:true})});["visibilitychange","webkitvisibilitychange","mozvisibilitychange","msvisibilitychange"].forEach(function(t){document.removeEventListener(t,document["on"+t])});var e=function(t){["blur","mouseleave","mouseout"].includes(t.type)&&(t.target instanceof HTMLInputElement||t.target instanceof HTMLAnchorElement||t.target instanceof HTMLSpanElement)&&t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()};["blur","mouseleave","mouseout"].forEach(function(t){window.addEventListener(t,e,true),document.addEventListener(t,e,true)})})();
@ChieftainY2k
ChieftainY2k / jsAlert.js
Created September 18, 2023 11:22
ZED PROXY XSS alert(1) passive scan
//Passive scan for XSS JS alert(1)
function scan(ps, msg, src) {
var alertRisk = 2
var alertConfidence = 3
var alertTitle = 'Successful XSS attack'
var alertDesc = 'Successful XSS attack'
var alertSolution = 'Investigate Successful XSS attack, remove or mask as required'
var cweId = 79
var wascId = 8
@ChieftainY2k
ChieftainY2k / website_checker.sh
Last active September 18, 2023 09:34
Curl/Wget based website availability checker
#!/usr/bin/bash
#set -e
#set -x
#set -o pipefail
log_message() {
LOGPREFIX="[$(date '+%Y-%m-%d %H:%M:%S')][$(basename ${0%})]"
MESSAGE=$1
echo "$LOGPREFIX $MESSAGE"
@ChieftainY2k
ChieftainY2k / JavaLeaks.js
Created August 18, 2023 11:06
ZED PROXY Java leaks passive scan script
// Java leak finder
function scan(ps, msg, src) {
var alertRisk = 3
var alertConfidence = 3
var alertTitle = 'Java leak - investigation required (script)'
var alertDesc = 'Java leaks were found'
var alertSolution = 'Investigate Java leaks found in the response, remove or mask as required'
var cweId = 200
var wascId = 0
@ChieftainY2k
ChieftainY2k / gist:fd9242372759c16d46fa0b1c8348ace4
Created August 8, 2023 13:26
Youtube to Invidious URL redirector bookmarklet
javascript:location.hostname.includes("youtube.com")?location.assign("https://invidious.protokolla.fi"+location.pathname+location.search+location.hash):location.assign("https://invidious.protokolla.fi");
@ChieftainY2k
ChieftainY2k / unzip
Created May 10, 2023 09:56
Vagrant unzip wrapper
#!/bin/sh
#copy this file to /usr/local/bin/unzip
/usr/bin/unzip "$@"
sleep 0.2