Skip to content

Instantly share code, notes, and snippets.

@caine
caine / opkg_syno_install.sh
Last active May 31, 2023 18:26
Installs Entware on an intel-based Synology NAS with DSM 5.2
#!/bin/sh
#wget --no-check-certificate -O - https://gist.githubusercontent.com/caine/4a531f1823047bf37f64976ffa9b4f2d/raw/opkg_syno_install.sh | /bin/sh
if [ -d "/volume1/@Entware/opt" ]
then
echo "@Entware directory exists."
#recreate /opt
rm -rf /opt 2> /dev/null
# link the folders

Keybase proof

I hereby claim:

  • I am caine on github.
  • I am caine (https://keybase.io/caine) on keybase.
  • I have a public key whose fingerprint is 6E2C 07CD 1752 BB61 1204 B222 1E42 1BC5 D6BA CD52

To claim this, I am signing this object:

@caine
caine / propperms.sh
Created November 20, 2012 20:21
command sets 755 to directories and 644 to files
find ./* \( -type d -exec chmod 775 '{}' \; \) , \( -type f -exec chmod 664 '{}' \; \)
@caine
caine / icloudssh.sh
Created November 20, 2012 20:19
getting an icloud id for ssh connection
#!/bin/bash
if [ ! -n "$1" ]
then
echo "Usage: `basename $0` hostname"
exit $E_BADARGS
fi
HOSTNAME=$1
DOMAIN=$(echo show Setup:/Network/BackToMyMac | scutil | sed -n 's/.* : *\(.*\).$/\1/p')
@caine
caine / cleanup.ssh
Created November 20, 2012 20:17
system cleanup
#!/bin/bash
sudo periodic daily weekly monthly
sudo rm -rf ~/Library/Logs/*
sudo rm -rf ~/Library/Caches/*
sudo rm -rf /System/Library/Caches/*
sudo rm -rf /Library/Caches/*
rm -rf ~/Library/Safari/Downloads.plist
sudo diskutil repairPermissions /
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user