nix 在OS X中为特定网站设置VPN。基于此文章:http://archives.aidanfindlater.com/blog/2010/02/03/use-vpn-for-specifi

在OS X中为特定网站设置VPN。基于此文章:http://archives.aidanfindlater.com/blog/2010/02/03/use-vpn-for-specific-sites-on-mac-os -x /将“ip-up”文件/内容添加到“/ etc / ppp”下面。然后“chmod a + x / etc / ppp / ip-up”。

ip-up.nix
#!/bin/bash
#
# Script which handles the routing issues as necessary for pppd.
# When the ppp link comes up, this script is called with the following
# parameters:
#       $1      the interface name used by pppd (e.g. ppp3)
#       $2      the codey device name
#       $3      the codey device speed
#       $4      the local IP address for the interface
#       $5      the remote IP address
#       $6      the parameter specified by the 'ipparam' option to pppd
#

## Routing setup for VPN

# Array of IP addresses of the VPN server(s)
# I have it grab the list of round-robin'ed IP addresses based on the domain name
VPN_HOSTS=$(dig +short inside.mcgill.ca)

# Array of hostns to route for
# These are the domain names and IP addresses that will be accessed through the VPN
VPN_ROUTE_FOR_HOSTS=(www.elsevier.com www.sciencedirect.com www.thelancet.com www.cmaj.ca scholar.google.com ncbi.nlm.nih.gov bmj.com)

# Make sure we're in the VPN
for i in ${VPN_HOSTS[@]} ; do if [[ $i == ${5:-} ]] ; then
    
    # Add the routes
    for k in ${VPN_ROUTE_FOR_HOSTS[@]} ; do
        for l in $(dig +short $k) ; do
                /sbin/route add -host $l -interface $1
        done
    done
    
fi ; done

nix 最大的前10个文件/目录

最大的前10个文件/目录

new_gist_file.nix
du -a /var | sort -n -r | head -n 10
new.nix
for i in G M K; do du -ah | grep [0-9]$i | sort -nr -k 1; done | head -n 11