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/sh | |
| # Download a list of exit-nodes | |
| wget -qO- https://check.torproject.org/torbulkexitlist | sort | awk '{print "" $1 " 1;"}' > /tmp/tor_exit_list.txt | |
| # Prepare a geoip config | |
| echo -e "geo \$isTor {\ndefault 0; \n$(cat /tmp/tor_exit_list.txt) \n}" > /etc/nginx/conf.d/deny-geoip-tor.conf | |
| ## Add to virtual host | |
| # location / { | |
| # if ($isTor) { | |
| # return 403; |
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
| !.gitignore | |
| !.htaccess | |
| !.htpasswd | |
| %20../ | |
| %2e%2e//google.com | |
| %2e%2e;/test | |
| %3f/ | |
| %C0%AE%C0%AE%C0%AF | |
| %EXT% | |
| %ext%.bak |
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
| # setup | |
| # export ANSIBLE_HOSTS=~/.ansible/hosts | |
| # https://gist.github.com/runeleaf/5721014 | |
| - hosts: develop | |
| user: kawashima | |
| sudo: yes | |
| tasks: | |
| - include: centos/system-setup.yml | |
| - include: centos/install-common-item.yml | |
| - include: centos/install-add-item.yml |
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
| -i :inventory file | |
| -u list_of_server :username for remote login for the list_of_servers | |
| -m :runs the moudle name and gives the output | |
| -a :shell arguments to run on the remote machine ex: ls, docker ps, etc | |
| -f : specify the number of parallel process to run\ | |
| -B : run asynchronously, failing after X | |
| Modules: |
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
| --- | |
| ############################################################################### | |
| # | |
| # GLOBAL Config: ansible/inventory/group_vars/all/pki.yml | |
| # | |
| ############################################################################### | |
| # Enable staging env during development | |
| #pki_acme_ca: 'le-staging-v2' |
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
| deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse | |
| deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse | |
| deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse | |
| deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse | |
| deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse | |
| deb-src http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse | |
| deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse |
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
| Ansible playbook to setup HTTPS using Let's encrypt on nginx. | |
| The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS. | |
| The server pass A rating on [SSL Labs](https://www.ssllabs.com/). | |
| To use: | |
| 1. Install [Ansible](https://www.ansible.com/) | |
| 2. Setup an Ubuntu 16.04 server accessible over ssh | |
| 3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain | |
| 4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder) |
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
| ssh -vo ProxyCommand='ssh -W %h:%p root@proxy_host' root@dst_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
| # Deps | |
| sed -i "s|# deb-src|deb-src|" /etc/apt/sources.list | |
| apt update | |
| export DEPS=" \ | |
| build-essential zlib1g-dev libpcre3-dev unzip uuid-dev \ | |
| debhelper po-debconf libexpat-dev libgd-dev libgeoip-dev libhiredis-dev \ | |
| libluajit-5.1-dev libmhash-dev libpam0g-dev libperl-dev libssl-dev libxslt1-dev quilt" | |
| apt install -y $DEPS | |
| # NXG Pagespeed |
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
| --- | |
| - name: Compile NGINX from sources | |
| hosts: webserver | |
| vars: | |
| nginx_version: nginx-1.13.4 | |
| nginx_tarball_url: "http://nginx.org/download/{{ nginx_version }}.tar.gz" | |
| nginx_install_dir: "/tmp/{{ nginx_version }}" | |
| nginx_sbin_path: "/usr/sbin/nginx" | |
| nginx_conf_path: "/etc/nginx/nginx.conf" |