working on it ...

Filters

Explore Public Snippets

Sort by

Found 145 snippets matching: ppp

    public by lbottaro  3316  1  6  0

    Bash IP PPP interface status test

    This script test IP/PPP interface status on linux
    #!/bin/sh
    
    echo "======= TEST RUNNING ========"
    sleep $((60*15))
    IF0_STATE=`ifconfig ptp_040 | grep RUNNING | wc -l`
    IF1_STATE=`ifconfig ptp_041 | grep RUNNING | wc -l`
    if [ ${IF0_STATE} -eq 1 ] && [ ${IF1_STATE} -eq 1 ] ; then
      echo "PASSED!"
      # reboot
    else
      while [ 1 ]; do
        echo "FAILED IF0_STATE : ${IF0_STATE} IF1_STATE:${IF1_STATE}"
    	sleep 10
      done
    fi

    public by Martin508  1224  0  6  0

    Test2

    // Enter here the actual content of the snippet.            test
    data: lmkkk type char1.
    
    

    external by Gregory Pakosz  11  0  1  0

    VPN, ppp /etc/ppp/ip-up example script

    VPN, ppp /etc/ppp/ip-up example script: ip-up
    #!/bin/sh
    
    # /etc/ppp/ip-up example script
    # must have 0755 permissions
    # must be owned by root
    
    /sbin/route add -net 192.168.50 -interface $1
    
    

    external by makotom  45  0  1  0

    PPP peers in IIJ Osaka

    PPP peers in IIJ Osaka: iij-ppp.txt
    // Thu Aug 21 13:18:50 JST 2014
    # ping -c 1000 -f -s 1016 210.130.183.213
    PING 210.130.183.213 (210.130.183.213) 1016(1044) bytes of data.
    
    --- 210.130.183.213 ping statistics ---
    1000 packets transmitted, 1000 received, 0% packet loss, time 9592ms
    rtt min/avg/max/mdev = 8.802/9.910/37.049/2.863 ms, pipe 3, ipg/ewma 9.602/10.107 ms
    
    // Thu Aug 21 13:19:52 JST 2014
    # ping -c 1000 -f -s 1016 210.130.183.211
    PING 210.130.183.211 (210.130.183.211) 1016(1044) bytes of data.
    
    --- 210.130.183.211 ping statistics ---
    1000 packets transmitted, 1000 received, 0% packet loss, time 9351ms
    rtt min/avg/max/mdev = 8.787/9.359/35.829/1.308 ms, pipe 3, ipg/ewma 9.360/11.708 ms
    
    // Thu Aug 21 13:20:50 JST 2014
    # ping -c 1000 -f -s 1016 210.130.183.212
    PING 210.130.183.212 (210.130.183.212) 1016(1044) bytes of data.
    
    --- 210.130.183.212 ping statistics ---
    1000 packets transmitted, 1000 received, 0% packet loss, time 9939ms
    rtt min/avg/max/mdev = 8.816/10.080/23.294/2.001 ms, pipe 2, ipg/ewma 9.949/9.607 ms
    
    // Thu Aug 21 13:21:41 JST 2014
    # ping -c 1000 -f -s 1016 210.130.183.215
    PING 210.130.183.215 (210.130.183.215) 1016(1044) bytes of data.
    
    --- 210.130.183.215 ping statistics ---
    1000 packets transmitted, 1000 received, 0% packet loss, time 9802ms
    rtt min/avg/max/mdev = 8.818/9.838/21.035/1.321 ms, pipe 2, ipg/ewma 9.812/9.234 ms
    
    // Thu Aug 21 13:22:53 JST 2014
    # ping -c 1000 -f -s 1016 201.130.183.216
    PING 201.130.183.216 (201.130.183.216) 1016(1044) bytes of data.
    .
    --- 201.130.183.216 ping statistics ---
    1000 packets transmitted, 999 received, 0% packet loss, time 14578ms
    rtt min/avg/max/mdev = 166.288/169.807/196.821/4.340 ms, pipe 14, ipg/ewma 14.592/168.040 ms
    
    // Thu Aug 21 13:23:45 JST 2014
    # ping -c 1000 -f -s 1016 210.130.183.214
    PING 210.130.183.214 (210.130.183.214) 1016(1044) bytes of data.
    
    --- 210.130.183.214 ping statistics ---
    1000 packets transmitted, 1000 received, 0% packet loss, time 9160ms
    rtt min/avg/max/mdev = 8.777/9.090/11.799/0.196 ms, pipe 2, ipg/ewma 9.169/9.120 ms
    
    
    
    // Thu Aug 21 13:25:30 JST 2014
    # ping -c 1000 -f -s 1016 210.130.183.216
    PING 210.130.183.216 (210.130.183.216) 1016(1044) bytes of data.
    
    --- 210.130.183.216 ping statistics ---
    1000 packets transmitted, 1000 received, 0% packet loss, time 10858ms
    rtt min/avg/max/mdev = 10.277/10.931/25.552/0.742 ms, pipe 2, ipg/ewma 10.869/11.445 ms
    
    // Thu Aug 21 13:26:16 JST 2014
    # ping -c 1000 -f -s 1016 210.130.183.211
    PING 210.130.183.211 (210.130.183.211) 1016(1044) bytes of data.
    
    --- 210.130.183.211 ping statistics ---
    1000 packets transmitted, 1000 received, 0% packet loss, time 10745ms
    rtt min/avg/max/mdev = 8.809/11.336/26.497/3.399 ms, pipe 3, ipg/ewma 10.756/10.019 ms
    
    // Thu Aug 21 13:27:13 JST 2014
    # ping -c 1000 -f -s 1016 210.130.183.212
    PING 210.130.183.212 (210.130.183.212) 1016(1044) bytes of data.
    
    --- 210.130.183.212 ping statistics ---
    1000 packets transmitted, 1000 received, 0% packet loss, time 9475ms
    rtt min/avg/max/mdev = 8.812/9.508/45.209/1.683 ms, pipe 3, ipg/ewma 9.485/9.862 ms
    
    // Thu Aug 21 13:28:06 JST 2014
    # ping -c 1000 -f -s 1016 210.130.183.215
    PING 210.130.183.215 (210.130.183.215) 1016(1044) bytes of data.
    
    --- 210.130.183.215 ping statistics ---
    1000 packets transmitted, 1000 received, 0% packet loss, time 9986ms
    rtt min/avg/max/mdev = 8.801/10.080/18.800/1.525 ms, pipe 2, ipg/ewma 9.996/14.390 ms
    
    // Thu Aug 21 13:29:28 JST 2014
    # ping -c 1000 -f -s 1016 210.130.183.214
    PING 210.130.183.214 (210.130.183.214) 1016(1044) bytes of data.
    
    --- 210.130.183.214 ping statistics ---
    1000 packets transmitted, 1000 received, 0% packet loss, time 9150ms
    rtt min/avg/max/mdev = 8.724/9.084/12.704/0.252 ms, pipe 2, ipg/ewma 9.160/9.072 ms
    
    // Thu Aug 21 13:30:13 JST 2014
    # ping -c 1000 -f -s 1016 210.130.183.213
    PING 210.130.183.213 (210.130.183.213) 1016(1044) bytes of data.
    
    --- 210.130.183.213 ping statistics ---
    1000 packets transmitted, 1000 received, 0% packet loss, time 9815ms
    rtt min/avg/max/mdev = 8.827/9.832/20.178/1.040 ms, pipe 2, ipg/ewma 9.825/9.523 ms
    
    

    external by Marc Hanheide  22  0  1  0

    ssh-vpn via ppp (OSX)

    ssh-vpn via ppp (OSX): ssh.vpn.sh
    #
    # You will need to change these variables...
    #
    
    
    # The host name or IP address of the SSH server that we are
    # sending the connection request to:
    SERVER_HOSTNAME=harek
    
    # The username on the VPN server that will run the tunnel.
    # For security reasons, this should NOT be root.  (Any user
    # that can use PPP can intitiate the connection on the client)
    SERVER_USERNAME=marc
    
    # The VPN network interface on the server should use this address:
    SERVER_IFIPADDR=192.168.4.1
    
    # ...and on the client, this address:
    CLIENT_IFIPADDR=192.168.3.1
    
    
    # This tells ssh to use unprivileged high ports, even though it's
    # running as root.  This way, you don't have to punch custom holes
    # through your firewall.
    LOCAL_SSH_OPTS="-P"
    
    
    #
    # The rest of this file should not need to be changed.
    #
    
    
    
    PATH=/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/bin/X11/:
    
    #
    # required commands...
    #
    
    PPPD=/usr/sbin/pppd
    SSH=/usr/bin/ssh
    
    if ! test -f $PPPD  ; then echo "can't find $PPPD";  exit 3; fi
    if ! test -f $SSH   ; then echo "can't find $SSH";   exit 4; fi
    
    
    case "$1" in
      start)
        # echo -n "Starting vpn to $SERVER_HOSTNAME: "
        ${PPPD} nodetach noauth debug passive pty "${SSH} ${LOCAL_SSH_OPTS} ${SERVER_HOSTNAME} -l${SERVER_USERNAME} -o Batchmode=yes sudo ${PPPD} nodetach notty noauth" ipparam vpn ${CLIENT_IFIPADDR}:${SERVER_IFIPADDR}
        # echo "connected."
        ;;
    
      stop)
            # echo -n "Stopping vpn to $SERVER_HOSTNAME: "
            PID=`ps ax | grep "${SSH} ${LOCAL_SSH_OPTS} ${SERVER_HOSTNAME} -l${SERVER_USERNAME} -o" | grep -v ' passive ' | grep -v 'grep ' | awk '{print $1}'`
            PPPPID=`ps ax | grep "${PPPD} nodetach noauth debug passive pty"  | grep -v 'grep ' | awk '{print $1}'`
            if [ "${PID}" != "" ]; then
              kill $PID $PPPPID
              echo "disconnected."
            else
              echo "Failed to find PID for the connection"
            fi
        ;;
    
      config)
        echo "SERVER_HOSTNAME=$SERVER_HOSTNAME"
        echo "SERVER_USERNAME=$SERVER_USERNAME"
        echo "SERVER_IFIPADDR=$SERVER_IFIPADDR"
        echo "CLIENT_IFIPADDR=$CLIENT_IFIPADDR"
      ;;
    
      *)
        echo "Usage: vpn {start|stop|config}"
        exit 1
        ;;
    esac
    
    exit 0
    
    

    external by p120ph37  1544  0  4  0

    PPP VPN split-network/split-DNS script for OSX

    PPP VPN split-network/split-DNS script for OSX: ip-up
    #!/bin/sh
    ####################################################
    ##                                                ##
    ## PPP VPN split-network/split-DNS script for OSX ##
    ## by Aaron Meriwether                            ##
    ##                                                ##
    ## installation:                                  ##
    ## sudo cp thisfile /etc/ppp/ip-up                ##
    ## sudo chmod 755 /etc/ppp/ip-up                  ##
    ##                                                ##
    ####################################################
    
    ##################
    ## begin config...
    
    # Define per-VPN-server settings here...
    SERVERS[0]="vpn.example.org" # must match the server name set in Network Preferences.
    NETWORKS[0]="192.168.2.0/24 192.168.3.0/24" # only networks besides the VPN LAN itself!
    DOMAINS[0]="example.org" # domains which should use the VPN's DNS resolver when connected.
    
    SERVERS[1]="vpn.mit.edu"
    NETWORKS[1]="" # an empty network list is acceptable if you are only interested in the DNS aspects
    DOMAINS[1]="staff.mit.edu athena.mit.edu"
    
    SERVERS[2]="vpn.rogers.com"
    NETWORKS[2]="172.16.7.128/25 205.150.67.0/24"
    DOMAINS[2]="" # likewise, an empty DNS list is acceptable if you are only interested in the network aspects
    
    # set to /dev/null if you object to debugging output.
    DEBUGFILE=/tmp/ip-up-debug.txt
    
    ## end config...
    #################
    
    
    # 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 tty device name
    #       $3      the tty 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
    #               (when used with a VPN configured via Network Preferences,
    #                $6 seems to contain the IP address of the gateway over
    #                which the VPN traffic passes.  This might be useful in
    #                ip-up scripts which need to avoid breaking the route
    #                used by pppd itself.)
    
    PATH=/usr/bin:/bin:/usr/sbin:/sbin
    
    # Generic array operation.
    # e.g.: indexOf "something" "${myArray[@]}"
    # note the double quotes around the array and the use of [@] not [*]
    indexOf() {
      local s="$1"; shift; local a=( "$@" ) i
      for (( i = 0; i < ${#@}; i++ )); do
        if [ "${a[$i]}" == "$s" ]; then echo $i; return; fi
      done
    }
    
    # Given an interface name, find the corresponding scutil service key.
    if2service() {
      local i
      for i in $(echo "list State:/Network/Service/[^/]+/PPP" | scutil | cut -d/ -f4); do
        if [ "$(echo show State:/Network/Service/$i/PPP | scutil | grep InterfaceName | cut -d' ' -f5)" == "$1" ]; then echo $i; return; fi
      done
    }
    
    # Given a network service key (specifically a PPP service), get the server name (as set in Network Preferences).
    getPppServerName() {
      echo show Setup:/Network/Service/$1/PPP | scutil | grep CommRemoteAddress | cut -d' ' -f5
    }
    
    echo "$(date +'%Y-%m-%d %T %Z') $0 1=$1 2=$2 3=$3 4=$4 5=$5 6=$6" >> $DEBUGFILE
    SERVICE="$(if2service $1)"
    echo "Service: $SERVICE" >> $DEBUGFILE
    SERVER="$(getPppServerName $SERVICE)"
    echo "Server Name: $SERVER" >> $DEBUGFILE
    i=$(indexOf "$SERVER" "${SERVERS[@]}")
    if [ -z "$i" ]; then
      echo "No special configuration found for this VPN server." >> $DEBUGFILE
      exit
    fi
    
    if [ -n "$(echo show State:/Network/Service/$SERVICE/IPv4 | scutil | grep OverridePrimary)" ]; then
      echo "Clearing the 'Send all traffic over VPN connection' flag" >> $DEBUGFILE
      scutil <<-END
    	get State:/Network/Service/$SERVICE/IPv4
    	d.remove OverridePrimary
    	set State:/Network/Service/$SERVICE/IPv4
    	END
    fi
    
    if [ -n "${NETWORKS[$i]}" ]; then
      for n in ${NETWORKS[$i]}; do
        echo "Adding route for network $n" >> $DEBUGFILE
        route -n add -net $n $5
      done
    fi
    
    if [ -n "${DOMAINS[$i]}" ]; then
      echo "Limiting DNS over the VPN to these domains: ${DOMAINS[$i]}"
      scutil <<-END
    	get State:/Network/Service/$SERVICE/DNS
    	d.add SupplementalMatchDomains * ${DOMAINS[$i]}
    	set State:/Network/Service/$SERVICE/DNS
    	END
    fi
    
    

    external by Github  11  0  1  0

    PPP 15-07

    PPP 15-07: PPP-15-07
    ###page 3 (about neopoly)
    
    * ...originally founded **in** 1998.  ~~The company~~ **Located in Bochum, Germany, we focus** on the conceptual work and development of ~~all kinds of~~ online games...  
    * ~~We believe in...the company~~ - I would remove these two sentences completely.  It sounds too much like Mr. Burns.
    *  Neopoly **realizes** tailor-made solutions for clients world-wide **including** ESPN, ...
    
    ###page 5 (development)
    
    * ~~all kinds of~~ browser-based online games with an emphasis on ~~games with~~ real-time interaction.  
    
    ###page 7 (tech. spec: hosting)
     
     * Due to the fact that we are **usually** hosting...
    
    ###page 8 (tech. spec: config)
    
    * ~~Databases replicates....is possible~~ **Automatic database replication to a failsafe system is possible**
    
    ###page 9 (trivia games)
    
    * **Users** choose a quiz...
    * Players receive points for every correct **answer**, unused time/jokers ...
    * Multilingual (e.g. English, German, French, **Italian**)
    * **Constructed** for many kinds of sports
    * Prizes may be covert... [not sure what you mean here - prizes go undercover?]
    * **Users** can share content...
    
    ###page 11 (classic predictor games) 
    
    * Prizes may be covert... [see above] 
    * Many ~~of~~ bet-options possible
    
    ###page 13 (streak predictor games)
    
    * The user can bet **on** sports matches...
    * Many ~~of~~ bet-options possible
    * Prizes may be covert... [see above]
    * **Users** can share content...
    
    ###page 15 (fantasy manager)
    
    * **Users** are entitled...
    * **Constructed** for many kinds of sports
    * Prizes may be covert... [see above]
    * **Users** can share content...
    
    ###page 17 (trading card games)
    
    * **Constructed** for many kinds of sports
    * **Users** can share content...
    
    ###page 19 (virtual sticker albums)
    
    * **Users** collect real and virtual **stickers** to *meet the content* and complete... [what do you mean by *meet the content*?]
    * **Constructed** for many kinds of sports
    * **Users** can share content...
    
    
    

    external by billautomata  11  0  1  0

    ppp over serial

    ppp over serial: example.sh
    # on host A
    # sudo pppd [options] myip:destip /dev/usb baudrate
    # sudo pppd proxyarp mtu 1280 persist nodeflate noauth lcp-echo-interval 10 crtscts lock HOST_A_IP:HOST_B_IP /dev/ttyusb baud_rate
    
    
    sudo pppd proxyarp mtu 1280 persist nodeflate noauth lcp-echo-interval 10 crtscts lock 10.10.1.2:10.10.1.1 /dev/ttyUSB0 57600
    
    # on host B
    sudo pppd proxyarp mtu 1280 persist nodeflate noauth lcp-echo-interval 10 crtscts lock 10.10.1.1:10.10.1.2 /dev/ttyUSB1 57600
    
    # on host A
    ping 10.10.1.1
    
    # on host A
    ping 10.10.1.2
    
    

    external by Alexandr  607  0  3  0

    Monit config to monitor and keep alive ppp connection

    Monit config to monitor and keep alive ppp connection: etc_monit_conf.d_local
    set mailserver localhost
    set daemon 120 with start delay 240
    set logfile syslog facility log_daemon
    set httpd port 2812
        allow localhost
    
    set alert noreply@example.com
    
    check host internet with address 80.254.111.254
        if failed icmp type echo count 5 with timeout 30 seconds
            then exec "/usr/bin/killall pppd"
    
    check process pppd with pidfile /var/run/ppp0.pid
        start program = "/usr/bin/pon dsl-provider"
        stop  program = "/usr/bin/poff dsl-provider"
    
    
    

    external by Github  524  0  3  0

    TreeNode sample from the PPP book by Robert C. Martin

    TreeNode sample from the PPP book by Robert C. Martin: gistfile1.cs
    using System;
    public class TreeMap
    {
        private TreeMapNode topNode = null;
    
        public void Add(IComparable key, object value)
        {
            if (topNode == null)
                topNode = new TreeMapNode(key, value);
            else
                topNode.Add(key, value);
        }
    
        public object Get(IComparable key)
        {
            return topNode == null ? null : topNode.Find(key);
        }
    
        internal class TreeMapNode
        {
            private static readonly int LESS = 0;
            private static readonly int GREATER = 1;
            private IComparable key;
            private object value;
    
            private TreeMapNode[] nodes = new TreeMapNode[2];
    
            public TreeMapNode(IComparable key, object value)
            {
                this.key = key;
                this.value = value;
            }
    
            public object Find(IComparable key)
            {
                if (key.CompareTo(this.key) == 0) return value;
                return FindSubNodeForKey(SelectSubNode(key), key);
            }
    
            private int SelectSubNode(IComparable key)
            {
                return (key.CompareTo(this.key) < 0) ? LESS : GREATER;
            }
    
            private object FindSubNodeForKey(int node, IComparable key)
            {
                return nodes[node] == null ? null : nodes[node].Find(key);
            }
    
            public void Add(IComparable key, object value)
            {
                if (key.CompareTo(this.key) == 0)
                    this.value = value;
                else
                    AddSubNode(SelectSubNode(key), key, value);
            }
    
            private void AddSubNode(int node, IComparable key, object value)
            {
                if (nodes[node] == null)
                    nodes[node] = new TreeMapNode(key, value);
                else
                    nodes[node].Add(key, value);
            }
        }
    }
    
    
    • Public Snippets
    • Channels Snippets