Why?
Because we wanted to achive the following while developing a webapp using websockets:
Static serving (nginx), Django application (gunicorn) and Websockets service (twisted)
- on the same IP
| #!/bin/sh | |
| IPT="/sbin/iptables" #Iptable's path | |
| #Network interfaces : | |
| interface=eth0 # Internet | |
| start() { | |
| ### DELETE ALL ENTRIES ### | |
| $IPT -F |
| # rsyslog v5 configuration file | |
| #### MODULES #### | |
| $ModLoad imuxsock # provides support for local system logging (e.g. via logger command) | |
| $ModLoad imklog # provides kernel logging support (previously done by rklogd) | |
| #$ModLoad immark # provides --MARK-- message capability | |
| # Provides UDP syslog reception | |
| $ModLoad imudp |
| type T struct { | |
| A int | |
| B string | |
| } | |
| t := T{23, "skidoo"} | |
| s := reflect.ValueOf(&t).Elem() | |
| typeOfT := s.Type() | |
| for i := 0; i < s.NumField(); i++ { |
| package main | |
| import ( | |
| "log" | |
| "net" | |
| "os" | |
| "os/signal" | |
| "sync" | |
| "syscall" | |
| "time" |
| #!/usr/bin/env bash | |
| # Step 1: Fill in EMAIL, TOKEN, DOMAIN and SUBDOMAIN. Your API token is here: https://dash.cloudflare.com/profile/api-tokens | |
| # Make sure the token is the Global token, or has these permissions: #zone:read, #dns_record:read, #dns_records:edit | |
| # If you want to set the root domain instead of a subdomain, set SUBDOMAIN to "@" | |
| # Step 2: Create an A record on Cloudflare with the subdomain you chose | |
| # Step 3: Run "./ddns.sh -l" to get the zone_id and rec_id of the record you created. | |
| # Fill in ZONE_ID and REC_ID below | |
| # This step is optional, but will save you 2 requests every time you run this script | |
| # Step 4: Run "./ddns.sh". It should tell you that record was updated or that it didn't need updating. |
| # Basically the nginx configuration I use at konklone.com. | |
| # I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com | |
| # | |
| # To provide feedback, please tweet at @konklone or email [email protected]. | |
| # Comments on gists don't notify the author. | |
| # | |
| # Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites. | |
| # Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration. | |
| server { |
People
:bowtie: |
π :smile: |
π :laughing: |
|---|---|---|
π :blush: |
π :smiley: |
:relaxed: |
π :smirk: |
π :heart_eyes: |
π :kissing_heart: |
π :kissing_closed_eyes: |
π³ :flushed: |
π :relieved: |
π :satisfied: |
π :grin: |
π :wink: |
π :stuck_out_tongue_winking_eye: |
π :stuck_out_tongue_closed_eyes: |
π :grinning: |
π :kissing: |
π :kissing_smiling_eyes: |
π :stuck_out_tongue: |
| # installs to /opt/gradle | |
| # existing versions are not overwritten/deleted | |
| # seamless upgrades/downgrades | |
| # $GRADLE_HOME points to latest *installed* (not released) | |
| gradle_version=2.9 | |
| wget -N https://services.gradle.org/distributions/gradle-${gradle_version}-all.zip | |
| sudo unzip -foq gradle-${gradle_version}-all.zip -d /opt/gradle | |
| sudo ln -sfn gradle-${gradle_version} /opt/gradle/latest | |
| sudo printf "export GRADLE_HOME=/opt/gradle/latest\nexport PATH=\$PATH:\$GRADLE_HOME/bin" > /etc/profile.d/gradle.sh | |
| . /etc/profile.d/gradle.sh |
| ################################## | |
| # WORDPRESS NGINX CONFIGURATIONS | |
| ################################## | |
| # /etc/nginx/wordpress.conf | |
| # | |
| # Contains a common configuration for use by nginx on a WordPress | |
| # installation. This file should be included in any WordPress site | |
| # nginx virtual host config located in sites-available with the following line: | |
| # | |
| # include /etc/nginx/wordpress.config; |