mirror of
https://github.com/sunknudsen/privacy-guides.git
synced 2025-02-23 17:43:56 +00:00
Refactored formatting
This commit is contained in:
parent
2a12081f12
commit
11e1f2721e
@ -289,12 +289,12 @@ cat << "EOF" > /usr/local/sbin/strict.sh
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
if [ "$(id -u)" != "0" ]; then
|
if [ "$(id -u)" != "0" ]; then
|
||||||
echo "This script must run as root"
|
printf "%s\n" "This script must run as root"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
green=$'\e[1;32m'
|
green=$'\e[1;32m'
|
||||||
end=$'\e[0m'
|
nc=$'\e[0m'
|
||||||
|
|
||||||
# /usr/libexec/ApplicationFirewall/socketfilterfw --blockapp /Applications/1Password\ 7.app
|
# /usr/libexec/ApplicationFirewall/socketfilterfw --blockapp /Applications/1Password\ 7.app
|
||||||
# /usr/libexec/ApplicationFirewall/socketfilterfw --blockapp /usr/local/Cellar/squid/4.8/sbin/squid
|
# /usr/libexec/ApplicationFirewall/socketfilterfw --blockapp /usr/local/Cellar/squid/4.8/sbin/squid
|
||||||
@ -308,7 +308,7 @@ printf "\n"
|
|||||||
|
|
||||||
pfctl -F all -f /etc/pf.conf
|
pfctl -F all -f /etc/pf.conf
|
||||||
|
|
||||||
printf "\n%s" "${green}Strict mode enabled${end}"
|
printf "\n${green}%s${nc}\n" "Strict mode enabled"
|
||||||
EOF
|
EOF
|
||||||
chmod +x /usr/local/sbin/strict.sh
|
chmod +x /usr/local/sbin/strict.sh
|
||||||
```
|
```
|
||||||
@ -322,7 +322,7 @@ cat << "EOF" > /usr/local/sbin/trusted.sh
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
if [ "$(id -u)" != "0" ]; then
|
if [ "$(id -u)" != "0" ]; then
|
||||||
echo "This script must run as root"
|
printf "%s\n" "This script must run as root"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -332,10 +332,10 @@ function disable()
|
|||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
trap disable HUP INT QUIT TERM
|
trap disable INT
|
||||||
|
|
||||||
red=$'\e[1;31m'
|
red=$'\e[1;31m'
|
||||||
end=$'\e[0m'
|
nc=$'\e[0m'
|
||||||
|
|
||||||
# /usr/libexec/ApplicationFirewall/socketfilterfw --unblockapp /Applications/1Password\ 7.app
|
# /usr/libexec/ApplicationFirewall/socketfilterfw --unblockapp /Applications/1Password\ 7.app
|
||||||
# /usr/libexec/ApplicationFirewall/socketfilterfw --unblockapp /usr/local/Cellar/squid/4.8/sbin/squid
|
# /usr/libexec/ApplicationFirewall/socketfilterfw --unblockapp /usr/local/Cellar/squid/4.8/sbin/squid
|
||||||
@ -349,7 +349,7 @@ printf "\n"
|
|||||||
|
|
||||||
pfctl -F all -f /etc/pf.conf
|
pfctl -F all -f /etc/pf.conf
|
||||||
|
|
||||||
printf "\n%s\n\n" "${red}Trusted mode enabled (press ctrl+c to disable)${end}"
|
printf "\n${red}%s${nc}\n\n" "Trusted mode enabled (press ctrl+c to disable)"
|
||||||
|
|
||||||
while :
|
while :
|
||||||
do
|
do
|
||||||
@ -366,7 +366,7 @@ cat << "EOF" > /usr/local/sbin/disabled.sh
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
if [ "$(id -u)" != "0" ]; then
|
if [ "$(id -u)" != "0" ]; then
|
||||||
echo "This script must run as root"
|
printf "%s\n" "This script must run as root"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -376,14 +376,14 @@ function disable()
|
|||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
trap disable HUP INT QUIT TERM
|
trap disable INT
|
||||||
|
|
||||||
red=$'\e[1;31m'
|
red=$'\e[1;31m'
|
||||||
end=$'\e[0m'
|
nc=$'\e[0m'
|
||||||
|
|
||||||
pfctl -d
|
pfctl -d
|
||||||
|
|
||||||
printf "\n%s\n\n" "${red}Firewall disabled (press ctrl+c to enable)${end}"
|
printf "\n${red}%s${nc}\n\n" "Firewall disabled (press ctrl+c to enable)"
|
||||||
|
|
||||||
while :
|
while :
|
||||||
do
|
do
|
||||||
|
@ -21,7 +21,7 @@ Publication date: 2020-06-18T00:00:00.000Z
|
|||||||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
|
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Step 2: disable analytics
|
### Step 2: disable Homebrew analytics
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
brew analytics off
|
brew analytics off
|
||||||
|
@ -40,21 +40,21 @@ export LC_CTYPE=C
|
|||||||
dirname=`dirname "${BASH_SOURCE}"`
|
dirname=`dirname "${BASH_SOURCE}"`
|
||||||
|
|
||||||
# Spoof computer name
|
# Spoof computer name
|
||||||
model_name=`system_profiler SPHardwareDataType | awk '/Model Name/ {$1=$2=""; print $0}' | sed -e 's/^[ ]*//'`
|
|
||||||
first_name=`sed "$(jot -r 1 1 2048)q;d" $dirname/first_names.txt | sed -e 's/[^a-zA-Z]//g'`
|
first_name=`sed "$(jot -r 1 1 2048)q;d" $dirname/first_names.txt | sed -e 's/[^a-zA-Z]//g'`
|
||||||
computer_name=`echo "$first_name’s $model_name"`
|
model_name=`system_profiler SPHardwareDataType | awk '/Model Name/ {$1=$2=""; print $0}' | sed -e 's/^[ ]*//'`
|
||||||
|
computer_name="$first_name’s $model_name"
|
||||||
host_name=`echo $computer_name | sed -e 's/’//g' | sed -e 's/ /-/g'`
|
host_name=`echo $computer_name | sed -e 's/’//g' | sed -e 's/ /-/g'`
|
||||||
sudo scutil --set ComputerName "$computer_name"
|
sudo scutil --set ComputerName "$computer_name"
|
||||||
sudo scutil --set LocalHostName "$host_name"
|
sudo scutil --set LocalHostName "$host_name"
|
||||||
sudo scutil --set HostName "$host_name"
|
sudo scutil --set HostName "$host_name"
|
||||||
echo "Spoofed hostname to $host_name"
|
printf "%s\n" "Spoofed hostname to $host_name"
|
||||||
|
|
||||||
# Spoof MAC address of en0 interface
|
# Spoof MAC address of en0 interface
|
||||||
mac_address_prefix=`sed "$(jot -r 1 1 768)q;d" $dirname/mac_address_prefixes.txt | sed -e 's/[^A-F0-9:]//g'`
|
mac_address_prefix=`sed "$(jot -r 1 1 768)q;d" $dirname/mac_address_prefixes.txt | sed -e 's/[^A-F0-9:]//g'`
|
||||||
mac_address_suffix=`openssl rand -hex 3 | sed 's/\(..\)/\1:/g; s/.$//'`
|
mac_address_suffix=`openssl rand -hex 3 | sed 's/\(..\)/\1:/g; s/.$//'`
|
||||||
mac_address=`echo "$mac_address_prefix:$mac_address_suffix" | awk '{print toupper($0)}'`
|
mac_address=`echo "$mac_address_prefix:$mac_address_suffix" | awk '{print toupper($0)}'`
|
||||||
sudo ifconfig en0 ether "$mac_address"
|
sudo ifconfig en0 ether "$mac_address"
|
||||||
echo "Spoofed MAC address of en0 interface to $mac_address"
|
printf "%s\n" "Spoofed MAC address of en0 interface to $mac_address"
|
||||||
EOF
|
EOF
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user