Skip to content

Instantly share code, notes, and snippets.

View ph00lt0's full-sized avatar
🌟
Stella navigatio

Mare Polaris ph00lt0

🌟
Stella navigatio
  • Operaciones Cibernéticas
  • α Ursae Minoris
View GitHub Profile
@ph00lt0
ph00lt0 / force-auth-drf.py
Created May 12, 2020 20:14
Force authenticated Django Rest Framework
user = User.objects.get(username='lauren')
client = APIClient()
client.force_authenticate(user=user)
@ph00lt0
ph00lt0 / remove_accents.sql
Created May 25, 2020 14:44
remove accents in mysql
DELIMITER $$
CREATE DEFINER=`root`@`localhost` FUNCTION `remove_accents`(`str` VARCHAR(255)) RETURNS varchar(255) CHARSET utf8
NO SQL
BEGIN
SET str = REPLACE(str,'Š','S');
SET str = REPLACE(str,'š','s');
SET str = REPLACE(str,'Ð','Dj');
SET str = REPLACE(str,'Ž','Z');
SET str = REPLACE(str,'ž','z');
@ph00lt0
ph00lt0 / select_accent_values.sql
Created May 25, 2020 14:47
Find values with accents
SELECT *
FROM `table`
WHERE `column` <> CONVERT(`column` USING ASCII)
@ph00lt0
ph00lt0 / newpen.sh
Last active February 19, 2022 14:29
Create new users on pentest3@ISG Royal Holloway
user=$(cat /dev/urandom | tr -dc 'a-z' | fold -w 32 | head -n 1)
password=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
printf "$user\n$password\n$password\n\n\n\n\nY\n" | ssh new@pentest3
echo "username: $user"
echo "password: $password"
echo "----"
echo "ssh $user@pentest3"
#! /bin/bash
# Origin: https://github.com/sunknudsen/privacy-guides/tree/master/how-to-clean-uninstall-macos-apps-using-appcleaner-open-source-alternative
if [ -z "$1" ] || [ "$1" = "--help" ]; then
printf "%s\n" "Usage: app-cleaner.sh /path/to/app.app"
exit 0
# Origin: https://github.com/sunknudsen/privacy-guides/tree/master/how-to-spoof-mac-address-and-hostname-automatically-at-boot-on-macos
set -e
set -o pipefail
export LC_CTYPE=C
basedir=$(dirname "$0")
# Spoof computer name
@ph00lt0
ph00lt0 / watch-latex.sh
Last active March 9, 2022 13:17 — forked from alexnederlof/watch.sh
Auto recompile Latex in the background on OS X
#!/bin/bash
###
# A Script that automatically recompiles your
# Latex in the background on Mac OS X.
###
# Options
BIN_PATH=/usr/texbin
FILE=main
WATCH_FILE=chapters
do shell script "nohup /Applications/Firefox.app/Contents/MacOS/firefox-bin -p \"userjs-extreme\" --no-remote > /dev/null 2>&1 &"
@ph00lt0
ph00lt0 / hcloud-fw-ssh-add-ip.sh
Created March 18, 2022 19:40
Add your ip to allow ssh from your current IP address to hetzner cloud through the Hetzner cli
ip=$(curl http://icanhazip.com)
hcloud firewall list
read -p "Enter the Firewall ID you want to add your IP to:" firewallID
hcloud firewall add-rule --direction in --protocol tcp --port 22 --source-ips $ip/32 $firewallID
@ph00lt0
ph00lt0 / hcloud-fw-ssh-delete-ip.sh
Created March 18, 2022 19:41
Delete your ip to allow ssh from your current IP address to hetzner cloud through the Hetzner cli
ip=$(curl http://icanhazip.com)
hcloud firewall list
read -p "Enter the Firewall ID you want to remove your IP to:" firewallID
hcloud firewall delete-rule --direction in --protocol tcp --port 22 --source-ips $ip/32 $firewallID