- C-a == Ctrl-a
- M-a == Alt-a
:q close
:w write/saves
:wa[!] write/save all windows [force]
:wq write/save and close
#NOTE: Redirect to HTTPS | |
server { | |
listen 80; | |
listen [::]:80; | |
server_name example.com; | |
return 301 https://example.com$request_uri; | |
} | |
server { | |
listen 443 ssl; |
; Start a new pool named 'www'. | |
; the variable $pool can we used in any directive and will be replaced by the | |
; pool name ('www' here) | |
[www] | |
; Per pool prefix | |
; It only applies on the following directives: | |
; - 'slowlog' | |
; - 'listen' (unixsocket) | |
; - 'chroot' |
#!/bin/bash | |
# Bash shell script for generating self-signed certs. Run this in a folder, as it | |
# generates a few files. Large portions of this script were taken from the | |
# following artcile: | |
# | |
# http://usrportage.de/archives/919-Batch-generating-SSL-certificates.html | |
# | |
# Additional alterations by: Brad Landers | |
# Date: 2012-01-27 |
#!/bin/sh | |
mkdir -p ~/.vim/syntax | |
echo "au BufRead,BufNewFile /etc/nginx/*,/usr/local/nginx/conf/* if &ft == '' | setfiletype nginx | endif" > ~/.vim/filetype.vim | |
wget -O ~/.vim/syntax/nginx.vim http://www.vim.org/scripts/download_script.php?src_id=19394 |
require 'time' | |
require 'forecast_io' | |
require 'curb' | |
phant_public_key = '---' | |
phant_private_key = '---' | |
location = ['45.2912', '-122.4037'] | |
#NOTE: This script is intended to be ran on a Cron schedule. | |
ForecastIO.configure do |configuration| | |
configuration.api_key = '---' |
#include <ESP8266WiFi.h> | |
#include <ESP8266WebServer.h> | |
#include <OneWire.h> | |
const char* ssid = "wifi"; | |
const char* password = "password"; | |
const long pollTempInterval = 10000; | |
String displayedTempF = "n/a"; | |
unsigned long previousMillisTemp; |
#include <OneWire.h> | |
#include "ESP8266WiFi.h" | |
#include <Phant.h> | |
//NOTE: Do your configuration here: | |
const char* ssid = "Your-wifi-ssid"; | |
const char* password = "your-wifi-password"; | |
//NOTE: interval is in milliseconds | |
const long sendInterval = 600000; | |
const char PhantHost[] = "data.sparkfun.com"; | |
const char PublicKey[] = "public-key-from-sparkfun"; |
-- Measure temperature and post data to thingspeak.com | |
-- 2014 OK1CDJ | |
--- Tem sensor DS18B20 is conntected to GPIO0 | |
--- 2015.01.21 sza2 temperature value concatenation bug correction | |
http = require('http') | |
pin = 4 | |
ow.setup(pin) | |
counter=0 | |
lasttemp=-999 |
#NOTE: gem install blinkstick first | |
require "blinkstick" | |
def cycle_colors(blinkstick) | |
percentages = [0,0,0] | |
cycle = 1 | |
while true do | |
sleep(0.01) | |
if percentages.first <= 100 && cycle.odd? | |
percentages = percentages.map {|a| a+1} |