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 / macos-add-dock-spacer.sh
Created July 13, 2022 00:28
MacOS Add dock spacer
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="small-spacer-tile";}' && killall Dock
@ph00lt0
ph00lt0 / macos-disable-disk-warning.sh
Created July 13, 2022 00:27
MacOS disable disk warning
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.DiskArbitration.diskarbitrationd.plist DADisableEjectNotification -bool YES && sudo pkill diskarbitrationd

Resize storage Ubuntu

  • Step 0 Become root

    sudo -i
    
  • Step 1

read -p "Username: " user
read -p "Database: " database
date=`date +%m-%d-%Y`
mysql -u $user -p $database > ${database}-${date}.sql
gulp.task('watch', function () {
browserSync.init({
files: ['{lib,templates}/**/*.twig', '*.php'],
proxy: 'https://' + 'localhost' + '.test',
host: 'localhost' + '.test',
open: 'external',
port: 8000,
https: {
key:
'/Users/' + 'user' + '/.config/valet/Certificates/' + 'localhost' + '.test.key',
@ph00lt0
ph00lt0 / fswatch-duck-cryptomator.sh
Last active April 23, 2022 17:12
Sync changes in cryptomator vaults to remote vault using _duck and fswatch
fswatch -0 ~/vaults/ | xargs -0 -I {} -t sh -c 'f="{}"; duck --upload sftp://<hostname>/vaults`basename "${f}"` "${f}" -existing overwrite'
@ph00lt0
ph00lt0 / keep-alive.sh
Last active April 12, 2022 14:41
Prevent MacOS from sleeping
pmset noidle
@ph00lt0
ph00lt0 / update-wp-siteurl-home.sql
Last active March 18, 2023 17:09
Update siteurl and home WordPress SQL
UPDATE ew92_options SET option_value = replace(option_value, 'https://old-domain.example', 'https://new-domain.example') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE ew92_posts SET post_content = replace(post_content, 'https://old-domain.example', 'https://new-domain.example');
UPDATE ew92_postmeta SET meta_value = replace(meta_value,'https://old-domain.example','https://new-domain.example');
php -d memory_limit=-1 `which composer`
git checkout {{mybranch}}
git reset --hard origin/{{mybranch}}