Skip to content

Instantly share code, notes, and snippets.

View techie2000's full-sized avatar

Darth techie2000

  • Probably somewhere quiet
  • 05:45 (UTC +01:00)
View GitHub Profile
@techie2000
techie2000 / safe_perms.sh
Created July 4, 2021 19:45
Setting safe directory/file permissions
# for directories: rwxr_xr_x
find . -type d -exec chmod 755 {} \;
# for files : rw_r__r__
find . -type f -exec chmod 644 {} \;
# or wrap it in one command
find YOUR_CATALOG -type f -exec chmod 644 {} + -o -type d -exec chmod 775 {} +
apt list --installed
# or
dpkg -l
@techie2000
techie2000 / nvidia_status.sh
Last active July 4, 2021 19:45
nvidia gpu status
watch nvidia-smi
@techie2000
techie2000 / findfile.sh
Created December 15, 2020 09:20
Find all files with given (part) name
find . -name '*.foo'
@techie2000
techie2000 / findinum.sh
Created December 11, 2020 12:39
Find all files that share a given inum
find . -inum 12345678
@techie2000
techie2000 / localip.sh
Created December 10, 2020 18:14
whats my internal ip address
ip route get 8.8.8.8 | sed -n '/src/{s/.*src *\([^ ]*\).*/\1/p;q}'
@techie2000
techie2000 / externalip.sh
Created December 10, 2020 17:58
whats my external ip address?
curl -s http://whatismyip.akamai.com/
@techie2000
techie2000 / wget.sh
Last active January 24, 2021 16:32
Download a site
wget --mirror --no-parent --continue --limit-rate=512k --wait=0 --reject "index.html*, foo.txt, bar*.*" "https://the-eye.eu/public/AppleArchive/"
@techie2000
techie2000 / hardlink.sh
Created December 10, 2020 17:01
Create hardlinks for multiple files
@techie2000
techie2000 / lastreboot.sh
Last active October 10, 2020 02:26
When was my 'nix box last rebooted?
awk '/btime/ {print $2}' /proc/stat | xargs -IUNIX_TIMESTAMP date --date @UNIX_TIMESTAMP