This line will replace the last octet of ipv4 adresses in a given file with a zero:
sed -i '' -e 's/(([0-9]{1,3}.){3})[0-9]{1,3}/\10/g'
| # THIS DOCKERFILE TRIES TO COMPILE CURL FOR ANDROID x86 ARCH | |
| # Description - http://vitiy.info/dockerfile-example-to-compile-libcurl-for-android-inside-docker-container/ | |
| FROM ubuntu | |
| MAINTAINER Victor Laskin "[email protected]" | |
| # Install compilation tools | |
| RUN apt-get update && apt-get install -y \ |
| #include <errno.h> | |
| #include <netdb.h> | |
| #include <netinet/in.h> | |
| #include <arpa/inet.h> | |
| #include <stdio.h> | |
| #include <string.h> | |
| int main(int argc, char *argv[]) { | |
| struct in_addr ip; | |
| struct hostent *hp; |
This line will replace the last octet of ipv4 adresses in a given file with a zero:
sed -i '' -e 's/(([0-9]{1,3}.){3})[0-9]{1,3}/\10/g'
| #!/usr/bin/env python | |
| import sys | |
| if len(sys.argv) < 2: | |
| print "Enter IP address as first argument: python %s 127.0.0.1"%sys.argv[0] | |
| sys.exit(1) | |
| ip = sys.argv[1] | |
| ips = ip.split('.') | |
| iph = '0x{:02X}.0x{:02X}.0x{:02X}.0x{:02X}'.format(*map(int, ips)) |
| # The following example shows a way to use iptables for basic round-robin load balancing, by redirecting | |
| # packets two one of three ports based on a statistic counter. | |
| # | |
| # TCP packets for new sessions arriving on port 9000 will rotate between ports 9001, 9002 and 9003, where | |
| # three identical copies of some application are expected to be listening. | |
| # | |
| # Packets that aren't TCP or that related to an already-established connection are left untouched, letting | |
| # the standard iptables connection tracking machinery send it to the appropriate port. | |
| # | |
| # For this to work well, connections need to be relatively short. Ideally there would be an extra layer |
| #!/usr/bin/env gawk -f | |
| BEGIN { id = 0; | |
| cmd = "gzip -c -2"; | |
| ext = ".gz"; | |
| file = sprintf("%04d%s",id, ext); | |
| print "Opening new file " file " at " NR " rows"; | |
| count = 1000000; | |
| } | |
| # Use pipes |
| ProductID Database | |
| 106 GeoIP.dat | |
| 111 GeoIPOrg.dat | |
| 112/115 GeoIPRegion.dat | |
| 117 GeoIPASNum.dat | |
| 119 GeoIPUserType.dat | |
| 121/122 GeoIPISP.dat | |
| 132/133 GeoIPCity.dat | |
| 135 GeoIPAreaCode.dat | |
| 137 GeoIPDMACode.dat |
| #!/usr/bin/env python | |
| # | |
| # Example 1: All blocks in list.txt, one CIDR per line | |
| # cat list.txt | cidr.py | |
| # | |
| # Example 2: Echo CIDR blocks to stdout | |
| # echo 1.2.3.0/25 1.2.3.128/25 | cidr.py | |
| import sys | |
| from netaddr import * |
No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.
Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.
| #!/bin/bash | |
| #Usage: ./stun.sh [email protected] [Destination port] [Local port (optional)] | |
| DESTINATION=$1 | |
| DEST_PORT=$2 | |
| PROXY_PORT=$((RANDOM%10000+10000)) | |
| #Set local port to same as remote if unset |