Skip to content

Instantly share code, notes, and snippets.

View andrewpetrochenkov's full-sized avatar
🔍

Andrew P andrewpetrochenkov

🔍
View GitHub Profile
@andrewpetrochenkov
andrewpetrochenkov / docker-run.sh
Created February 18, 2025 18:44
docker run #docker
docker run --env-file /root/docker-compose/gistmanager.com-django-server/.env -v /var/log/gistmanager.com:/var/log/gistmanager.com -v /root/logging.conf:/code/logging.conf -it --entrypoint sh localhost:5000/gistmanager.com-django-server
# /var/lib/docker/containers/<container-id>/<container-id>-json.log
# todo: shell scripts
@andrewpetrochenkov
andrewpetrochenkov / safari-high-cpu-usage-fix.sh
Created December 12, 2024 13:14
Safari high cpu usage fix #safari #cpu #fix
open -R ~/Library/Safari
find ~/Library/Safari ! -name Bookmarks.plist -exec rm -fr {} \; # Terminal disk full access required
killall Safari
@andrewpetrochenkov
andrewpetrochenkov / wireguard.sh
Last active November 22, 2024 07:26
wireguard VPN #wireguard #vpn
sudo apt update
sudo apt install wireguard
sudo apt install ufw
sudo ufw allow 51820/udp
sudo ufw enable
# /etc/wireguard/wg0.conf
# echo "net.ipv4.ip_forward=1" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
@andrewpetrochenkov
andrewpetrochenkov / docker.sock.sh
Last active November 17, 2024 06:49
docker.sock #docker
curl --unix-socket /var/run/docker.sock http://localhost/containers/json | jq
curl --unix-socket /var/run/docker.sock http://localhost/containers/{CONTAINER_ID}/json | jq
defaults write com.apple.iCal "Display Birthdays calendar" -bool false
defaults write com.apple.iCal NotificationCenterNotificationSound -string ""
@andrewpetrochenkov
andrewpetrochenkov / brew-pid.sh
Last active October 22, 2024 08:05
macOS brew pid #macos #brew
find /opt/homebrew/var -type f -name "*.pid"
find /opt/homebrew/var -type f -name "*.pid" -exec rm {} \;
@andrewpetrochenkov
andrewpetrochenkov / mac-docker.sh
Created October 17, 2024 14:00
macOS Docker #docker #mac
osascript -e 'quit app "Docker"' # stop
open -a Docker # start
docker info
@andrewpetrochenkov
andrewpetrochenkov / mac-tccutil.sh
Created October 17, 2024 13:19
macos tccutil #macos #tccutil
tccutil reset Camera
tccutil reset Microphone
tccutil reset Location
tccutil reset AddressBook
tccutil reset Calendar
tccutil reset Photos
tccutil reset Reminders
tccutil reset BluetoothAlways
tccutil reset SystemPolicyDocumentsFolder
@andrewpetrochenkov
andrewpetrochenkov / mac-squid.conf
Last active October 24, 2024 08:45
mac squid #mac #squid
# /opt/homebrew/etc/squid.conf
debug_options ALL,1 33,2
dns_nameservers 8.8.8.8 8.8.4.4
visible_hostname localhost
acl my_allowed_ip src 127.0.0.1
http_access allow my_allowed_ip