- Understanding how uid and gid work in Docker containers Jan 2017
- Processes In Containers Should Not Run As Root Sept 2017
Prior to Docker supporting User Namespaces
| -- a quick LUA access script for nginx to check IP addresses against an | |
| -- `ip_blacklist` set in Redis, and if a match is found send a HTTP 403. | |
| -- | |
| -- allows for a common blacklist to be shared between a bunch of nginx | |
| -- web servers using a remote redis instance. lookups are cached for a | |
| -- configurable period of time. | |
| -- | |
| -- block an ip: | |
| -- redis-cli SADD ip_blacklist 10.1.1.1 | |
| -- remove an ip: |
| #!/bin/bash -i | |
| #using shebang with -i to enable interactive mode (auto load .bashrc) | |
| set -e #stop immediately if any error happens | |
| # Install Open SDK | |
| apt update | |
| apt install openjdk-8-jdk -y | |
| update-java-alternatives --set java-1.8.0-openjdk-amd64 | |
| java -version |
| import poplib | |
| import email | |
| from base64 import b64decode | |
| pop3_server = 'pop.gmail.com' | |
| pop3_port = '995' | |
| username = 'XXXXXXXXXX@gmail.com' | |
| password = 'XXXXXXXXXXXXXX' | |
| M = poplib.POP3_SSL(pop3_server, pop3_port) |
| 1) Install cloudflared using homebrew: | |
| brew install cloudflare/cloudflare/cloudflared | |
| 2) Create /usr/local/etc/cloudflared/config.yaml, with the following content | |
| proxy-dns: true | |
| proxy-dns-upstream: | |
| - https://1.1.1.1/dns-query | |
| - https://1.0.0.1/dns-query |
| events { | |
| worker_connections 1024; | |
| } | |
| http { | |
| # google's DNS server | |
| resolver 8.8.8.8; | |
| resolver_timeout 5s; | |
| server { | |
| # proxy server port |
Prior to Docker supporting User Namespaces
| #!/bin/bash | |
| set -e | |
| cf_ips() { | |
| echo "# https://www.cloudflare.com/ips" | |
| echo "geo \$realip_remote_addr \$cloudflare_ip {" | |
| echo "default 0;" | |
| for type in v4 v6; do |
Install Xquartz to get X11 support on MacOS. You can google Xquartz and download it from its official site, or install using HomeBrew.
brew cask install xquartzLaunch Xquartz. Go to Preference -> Security, click the box Allow connections from clients. NOTE: You have to lauch Xquartz with Allow connections from clients enable everytime you want to ssh to remote server with X11 forwarding support.
curl -v -X GET -H "range: bytes=1-8" http://localhost:8080/bbb/test
curl -v -X GET -H "range: bytes=10-" http://localhost:8080/bbb/test
| REGEDIT4 | |
| [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink] | |
| "Arial"="wqy-microhei.ttc" | |
| "Arial Black"="wqy-microhei.ttc" | |
| "Arial CE,238"="wqy-microhei.ttc" | |
| "Arial CYR,204"="wqy-microhei.ttc" | |
| "Arial Greek,161"="wqy-microhei.ttc" | |
| "Arial TUR,162"="wqy-microhei.ttc" | |
| "Courier New"="wqy-microhei.ttc" |