Skip to content

Instantly share code, notes, and snippets.

View ph00lt0's full-sized avatar
🌟
Stella navigatio

ph00lt0

🌟
Stella navigatio
View GitHub Profile
Preview remove first 72 charachters
```
rename -n -v 's/^(.{72})//' *
```
Apply it
```
rename 's/^(.{72})//' *
```
grep -rlH "{{Search query}}" {{location}}
@ph00lt0
ph00lt0 / add-wp-user.php
Created March 22, 2022 14:14
Add wordpress user
function wp_create_user( $username, $password, $email = '' ) {
$user_login = wp_slash( $username );
$user_email = wp_slash( $email );
$user_pass = $password;
$userdata = compact( 'user_login', 'user_email', 'user_pass' );
return wp_insert_user( $userdata );
}
@ph00lt0
ph00lt0 / reset-dns.sh
Created March 22, 2022 14:13
Reset DNS
sudo killall -HUP mDNSResponder;sudo killall mDNSResponderHelper;sudo dscacheutil -flushcache
@ph00lt0
ph00lt0 / rsync.sh
Created March 22, 2022 14:12
Rsync
rsync -avL --progress {{server}}:{{location}} {{location}}
@ph00lt0
ph00lt0 / fix-localhosts.sh
Created March 22, 2022 14:12
fix-localhosts
for a in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 ; do
sudo ifconfig lo0 alias 127.0.0.$a
done
@ph00lt0
ph00lt0 / find-translation-error-po.sh
Created March 22, 2022 14:11
Find translation error po
msgfmt -v -c {{filename}}
@ph00lt0
ph00lt0 / debloat.md
Created March 22, 2022 14:10
Debloat or uninstall Android system apps

Debloat or uninstall Android system apps

1. Enable android USB debugging

  • Enable developer settings
  • Enable USB DEBUGGING
  • Install ADB options on your computer

2. Connect device

  • Connect the device to computer
  • Open the terminal
@ph00lt0
ph00lt0 / enable-call-recording.sh
Created March 22, 2022 14:09
Enable calll recording dialer app android
adb shell settings put global op_voice_recording_supported_by_mcc 1
@ph00lt0
ph00lt0 / hcloud-fw-ssh-delete-an-ip.sh
Last active March 18, 2022 19:47
Delete an ip to revoke ssh access from the IP address to hetzner cloud through the Hetzner cli. This is useful when ip address changed.
hcloud firewall list
read -p "Enter the Firewall ID you want to remove a IP to:" firewallID
hcloud firewall describe $firewallID
read -p "Enter the IP you want to remove your IP to:" ip
hcloud firewall delete-rule --direction in --protocol tcp --port 22 --source-ips $ip/32 $firewallID