Skip to content

Instantly share code, notes, and snippets.

@jhrcz
jhrcz / kvm-force-blkio-throttle.sh
Last active December 4, 2017 12:00
force cpu and blkio thottle of kvm guests
#!/bin/bash
cat /cgroup/blkio/libvirt/qemu/blkio.throttle.read_bps_device
cat /cgroup/blkio/libvirt/qemu/blkio.throttle.write_bps_device
cat /cgroup/blkio/libvirt/qemu/*/blkio.throttle.read_bps_device
cat /cgroup/blkio/libvirt/qemu/*/blkio.throttle.write_bps_device
# 10MBps
#BPSLIMIT=10485760
@nopslider
nopslider / modsec.rules
Created February 11, 2015 14:11
ModSec Rule Examples
# Redirect to a different page when a PHP file is uploaded
SecRule FILES "(?i)\.php$" "t:none,log,redirect:http://cyberis.co.uk,msg:'PHP file upload blocked',id:1"
# Deny when a semi-colon is found in the 'ip' parameter
SecRule ARGS:ip ";" "t:none,log,deny,msg:'semi colon test',id:2"
# Disable ModSecurity for a given page - NOTE THE ESCAPE OF THE '?'
SecRule REQUEST_URI "/joomla/index.php/component/users/\?task=registration.register" "allow,id:3"
// This will open up a prompt for text to send to a console session on digital ocean
// Useful for long passwords
(function () {
var t = prompt("Enter text to be sent to console, (This wont send the enter keystroke)").split("");
function f() {
var character = t.shift();
var i=[];
var code = character.charCodeAt();
var needs_shift = "!@#$%^&*()_+{}:\"<>?~|".indexOf(character) !== -1
@jhass
jhass / 1-Yubikey_session_lock.md
Last active June 12, 2024 09:16
Lock (Gnome) session when removing Yubico U2F key

Setup

  1. Copy 99-u2f_lock_screen.rules to /etc/udev/rules.d.
  2. Copy gnome_lock_all_sessions to /usr/local/bin.
  3. Mark gnome_lock_all_sessions as executable: chmod +x /usr/local/bin/gnome_lock_all_sessions
  4. Reload udev: udevadm control -R
@byjg
byjg / NoVNC_Paste.js
Last active June 30, 2024 17:10
How to Paste code to NoVNC.
// This will open up a prompt for text to send to a console session on digital ocean
// Useful for long passwords
(function () {
window.sendString = function (str) {
f(str.split(""));
function f(t) {
var character = t.shift();
var i=[];
var code = character.charCodeAt();
var needs_shift = character.match(/[A-Z!@#$%^&*()_+{}:\"<>?~|]/);
@colemickens
colemickens / amiibo-emulation-with-linux-vm.md
Last active June 27, 2024 12:20
amiibo-emulation-with-linux-vm.md

Easy Amiibo Emulation - https://bit.ly/2z0m09k

(^ that's a short-link to this page, so you can open it in Linux)

Some users are discussing this guide in #hacking on the JoyConDroid Discord: https://discord.gg/SQNEx9v.

DO NOT ask for, or share links to, Amiibo bins in the comments! They will be removed. Thank you for understanding.

(Windows|Linux PC) + JoyControl + Bluetooth = AMIIBO EMULATION

recon() {
subfinder -d $1 -silent|httprobe -c 40|tee -a $1.txt
}
fdir(){