This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # Example using getopt (vs builtin getopts) that can also handle long options. | |
| # Another clean example can be found at: | |
| # http://www.bahmanm.com/blogs/command-line-options-how-to-parse-in-bash-using-getopt | |
| # | |
| aflag=n | |
| bflag=n |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ### | |
| # This is a code example showing how to use getops to parse short options and a | |
| # subcommand with short options of it's own. Based on Kevin Sookocheff's post: | |
| # https://sookocheff.com/post/bash/parsing-bash-script-arguments-with-shopts/ | |
| # | |
| # Please feel free to use it and modify it as you see fit. Any questions and/or | |
| # recommendations are more than welcome. | |
| ### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # Example of how to parse short/long options with 'getopt' | |
| # | |
| OPTS=`getopt -o vhns: --long verbose,dry-run,help,stack-size: -n 'parse-options' -- "$@"` | |
| if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi | |
| echo "$OPTS" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # インストールのやり方はこちらのサイトを参考にしました。 | |
| # http://blog.csdn.net/shile/article/details/54602768 | |
| ### まずはbashdbのインストール | |
| # osのバージョンを確認 | |
| [vagrant@daily bashdb-code]$ cat /etc/redhat-release | |
| CentOS release 6.7 (Final) | |
| # アーキテクチャ(OSが32bit, 64bitどちらなのか)を確認 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # 設定 | |
| API="http://www.vpngate.net/api/iphone/" | |
| msg_info(){ echo -e "${*}"; } | |
| # APIで取得したリストを読み込み | |
| #msg_info "Loading the list of server ..." | |
| CSV="$(curl -sL "${API}" | tr -d '\r')" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 37 03 00 110415233453 C11 | |
| 110415233416 | |
| ND20110415233435 NCN005 JD////////////// JN/// | |
| 251 N370 E1408 010 66 6+ RK66324 RT01/// RC13/// | |
| EBI 251 S6+6- ////// 11 300 S5+5- ////// 11 250 S5+5- ////// 11 | |
| 310 S0404 ////// 11 311 S0404 ////// 11 252 S0404 ////// 11 | |
| 301 S0404 ////// 11 221 S0404 ////// 01 340 S0404 ////// 01 | |
| 341 S0404 ////// 01 321 S0404 233455 00 331 S0404 233457 10 | |
| 350 S0404 233501 00 360 S0404 233508 00 243 S0403 ////// 01 | |
| 330 S0403 233454 00 222 S0403 233455 00 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin | |
| ### Thanks Xream's Work XD | |
| # if you don't have several vpn servers to select, you can comment following line | |
| # and use your openvpn config file name to replace "${host}.ovpn" in while loop. | |
| read -p "Select the host: " host |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'socket' | |
| # echo server | |
| Socket.udp_server_loop(4444) do |data, src| | |
| src.reply data | |
| end | |
| # client | |
| addr = Socket.sockaddr_in(4444, "localhost") | |
| socket = Socket.new(:INET, :DGRAM) | |
| begin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get -y install gcc g++ make cmake doxygen pandoc awk sed perl python3 python-is-python3 m4 bison flex lzip lcov git zlib1g-dev libssl-dev libnghttp2-dev autoconf autoconf-archive autogen automake autopoint libtool pkg-config texinfo nettle-dev libunistring-dev gettext make libbz2-dev libbrotli-dev libzstd-dev liblz-dev libpcre2-dev libmicrohttpd-dev libgpgme-dev liblzma-dev libgnutls28-dev libgcrypt20-dev git-merge-changelog libidn2-0 libpsl-dev # libpcre3-dev nettle-bin lzma brotli zstd lzip | |
| cd ~/Downloads | |
| mkdir wget-dev | |
| cd wget-dev | |
| git clone https://gitlab.com/rockdaboot/libhsts | |
| cd libhsts | |
| autoreconf -fi | |
| ./configure | |
| make |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ############################ | |
| ## Methods | |
| ############################ | |
| prefix_to_bit_netmask() { | |
| prefix=$1; | |
| shift=$(( 32 - prefix )); | |
| bitmask="" |