Skip to content

Instantly share code, notes, and snippets.

@Robert-96
Robert-96 / README.md
Last active October 25, 2024 14:00
Get URL Parameters with JavaScript

Get URL Parameters with JavaScript

URL Parameters (Query Parameters) are a set o key value pars attached to the end of a url. They are used to send small amounts of data from page to page, or from client to server via a URL.

TL;DR

const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
@rojenzaman
rojenzaman / install-wp.sh
Created July 9, 2020 17:17
Install WordPress from command line.
#!/bin/bash -ex
if [ "$#" -lt 2 ]; then
echo "`basename $0` <site> <wp.zip>";
exit 1;
fi
SITE=$1
WPZIP=$PWD/$2
cd /var/www/$SITE/public_html
@rojenzaman
rojenzaman / update_cdn_ip.sh
Created July 9, 2020 17:08
UFW Rules Update for Cloudflare CDN
#!/bin/bash
cd /root/cf
curl https://www.cloudflare.com/ips-v4 > ips-v4
curl https://www.cloudflare.com/ips-v6 > ips-v6
for i in `<ips-v4`; do ufw allow from $i proto tcp to any port 80,443; done
for i in `<ips-v6`; do ufw allow from $i proto tcp to any port 80,443; done
function gen_ssl_cert {
local prefix="${1}"
openssl genrsa -des3 -out "${prefix}.lock.key" 1024
openssl rsa -in "${prefix}.lock.key" -out "${prefix}.key"
rm "${prefix}.lock.key"
openssl req -new -key "${prefix}.key" -out "${prefix}.csr"
openssl x509 -req -days 3650 -in "${prefix}.csr" -signkey "${prefix}.key" -out "${prefix}.crt"
openssl pkcs12 -export -inkey "${prefix}.key" -in "${prefix}.crt" -out "${prefix}.pfx"
@GlauberF
GlauberF / KeyEventSimulator.js
Created April 29, 2020 10:28
A function for simulating key event in JavaScript. You just have to choose what key and keyboard event you want to simulate.
/**
* Simulate a key event.
* @param {Number} keyCode The keyCode of the key to simulate
* @param {String} type (optional) The type of event : down, up or press. The default is down
* @param {Object} modifiers (optional) An object which contains modifiers keys { ctrlKey: true, altKey: false, ...}
*/
function simulateKey (keyCode, type, modifiers) {
var evtName = (typeof(type) === "string") ? "key" + type : "keydown";
var modifier = (typeof(modifiers) === "object") ? modifier : {};
@jfeilbach
jfeilbach / grub.md
Last active December 18, 2025 19:26
Make Linux fast

In /etc/default/grub, modify:

noibrs noibpb nopti nospectre_v2 nospectre_v1 l1tf=off nospec_store_bypass_disable no_stf_barrier mds=off tsx=on tsx_async_abort=off mitigations=off 

Then sudo update-grub

from https:// make-linux-fast-again.com/ This domain does not seem to be maintained any longer.

Hydra

Supported protocols

List1 list2 list3 list4 list5
asterisk icq oracle-listener rexec snmp
cisco imap[s] oracle-sid rlogin socks5
cisco-enable irc pcanywhere rpcap ssh

Grep for files on disk

grep --binary-files=text -B 2 '99999:7' /dev/sda1
find / -maxdepth 2 -path '/proc' -prune -o -path '/dev' -prune -o -type f -exec grep "proof.txt" {} +

Docker privilege Escalation