Error message when offline.

Error message when offline.

#!/usr/bin/env ruby

# TODO (later): Don't force tokens for methods that don't need them.
# TODO (maybe): DBG=ruby/curl/off. Curl would output curl commands.

############
# Helpers. #
############

def log(message)
  STDERR.puts("\x1B[1;30m~ #{message}\x1B[0m") unless ENV['DBG'] == 'off'
end

def dbg(command, arguments, **options)
  log "Terminal.#{command}(" +
    ("#{arguments.inspect[1..-2]}" unless arguments.empty?).to_s +
    (", #{options.inspect[1..-2]}" unless options.empty?).to_s +
    ")\n"
end

def try_highlight_syntax(json)
  CodeRay.scan(json, :json).term
rescue
  json
end

def print_as_json(data)
  json = JSON.pretty_generate(data)
  puts try_highlight_syntax(json)
end

def api_call(command, arguments, options)
  # Ruby **args expansion doesn't work as I expected, that's why the extra if.
  # pry(main)> def xxx(*args) args; end
  # pry(main)> xxx(**{})
  # => [{}]
  if options
    dbg command, arguments, options
    print_as_json Terminal.send(command, *arguments, **options)
  else
    dbg command, arguments
    print_as_json Terminal.send(command, *arguments)
  end
end

def usage
  if File.exist?(File.expand_path('../docs/help.txt', __dir__))
    # Running locally.
    puts File.read(File.expand_path('../docs/help.txt', __dir__))
  else
    # RubyGems installation.
    spec = Gem::Specification.find_by_name('terminal.com')
    puts File.read(File.join(spec.gem_dir, 'docs', 'help.txt'))
  end
end

#########
# Main. #
#########

require File.expand_path('../../lib/terminal.com', __FILE__)
require 'json'

begin
  require 'coderay'
rescue LoadError
  log "CodeRay is not installed. Syntax highlighting won't be available."
end

# -h | --help
if ARGV.include?('-h') || ARGV.include?('--help')
  puts usage; exit
end

if ARGV.first == 'configure'
  puts <<-EOF
Welcome to the Terminal.com CLI client.

We don't want to bother you with asking for credentials every single time,
so instead we'll ask you for them now and save them to ~/.terminal.com.json.

Alright?

Go to https://www.terminal.com/settings/api

And:
  EOF

  print "1. Paste your user token here: "
  user_token = STDIN.readline.chomp
  print "2. Generate an access token if you don't have one and paste it here: "
  access_token = STDIN.readline.chomp

  File.open(File.expand_path('~/.terminal.com.json'), 'w') do |file|
    file.puts({user_token: user_token, access_token: access_token}.to_json)
  end

  puts "\nYour tokens were saved to ~/.terminal.com.json."
  exit
end

# Tokens.
# TODO: Add --no-config
if File.exist?(File.expand_path('~/.terminal.com.json'))
  config = JSON.parse(File.read(File.expand_path('~/.terminal.com.json')))
  user_token, access_token = config.values_at('user_token', 'access_token')

  if user_token.nil?
    abort("Config file found, but user_token is missing. Add user_token key.")
  end

  if access_token.nil?
    abort("Config file found, but access_token is missing. Add access_token key.")
  end
else
  user_token, access_token = ARGV.shift(2)

  if user_token.nil? || access_token.nil?
    STDERR.puts("Credentials missing.\n\n")
    abort usage
  end
end

if ARGV.empty?
  STDERR.puts("Command missing.\n\n")
  abort usage
else
  command = ARGV.shift

  unless Terminal.respond_to?(command)
    STDERR.puts("Invalid command '#{command}'.\n\n")
    abort usage
  end

  # Not every method requires authentication.
  method_args = Terminal.method(command).parameters.map(&:last)

  if method_args.include?(:options)
    options = ARGV.reduce(Hash.new) do |buffer, argument|
      if argument.match(/^--(.+)=(.+)$/)
        buffer[$1.to_sym] = $2
      elsif argument.match(/^--no-(.+)$/)
        buffer[$1.to_sym] = false
      elsif argument.match(/^--(.+)$/)
        buffer[$1.to_sym] = true
      end

      buffer
    end

    ARGV.delete_if { |argument| argument.start_with?('--') }
  end

  arguments = []
  arguments << user_token if method_args.include?(:user_token)
  arguments << access_token if method_args.include?(:access_token)
  arguments.push(*ARGV)

  begin
    api_call(command, arguments, options)
  rescue Terminal::NetworkError
    abort "It seems that you're offline."
  end
end

#!/usr/bin/env ruby

# TODO (later): Don't force tokens for methods that don't need them.
# TODO (maybe): DBG=ruby/curl/off. Curl would output curl commands.

############
# Helpers. #
############

def log(message)
  STDERR.puts("\x1B[1;30m~ #{message}\x1B[0m") unless ENV['DBG'] == 'off'
end

def dbg(command, arguments, **options)
  log "Terminal.#{command}(" +
    ("#{arguments.inspect[1..-2]}" unless arguments.empty?).to_s +
    (", #{options.inspect[1..-2]}" unless options.empty?).to_s +
    ")\n"
end

def try_highlight_syntax(json)
  CodeRay.scan(json, :json).term
rescue
  json
end

def print_as_json(data)
  json = JSON.pretty_generate(data)
  puts try_highlight_syntax(json)
end

def api_call(command, arguments, options)
  # Ruby **args expansion doesn't work as I expected, that's why the extra if.
  # pry(main)> def xxx(*args) args; end
  # pry(main)> xxx(**{})
  # => [{}]
  if options
    dbg command, arguments, options
    print_as_json Terminal.send(command, *arguments, **options)
  else
    dbg command, arguments
    print_as_json Terminal.send(command, *arguments)
  end
end

def usage
  if File.exist?(File.expand_path('../docs/help.txt', __dir__))
    # Running locally.
    puts File.read(File.expand_path('../docs/help.txt', __dir__))
  else
    # RubyGems installation.
    spec = Gem::Specification.find_by_name('terminal.com')
    puts File.read(File.join(spec.gem_dir, 'docs', 'help.txt'))
  end
end

#########
# Main. #
#########

require File.expand_path('../../lib/terminal.com', __FILE__)
require 'json'

begin
  require 'coderay'
rescue LoadError
  log "CodeRay is not installed. Syntax highlighting won't be available."
end

# -h | --help
if ARGV.include?('-h') || ARGV.include?('--help')
  puts usage; exit
end

if ARGV.first == 'configure'
  puts <<-EOF
Welcome to the Terminal.com CLI client.

We don't want to bother you with asking for credentials every single time,
so instead we'll ask you for them now and save them to ~/.terminal.com.json.

Alright?

Go to https://www.terminal.com/settings/api

And:
  EOF

  print "1. Paste your user token here: "
  user_token = STDIN.readline.chomp
  print "2. Generate an access token if you don't have one and paste it here: "
  access_token = STDIN.readline.chomp

  File.open(File.expand_path('~/.terminal.com.json'), 'w') do |file|
    file.puts({user_token: user_token, access_token: access_token}.to_json)
  end

  puts "\nYour tokens were saved to ~/.terminal.com.json."
  exit
end

# Tokens.
# TODO: Add --no-config
if File.exist?(File.expand_path('~/.terminal.com.json'))
  config = JSON.parse(File.read(File.expand_path('~/.terminal.com.json')))
  user_token, access_token = config.values_at('user_token', 'access_token')

  if user_token.nil?
    abort("Config file found, but user_token is missing. Add user_token key.")
  end

  if access_token.nil?
    abort("Config file found, but access_token is missing. Add access_token key.")
  end
else
  user_token, access_token = ARGV.shift(2)

  if user_token.nil? || access_token.nil?
    STDERR.puts("Credentials missing.\n\n")
    abort usage
  end
end

if ARGV.empty?
  STDERR.puts("Command missing.\n\n")
  abort usage
else
  command = ARGV.shift

  unless Terminal.respond_to?(command)
    STDERR.puts("Invalid command '#{command}'.\n\n")
    abort usage
  end

  # Not every method requires authentication.
  method_args = Terminal.method(command).parameters.map(&:last)

  if method_args.include?(:options)
    options = ARGV.reduce(Hash.new) do |buffer, argument|
      if argument.match(/^--(.+)=(.+)$/)
        buffer[$1.to_sym] = $2
      elsif argument.match(/^--no-(.+)$/)
        buffer[$1.to_sym] = false
      elsif argument.match(/^--(.+)$/)
        buffer[$1.to_sym] = true
      end

      buffer
    end

    ARGV.delete_if { |argument| argument.start_with?('--') }
  end

  arguments = []
  arguments << user_token if method_args.include?(:user_token)
  arguments << access_token if method_args.include?(:access_token)
  arguments.push(*ARGV)

  api_call(command, arguments, options)
end


removed misnamed file

removed misnamed file

from bs4 import BeautifulSoup
import re
import urllib2
import csv

main_page = 'http://www.urbanspoon.com'

restaurants = '/lb/23/best-restaurants-Pittsburgh'

numPages = 1

## List that contains urls to each restaurant
placeList = []

## Iterate over the number of pages specified above. Each page has 15 results on it.
for i in range(numPages):

    print "Collecting content from url: " + restaurants

    ## Send http request to url and receive response
    page = urllib2.urlopen(main_page + restaurants)

    ## Convert http response to text
    soup = BeautifulSoup(page)

    ## Isolate search results which are contained in

    results = soup.findAll('section','restaurant-results')

    for result in results:
        hrefs = result.findAll('a',href=True)

        for href in hrefs:
            if '/lb/23/best-restaurants-Pittsburgh' in href['href']:
                restaurants = href['href']
            else:
                placeList.append(main_page + href['href'])

## Lists to hold comment data
date = []
author = []
entityID = []
entity = []
commentID = []
comment = []
commentTitle = []
sentiment = []

## Iterate over each restaurant's URL in placeList (list of URLs) and collect reviews from each one
for place in placeList:

    print "Collecting Reviews from: " + place

    restaurantURL = urllib2.urlopen(place)
    soup2 = BeautifulSoup(restaurantURL)

    reviews = soup2.findAll('li','comment review')

    for review in reviews:
        ## Grab unix timestampe from data-date attribute in <li class="comment review"
        date_val = review['data-date']

        ##
        authorID = review['data-user']
        author_val = review.find('a',{'href':'/u/profile/' + authorID},text=True).getText()

        ## Get restaurant id and name
        entityID_val = re.findall(r'\d+',place)[1]
        getEntity = soup2.find('title').getText().split(' - ')[0].strip()
        entity_val = getEntity.encode('utf-8')

        ## Get Review information
        reviewID_val = review['data-comment'].strip()
        reviewTitle_val = review.find('div','title',text=True).getText().encode('utf-8')
        review_val = review.find('div','body').getText().encode('utf-8')

        ## Append data to lists
        date.append(date_val)
        author.append(author_val)
        entityID.append(entityID_val)
        entity.append(entity_val)
        commentID.append(reviewID_val)
        comment.append(review_val)
        commentTitle.append(reviewTitle_val)
        sentiment.append(None)

with open('reviews.csv','wb') as csvfile:
    csvwriter = csv.writer(csvfile, delimiter='\t')

    ## Write header
    csvwriter.writerow(['Date','Author','entityID','Entity Name','ReviewID','Review Title','Review','Sentiment'])

    for i in range(len(date)):
        csvwriter.writerow([date[i],author[i],entityID[i],entity[i],commentID[i],comment[i],commentTitle[i],sentiment[i]])


update MRAN production Nginx config file with new paths for Jenkins

#mran.revolutionanalytics.com
#Chris Mosetick 2014-06-12
#last update    2014-11-12

server {
        #listen on IPv4 and IPv6 addresses at the same time
        listen 80;
        listen [::]:80;

        #directory in the file system to serve web pages and packages from
        root /home/mran-user/jenkins/workspace/production-MRAN-build/dist;
        index index.html index.htm;

        # public facing domain name for this vhost
        server_name mran.revolutionanalytics.com;

	access_log /var/log/nginx/mran.revolutionanalytics.com.log;
	error_log /var/log/nginx/error-mran.revolutionanalytics.com.log;

	#define error page parameters here
        error_page 404 /404/index.html;
        #prevent loading error pages directly
        location  /404/index.html { internal; }

      #send blogs that link to old location to current location
      rewrite ^/documents/rro/open$ http://mran.revolutionanalytics.com/open permanent;

      location /packagedata {
              alias /home/mran-user/jenkins/workspace/production-gen-pkg-data/packagedata;
              allow all;
      }

        location /snapshot {
		#snapshots is directory containing symlinks to various .zfs/snapshot dirs
                try_files $uri $uri/ =404;
                #autoindex is needed since we are not serving up any html or php pages
                autoindex  on;
		autoindex_localtime off;
        }

	location /src/contrib/Archive {
                try_files $uri $uri/ =404;
                #autoindex is needed since we are not serving up any html or php pages
                autoindex  on;
                autoindex_localtime off;
        }

        location /metadata {
                try_files $uri $uri/ =404;
                autoindex on;

        }

        location /diffs {
                try_files $uri $uri/ =404;
                autoindex on;
        }

        location /accounting {
                try_files $uri $uri/ =404;
                autoindex on;
        }

        location /history {
		try_files $uri $uri/ =404;
                autoindex on;
                #history is symlink pointing to snapshots of the /MRAN/www FS itself
                #this URL is hidden right now, not on index.html
        }

        location /exports {
		try_files $uri $uri/ =404;
        	autoindex on;
		#exports is symlink to zpool named exports
	      }

}
#this last bracket is needed to close this vhost

#mran.revolutionanalytics.com
#Chris Mosetick 2014-06-12
#last update    2014-10-07

server {
        #listen on IPv4 and IPv6 addresses at the same time
        listen 80;
        listen [::]:80;

        #directory in the file system to serve web pages and packages from
        #this is a detachable block disk formatted with ZFS that can be easily moved to another server
        #www dir is for landing page stuff
        #root /MRAN/www;
        root /home/mran-user/src/MRAN-site/dist;
        index index.html index.htm;

        # public facing domain name for this vhost
        server_name mran.revolutionanalytics.com;

	access_log /var/log/nginx/mran.revolutionanalytics.com.log;
	error_log /var/log/nginx/error-mran.revolutionanalytics.com.log;

        #define the location of the Nodejs instance running on this system
        #location / {
        #proxy_pass http://localhost:7300/;
        #proxy_set_header Host $host;
        #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        #}

	#define error page parameters here
        error_page 404 /404/index.html;
        #prevent loading error pages directly
        location  /404/index.html { internal; }

        location /snapshot {
		#snapshots is directory containing symlinks to various .zfs/snapshot dirs
                try_files $uri $uri/ =404;
                #autoindex is needed since we are not serving up any html or php pages
                autoindex  on;
		autoindex_localtime off;
        }

	location /src/contrib/Archive {
                try_files $uri $uri/ =404;
                #autoindex is needed since we are not serving up any html or php pages
                autoindex  on;
                autoindex_localtime off;
        }

        location /metadata {
                try_files $uri $uri/ =404;
                autoindex on;

        }

        location /diffs {
                try_files $uri $uri/ =404;
                autoindex on;
        }

        location /accounting {
                try_files $uri $uri/ =404;
                autoindex on;
        }

        location /history {
		try_files $uri $uri/ =404;
                autoindex on;
                #history is symlink pointing to snapshots of the /MRAN/www FS itself
                #this URL is hidden right now, not on index.html
        }

        location /exports {
		try_files $uri $uri/ =404;
        	autoindex on;
		#exports is symlink to zpool named exports
	      }

}
#this last bracket is needed to close this vhost


Delete 2016-09-07-tusharjoshi1.com

Delete 2016-09-07-tusharjoshi1.com

---
layout: post
title: tusharjoshi1.com
category: project
---

The goal of this project was to create a simple website where people can get to know me. I wanted to show my ongoing projects as well as inititives I've been a part of.

This page was created using Jekyll and hosted on a github page.

Let me know what you think!

Authored by: T.Joshi


Remove include directive in ssl.example.com

To include the SSL related directives in the port 80 server block seems to be redundant.
Because we are redirecting explicit all incoming traffic via port 80 to the HTTPS host on
port 443 where only the *secure-connection-magic* is happen.

Maybe I am missing something, but I tested the configuration
under the following system and encountered no negative side effects:

**Server**
* Ubuntu 14.04 LTS
* Nginx 1.7.7 mainline

**Client**
* OS X 10.9.5
* Browser: FF 33, Chrome 38, Safari 7

# Choose between www and non-www, listen on the *wrong* one and redirect to
# the right one -- http://wiki.nginx.org/Pitfalls#Server_Name
#
server {
  listen [::]:80;
  listen 80;

  # listen on both hosts
  server_name example.com www.example.com;

  # and redirect to the https host (declared below)
  # avoiding http://www -> https://www -> https:// chain.
  return 301 https://example.com$request_uri;
}

server {
  listen [::]:443 ssl spdy;
  listen 443 ssl spdy;

  # listen on the wrong host
  server_name www.example.com;

  include h5bp/directive-only/ssl.conf;

  # and redirect to the non-www host (declared below)
  return 301 https://example.com$request_uri;
}

server {
  listen [::]:443 ssl spdy;
  listen 443 ssl spdy;

  # The host name to respond to
  server_name example.com;

  include h5bp/directive-only/ssl.conf;

  # Path for static files
  root /var/www/example.com/public;

  #Specify a charset
  charset utf-8;

  # Custom 404 page
  error_page 404 /404.html;

  # Include the basic h5bp config set
  include h5bp/basic.conf;
}

# Choose between www and non-www, listen on the *wrong* one and redirect to
# the right one -- http://wiki.nginx.org/Pitfalls#Server_Name
#
server {
  listen [::]:80;
  listen 80;

  # listen on both hosts
  server_name example.com www.example.com;

  include h5bp/directive-only/ssl.conf;

  # and redirect to the https host (declared below)
  # avoiding http://www -> https://www -> https:// chain.
  return 301 https://example.com$request_uri;
}

server {
  listen [::]:443 ssl spdy;
  listen 443 ssl spdy;

  # listen on the wrong host
  server_name www.example.com;

  include h5bp/directive-only/ssl.conf;

  # and redirect to the non-www host (declared below)
  return 301 https://example.com$request_uri;
}

server {
  listen [::]:443 ssl spdy;
  listen 443 ssl spdy;

  # The host name to respond to
  server_name example.com;

  include h5bp/directive-only/ssl.conf;

  # Path for static files
  root /var/www/example.com/public;

  #Specify a charset
  charset utf-8;

  # Custom 404 page
  error_page 404 /404.html;

  # Include the basic h5bp config set
  include h5bp/basic.conf;
}


Add missing semicolons in `ssl.example.com`

Close h5bp/server-configs-nginx#52.

# Choose between www and non-www, listen on the *wrong* one and redirect to
# the right one -- http://wiki.nginx.org/Pitfalls#Server_Name
#
server {
  listen 80;

  # listen on both hosts
  server_name example.com www.example.com;

  include h5bp/direcive-only/ssl.conf;

  # and redirect to the https host (declared below)
  # avoiding http://www -> https://www -> https:// chain.
  return 301 https://example.com$request_uri;
}

server {
  listen 443 ssl spdy;

  # listen on the wrong host
  server_name www.example.com;

  include h5bp/direcive-only/ssl.conf;

  # and redirect to the non-www host (declared below)
  return 301 https://example.com$request_uri;
}

server {
  listen 443 ssl spdy;

  # The host name to respond to
  server_name example.com;

  include h5bp/direcive-only/ssl.conf;

  # Path for static files
  root /sites/example.com/public;

  #Specify a charset
  charset utf-8;

  # Custom 404 page
  error_page 404 /404.html;

  # Include the basic h5bp config set
  include h5bp/basic.conf;
}

# Choose between www and non-www, listen on the *wrong* one and redirect to
# the right one -- http://wiki.nginx.org/Pitfalls#Server_Name
#
server {
  listen 80;

  # listen on both hosts
  server_name example.com www.example.com;

  include h5bp/direcive-only/ssl.conf

  # and redirect to the https host (declared below)
  # avoiding http://www -> https://www -> https:// chain.
  return 301 https://example.com$request_uri;
}

server {
  listen 443 ssl spdy;

  # listen on the wrong host
  server_name www.example.com;

  include h5bp/direcive-only/ssl.conf

  # and redirect to the non-www host (declared below)
  return 301 https://example.com$request_uri;
}

server {
  listen 443 ssl spdy;

  # The host name to respond to
  server_name example.com;

  include h5bp/direcive-only/ssl.conf

  # Path for static files
  root /sites/example.com/public;

  #Specify a charset
  charset utf-8;

  # Custom 404 page
  error_page 404 /404.html;

  # Include the basic h5bp config set
  include h5bp/basic.conf;
}


Apparently, test/testtsa.com was only half done

$!
$! A few very basic tests for the 'ts' time stamping authority command.
$!
$
$	__arch := VAX
$	if f$getsyi("cpu") .ge. 128 then -
	   __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
$	if __arch .eqs. "" then __arch := UNK
$	exe_dir := sys$disk:[-.'__arch'.exe.apps]
$
$	openssl := mcr 'f$parse(exe_dir+"openssl.exe")'
$	OPENSSL_CONF := [-]CAtsa.cnf
$	! Because that's what ../apps/CA.sh really looks at
$	SSLEAY_CONFIG = "-config " + OPENSSL_CONF
$
$ error:
$	subroutine
$		write sys$error "TSA test failed!"
$		exit 3
$	endsubroutine
$
$ setup_dir:
$	subroutine
$
$		if f$search("tsa.dir") .nes ""
$		then
$			@[-.util]deltree [.tsa]*.*
$ 			set file/prot=(S:RWED,O:RWED,G:RWED,W:RWED) tsa.dir;*
$ 			delete tsa.dir;*
$		endif
$
$		create/dir [.tsa]
$		set default [.tsa]
$	endsubroutine
$
$ clean_up_dir:
$	subroutine
$
$		set default [-]
$		@[-.util]deltree [.tsa]*.*
$ 		set file/prot=(S:RWED,O:RWED,G:RWED,W:RWED) tsa.dir;*
$ 		delete tsa.dir;*
$	endsubroutine
$
$ create_ca:
$	subroutine
$
$		write sys$output "Creating a new CA for the TSA tests..."
$		TSDNSECT = "ts_ca_dn"
$		openssl req -new -x509 -nodes -
			-out tsaca.pem -keyout tsacakey.pem
$		if $severity .ne. 1 then call error
$	endsubroutine
$
$ create_tsa_cert:
$	subroutine
$
$		INDEX=p1
$		EXT=p2
$		TSDNSECT = "ts_cert_dn"
$
$		openssl req -new -
			-out tsa_req'INDEX'.pem -keyout tsa_key'INDEX'.pem
$		if $severity .ne. 1 then call error
$
$		write sys$output "Using extension ''EXT'"
$		openssl x509 -req -
			-in tsa_req'INDEX'.pem -out tsa_cert'INDEX'.pem -
			"-CA" tsaca.pem "-CAkey" tsacakey.pem "-CAcreateserial" -
			-extfile 'OPENSSL_CONF' -extensions "''EXT'"
$		if $severity .ne. 1 then call error
$	endsubroutine
$
$ print_request:
$	subroutine
$
$		openssl ts -query -in 'p1' -text
$	endsubroutine
$
$ create_time_stamp_request1: subroutine
$
$		openssl ts -query -data [-]testtsa.com -policy tsa_policy1 -
			-cert -out req1.tsq
$		if $severity .ne. 1 then call error
$	endsubroutine
$
$ create_time_stamp_request2: subroutine
$
$		openssl ts -query -data [-]testtsa.com -policy tsa_policy2 -
			-no_nonce -out req2.tsq
$		if $severity .ne. 1 then call error
$	endsubroutine
$
$ create_time_stamp_request3: subroutine
$
$		openssl ts -query -data [-]CAtsa.cnf -no_nonce -out req3.tsq
$		if $severity .ne. 1 then call error
$	endsubroutine
$
$ print_response:
$	subroutine
$
$		openssl ts -reply -in 'p1' -text
$		if $severity .ne. 1 then call error
$	endsubroutine
$
$ create_time_stamp_response:
$	subroutine
$
$		openssl ts -reply -section 'p3' -queryfile 'p1' -out 'p2'
$		if $severity .ne. 1 then call error
$	endsubroutine
$
$ time_stamp_response_token_test:
$	subroutine
$
$		RESPONSE2:='p2'.copy_tsr
$		TOKEN_DER:='p2'.token_der
$		openssl ts -reply -in 'p2' -out 'TOKEN_DER' -token_out
$		if $severity .ne. 1 then call error
$		openssl ts -reply -in 'TOKEN_DER' -token_in -out 'RESPONSE2'
$		if $severity .ne. 1 then call error
$		backup/compare 'RESPONSE2' 'p2'
$		if $severity .ne. 1 then call error
$		openssl ts -reply -in 'p2' -text -token_out
$		if $severity .ne. 1 then call error
$		openssl ts -reply -in 'TOKEN_DER' -token_in -text -token_out
$		if $severity .ne. 1 then call error
$		openssl ts -reply -queryfile 'p1' -text -token_out
$		if $severity .ne. 1 then call error
$	endsubroutine
$
$ verify_time_stamp_response:
$	subroutine
$
$		openssl ts -verify -queryfile 'p1' -in 'p2' -
			"-CAfile" tsaca.pem -untrusted tsa_cert1.pem
$		if $severity .ne. 1 then call error
$		openssl ts -verify -data 'p3' -in 'p2' -
			"-CAfile" tsaca.pem -untrusted tsa_cert1.pem
$		if $severity .ne. 1 then call error
$	endsubroutine
$
$ verify_time_stamp_token:
$	subroutine
$
$		! create the token from the response first
$		openssl ts -reply -in 'p2' -out 'p2'.token -token_out
$		if $severity .ne. 1 then call error
$		openssl ts -verify -queryfile 'p1' -in 'p2'.token -token_in -
			"-CAfile" tsaca.pem -untrusted tsa_cert1.pem
$		if $severity .ne. 1 then call error
$		openssl ts -verify -data 'p3' -in 'p2'.token -token_in -
			"-CAfile" tsaca.pem -untrusted tsa_cert1.pem
$		if $severity .ne. 1 then call error
$	endsubroutine
$
$ verify_time_stamp_response_fail:
$	subroutine
$
$		openssl ts -verify -queryfile 'p1' -in 'p2' -
			"-CAfile" tsaca.pem -untrusted tsa_cert1.pem
$		! Checks if the verification failed, as it should have.
$		if $severity .eq. 1 then call error
$		write sys$output "Ok"
$	endsubroutine
$
$	! Main body ----------------------------------------------------------
$
$	write sys$output "Setting up TSA test directory..."
$	call setup_dir
$
$	write sys$output "Creating CA for TSA tests..."
$	call create_ca
$
$	write sys$output "Creating tsa_cert1.pem TSA server cert..."
$	call create_tsa_cert 1 "tsa_cert"
$
$	write sys$output "Creating tsa_cert2.pem non-TSA server cert..."
$	call create_tsa_cert 2 "non_tsa_cert"
$
$	write sys$output "Creating req1.req time stamp request for file testtsa..."
$	call create_time_stamp_request1
$
$	write sys$output "Printing req1.req..."
$	call print_request req1.tsq
$
$	write sys$output "Generating valid response for req1.req..."
$	call create_time_stamp_response req1.tsq resp1.tsr tsa_config1
$
$	write sys$output "Printing response..."
$	call print_response resp1.tsr
$
$	write sys$output "Verifying valid response..."
$	call verify_time_stamp_response req1.tsq resp1.tsr [-]testtsa.com
$
$	write sys$output "Verifying valid token..."
$	call verify_time_stamp_token req1.tsq resp1.tsr [-]testtsa.com
$
$	! The tests below are commented out, because invalid signer certificates
$	! can no longer be specified in the config file.
$
$	! write sys$output "Generating _invalid_ response for req1.req..."
$	! call create_time_stamp_response req1.tsq resp1_bad.tsr tsa_config2
$
$	! write sys$output "Printing response..."
$	! call print_response resp1_bad.tsr
$
$	! write sys$output "Verifying invalid response, it should fail..."
$	! call verify_time_stamp_response_fail req1.tsq resp1_bad.tsr
$
$	write sys$output "Creating req2.req time stamp request for file testtsa..."
$	call create_time_stamp_request2
$
$	write sys$output "Printing req2.req..."
$	call print_request req2.tsq
$
$	write sys$output "Generating valid response for req2.req..."
$	call create_time_stamp_response req2.tsq resp2.tsr tsa_config1
$
$	write sys$output "Checking '-token_in' and '-token_out' options with '-reply'..."
$	call time_stamp_response_token_test req2.tsq resp2.tsr
$
$	write sys$output "Printing response..."
$	call print_response resp2.tsr
$
$	write sys$output "Verifying valid response..."
$	call verify_time_stamp_response req2.tsq resp2.tsr [-]testtsa.com
$
$	write sys$output "Verifying response against wrong request, it should fail..."
$	call verify_time_stamp_response_fail req1.tsq resp2.tsr
$
$	write sys$output "Verifying response against wrong request, it should fail..."
$	call verify_time_stamp_response_fail req2.tsq resp1.tsr
$
$	write sys$output "Creating req3.req time stamp request for file CAtsa.cnf..."
$	call create_time_stamp_request3
$
$	write sys$output "Printing req3.req..."
$	call print_request req3.tsq
$
$	write sys$output "Verifying response against wrong request, it should fail..."
$	call verify_time_stamp_response_fail req3.tsq resp1.tsr
$
$	write sys$output "Cleaning up..."
$	call clean_up_dir
$
$	exit

$!
$! A few very basic tests for the 'ts' time stamping authority command.
$!
$
$	__arch := VAX
$	if f$getsyi("cpu") .ge. 128 then -
	   __arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
$	if __arch .eqs. "" then __arch := UNK
$	exe_dir := sys$disk:[-.'__arch'.exe.apps]
$
$	openssl := mcr 'f$parse(exe_dir+"openssl.exe")'
$	OPENSSL_CONF := [-]CAtsa.cnf
$	! Because that's what ../apps/CA.sh really looks at
$	SSLEAY_CONFIG = "-config " + OPENSSL_CONF
$
$ error:
$	subroutine
$		write sys$error "TSA test failed!"
$		exit 3
$	endsubroutine
$
$ setup_dir:
$	subroutine
$
$		if f$search("tsa.dir") .nes ""
$		then
$			@[-.util]deltree [.tsa]*.*
$ 			set file/prot=(S:RWED,O:RWED,G:RWED,W:RWED) tsa.dir;*
$ 			delete tsa.dir;*
$		endif
$
$		create/dir [.tsa]
$		set default [.tsa]
$	endsubroutine
$
$ clean_up_dir:
$	subroutine
$
$		set default [-]
$		@[-.util]deltree [.tsa]*.*
$ 		set file/prot=(S:RWED,O:RWED,G:RWED,W:RWED) tsa.dir;*
$ 		delete tsa.dir;*
$	endsubroutine
$
$ create_ca:
$	subroutine
$
$		write sys$output "Creating a new CA for the TSA tests..."
$		@[--.util]deltree [.demoCA]*.*
$
$		open/write file VMStsa-response.create_ca
$		write file ""
$		write file "HU"
$		write file "Budapest"
$		write file "Budapest"
$		write file "Gov-CA Ltd."
$		write file "ca1"
$		close file
$		open/read sys$ca_input VMStsa-response.create_ca
$		@[--.apps]CA.com -input sys$ca_input -newca
$		save_severity = $severity
$		close sys$ca_input
$		if save_severity .ne. 1 then call error
$	endsubroutine
$
$ create_tsa_cert:
$	subroutine
$
$		INDEX=p1
$		EXT=p2
$		open/write file VMStsa-response1.create_tsa_cert
$		write file "HU"
$		write file "Budapest"
$		write file "Buda"
$		write file "Hun-TSA Ltd."
$		write file "tsa",INDEX
$		close file
$		define/user sys$input VMStsa-response.create_tsa_cert
$		openssl req -new -
			-out tsa_req'INDEX'.pem -keyout tsa_key'INDEX'.pem
$		if $severity .ne. 1 then call error
$
$		open/write file VMStsa-response2.create_tsa_cert
$		write file "y"
$		write file "y"
$		close file
$		define/user sys$input VMStsa-response.create_tsa_cert
$		openssl ca -in tsa_req'INDEX'.pem -out tsa_cert'INDEX'.pem -
			-extensions "''EXT'"
$		if $severity .ne. 1 then call error
$	endsubroutine
$
$ print_request:
$	subroutine
$
$		openssl ts -query -in 'p1' -text
$	endsubroutine
$
$ create_time_stamp_request1: subroutine
$
$		openssl ts -query -data [-]testtsa.com -policy tsa_policy1 -
			-cert -out req1.tsq
$		if $severity .ne. 1 then call error
$	endsubroutine
$
$ create_time_stamp_request2: subroutine
$
$		openssl ts -query -data [-]testtsa.com -policy tsa_policy2 -
			-no_nonce -out req2.tsq
$		if $severity .ne. 1 then call error
$	endsubroutine
$
$ create_time_stamp_request3: subroutine
$
$		openssl ts -query -data [-]CAtsa.cnf -no_nonce -out req3.tsq
$		if $severity .ne. 1 then call error
$	endsubroutine
$
$ print_response:
$	subroutine
$
$		openssl ts -reply -in 'p1' -text
$		if $severity .ne. 1 then call error
$	endsubroutine
$
$ create_time_stamp_response:
$	subroutine
$
$		openssl ts -reply -section 'p3' -queryfile 'p1' -out 'p2'
$		if $severity .ne. 1 then call error
$	endsubroutine
$
$ time_stamp_response_token_test:
$	subroutine
$
$		RESPONSE2:='p2'.copy_tsr
$		TOKEN_DER:='p2'.token_der
$		openssl ts -reply -in 'p2' -out 'TOKEN_DER' -token_out
$		if $severity .ne. 1 then call error
$		openssl ts -reply -in 'TOKEN_DER' -token_in -out 'RESPONSE2'
$		if $severity .ne. 1 then call error
$		backup/compare 'RESPONSE2' 'p2'
$		if $severity .ne. 1 then call error
$		openssl ts -reply -in 'p2' -text -token_out
$		if $severity .ne. 1 then call error
$		openssl ts -reply -in 'TOKEN_DER' -token_in -text -token_out
$		if $severity .ne. 1 then call error
$		openssl ts -reply -queryfile 'p1' -text -token_out
$		if $severity .ne. 1 then call error
$	endsubroutine
$
$ verify_time_stamp_response:
$	subroutine
$
$		openssl ts -verify -queryfile 'p1' -in 'p2' -
			-CAfile [.demoCA]cacert.pem -untrusted tsa_cert1.pem
$		if $severity .ne. 1 then call error
$		openssl ts -verify -data 'p3' -in 'p2' -
			-CAfile [.demoCA]cacert.pem -untrusted tsa_cert1.pem
$		if $severity .ne. 1 then call error
$	endsubroutine
$
$ verify_time_stamp_token:
$	subroutine
$
$		# create the token from the response first
$		openssl ts -reply -in 'p2' -out 'p2'.token -token_out
$		if $severity .ne. 1 then call error
$		openssl ts -verify -queryfile 'p1' -in 'p2'.token -token_in \
			-CAfile [.demoCA]cacert.pem -untrusted tsa_cert1.pem
$		if $severity .ne. 1 then call error
$		openssl ts -verify -data 'p3' -in 'p2'.token -token_in \
			-CAfile [.demoCA]cacert.pem -untrusted tsa_cert1.pem
$		if $severity .ne. 1 then call error
$	endsubroutine
$
$ verify_time_stamp_response_fail:
$	subroutine
$
$		openssl ts -verify -queryfile 'p1' -in 'p2' -
			-CAfile [.demoCA]cacert.pem -untrusted tsa_cert1.pem
$		# Checks if the verification failed, as it should have.
$		if $severity .ne. 1 then call error
$		write sys$output "Ok"
$	endsubroutine
$
$	! Main body ----------------------------------------------------------
$
$	write sys$output "Setting up TSA test directory..."
$	call setup_dir
$
$	write sys$output "Creating CA for TSA tests..."
$	call create_ca
$
$	write sys$output "Creating tsa_cert1.pem TSA server cert..."
$	call create_tsa_cert 1 tsa_cert
$
$	write sys$output "Creating tsa_cert2.pem non-TSA server cert..."
$	call create_tsa_cert 2 non_tsa_cert
$
$	write sys$output "Creating req1.req time stamp request for file testtsa..."
$	call create_time_stamp_request1
$
$	write sys$output "Printing req1.req..."
$	call print_request req1.tsq
$
$	write sys$output "Generating valid response for req1.req..."
$	call create_time_stamp_response req1.tsq resp1.tsr tsa_config1
$
$	write sys$output "Printing response..."
$	call print_response resp1.tsr
$
$	write sys$output "Verifying valid response..."
$	call verify_time_stamp_response req1.tsq resp1.tsr ../testtsa
$
$	write sys$output "Verifying valid token..."
$	call verify_time_stamp_token req1.tsq resp1.tsr ../testtsa
$
$	! The tests below are commented out, because invalid signer certificates
$	! can no longer be specified in the config file.
$
$	! write sys$output "Generating _invalid_ response for req1.req..."
$	! call create_time_stamp_response req1.tsq resp1_bad.tsr tsa_config2
$
$	! write sys$output "Printing response..."
$	! call print_response resp1_bad.tsr
$
$	! write sys$output "Verifying invalid response, it should fail..."
$	! call verify_time_stamp_response_fail req1.tsq resp1_bad.tsr
$
$	write sys$output "Creating req2.req time stamp request for file testtsa..."
$	call create_time_stamp_request2
$
$	write sys$output "Printing req2.req..."
$	call print_request req2.tsq
$
$	write sys$output "Generating valid response for req2.req..."
$	call create_time_stamp_response req2.tsq resp2.tsr tsa_config1
$
$	write sys$output "Checking '-token_in' and '-token_out' options with '-reply'..."
$	call time_stamp_response_token_test req2.tsq resp2.tsr
$
$	write sys$output "Printing response..."
$	call print_response resp2.tsr
$
$	write sys$output "Verifying valid response..."
$	call verify_time_stamp_response req2.tsq resp2.tsr ../testtsa
$
$	write sys$output "Verifying response against wrong request, it should fail..."
$	call verify_time_stamp_response_fail req1.tsq resp2.tsr
$
$	write sys$output "Verifying response against wrong request, it should fail..."
$	call verify_time_stamp_response_fail req2.tsq resp1.tsr
$
$	write sys$output "Creating req3.req time stamp request for file CAtsa.cnf..."
$	call create_time_stamp_request3
$
$	write sys$output "Printing req3.req..."
$	call print_request req3.tsq
$
$	write sys$output "Verifying response against wrong request, it should fail..."
$	call verify_time_stamp_response_fail req3.tsq resp1.tsr
$
$	write sys$output "Cleaning up..."
$	call clean_up_dir
$
$	exit


Update letote.com

Update letote.com

Le Tote
player.vimeo.com/video/53684873
2013-08-26
Your closet. Expanded.

- Complete your profile and define your style by selecting items that you love.
- Your tote arrives at your doorstep with 3 garments and 2 accessories.
- When you're ready for your next tote, use the pre-paid bag to send everything back. We take care of the cleaning and shipping.
- Once we receive the box from you, your next tote is sent out immediately. Do this as many times a month as you like.

Le Tote
player.vimeo.com/video/53684873
2013-08-26
Your closet. Expanded.

Complete your profile and define your style by selecting items that you love.

Your tote arrives at your doorstep with 3 garments and 2 accessories.

When you're ready for your next tote, use the pre-paid bag to send everything back. We take care of the cleaning and shipping.

Once we receive the box from you, your next tote is sent out immediately. Do this as many times a month as you like.


wtf even is this

wtf even is this

    // for example:
    needle = "503156ed28bd192807008bbb";

    win = function () {
      alert("sweet!");
    };

    failure = function () {
      alert("zomg wtfffff");
    };

    $.ajax({
      url: "http://haystack.githubapp.com/needles/" + needle + ".txt",
      success: win,
      error: failure
    });


git-svn-id: https://www.imagemagick.org/subversion/ImageMagick/trunk@1039 aa41f4f7-0bf4-0310-aa73-e5a19afd5a74

$!
$! Make ImageMagick image coders for VMS.
$!
$
$ define/nolog MAGICK [-.magick]
$ define/nolog WAND [-.wand]
$if (f$trnlnm("X11") .eqs. "") then define/nolog X11 decw$include:
$compile_options="/nodebug/optimize"
$if (f$search("sys$system:decc$compiler.exe") .nes. "")
$then     ! VAX with DEC C
$  compile_options="/decc/nodebug/optimize/warning=(disable=rightshiftovr)"
$else     ! VAX with VAX C
$define/nolog lnk$library sys$library:vaxcrtl
$define/nolog sys sys$share
$endif
$if (f$getsyi("HW_MODEL") .gt. 1023)
$then     ! Alpha with DEC C
$  define/nolog sys decc$library_include
$  compile_options="/nodebug/optimize/prefix=all/warning=(disable=rightshiftovr)/name=(as_is,short)/float=ieee"
$endif
$
$
$write sys$output "Making Coders..."
$call Make art.c
$call Make avs.c
$call Make bmp.c
$call Make braille.c
$call Make cals.c
$call Make caption.c
$call Make cip.c
$call Make clip.c
$call Make clipboard.c
$call Make cmyk.c
$call Make cut.c
$call Make dcm.c
$call Make dds.c
$call Make dib.c
$call Make dng.c
$call Make dps.c
$call Make dpx.c
$call Make emf.c
$call Make ept.c
$call Make exr.c
$call Make fax.c
$call Make fits.c
$call Make fpx.c
$call Make gif.c
$call Make gradient.c
$call Make gray.c
$call Make hald.c
$call Make histogram.c
$call Make hrz.c
$call Make html.c
$call Make icon.c
$call Make info.c
$call Make inline.c
$call Make ipl.c
$call Make jbig.c
$call Make jpeg.c
$call Make jp2.c
$call Make label.c
$call Make map.c
$call Make mat.c
$call Make matte.c
$call Make meta.c
$call Make miff.c
$call Make mpc.c
$call Make mpeg.c
$call Make mpr.c
$call Make msl.c
$call Make mono.c
$call Make mtv.c
$call Make mvg.c
$call Make null.c
$call Make otb.c
$call Make palm.c
$call Make pattern.c
$call Make pcd.c
$call Make pcl.c
$call Make pcx.c
$call Make pdb.c
$call Make pdf.c
$call Make pes.c
$call Make pict.c
$call Make pix.c
$call Make plasma.c
$call Make png.c
$call Make pnm.c
$call Make preview.c
$call Make ps.c
$call Make ps2.c
$call Make ps3.c
$call Make psd.c
$call Make pwp.c
$call Make raw.c
$call Make rgb.c
$call Make rla.c
$call Make rle.c
$call Make sct.c
$call Make sfw.c
$call Make sgi.c
$call Make stegano.c
$call Make sun.c
$call Make svg.c
$call Make tga.c
$call Make thumbnail.c
$call Make tiff.c
$call Make tile.c
$call Make tim.c
$call Make ttf.c
$call Make txt.c
$call Make uil.c
$call Make url.c
$call Make uyvy.c
$call Make vicar.c
$call Make vid.c
$call Make viff.c
$call Make wbmp.c
$call Make wmf.c
$call Make wpg.c
$call Make x.c
$call Make xbm.c
$call Make xc.c
$call Make xcf.c
$call Make xpm.c
$call Make xps.c
$call Make xwd.c
$call Make ycbcr.c
$call Make yuv.c
$call Make cin.c
$call Make magick.c
$call Make scr.c
$deass magick
$deass wand
$library/create libCoders.olb art,avs,bmp,braille,clip,clipboard,cip,cmyk, -
  cut,dcm,dds,dib,dng,dps,dpx,emf,ept,exr,fax,fits,fpx,gif,gradient,gray, -
  hald,histogram,hrz,html,icon,info,inline,ipl,jbig,jpeg,jp2,label,cals, -
  caption,palm,map,mat,matte, -
  meta,miff,mpc,mpr,msl,mpeg,mono,mtv,mvg,null,otb,pattern,pcd,pcl,pcx,pdb, -
  pdf,pes,pict,pix,plasma,png,pnm,preview,ps,ps2,ps3,psd,pwp,raw,rgb,rla,rle, -
  sct,sfw,sgi,stegano,sun,svg,tga,thumbnail,tiff,tile,tim,ttf,txt,uil,url, -
  uyvy,vicar,vid,viff,wbmp,wmf,wpg,x,xbm,xc,xcf,xpm,xps,xwd,ycbcr,yuv,cin, -
  magick,scr,[-.magick]compress,[-.magick]prervicccm
$exit
$
$Make: subroutine
$!
$! Primitive MMS hack for DCL.
$!
$if (p1 .eqs. "") then exit
$source_file=f$search(f$parse(p1,".c"))
$if (source_file .nes. "")
$then
$  object_file=f$parse(source_file,,,"name")+".obj"
$  object_file=f$search( object_file )
$  if (object_file .nes. "")
$  then
$    object_time=f$file_attribute(object_file,"cdt")
$    source_time=f$file_attribute(source_file,"cdt")
$    if (f$cvtime(object_time) .lts. f$cvtime(source_time)) then -
$      object_file=""
$  endif
$  if (object_file .eqs. "")
$  then
$    write sys$output "Compiling ",p1
$    cc'compile_options'/include_directory=([-],[-.magick],[-.jpeg],[-.png], -
       [-.tiff],[-.ttf],[-.zlib]) 'source_file'
$  endif
$endif
$exit
$endsubroutine

$!
$! Make ImageMagick image coders for VMS.
$!
$
$ define/nolog MAGICK [-.magick]
$ define/nolog WAND [-.wand]
$if (f$trnlnm("X11") .eqs. "") then define/nolog X11 decw$include:
$compile_options="/nodebug/optimize"
$if (f$search("sys$system:decc$compiler.exe") .nes. "")
$then     ! VAX with DEC C
$  compile_options="/decc/nodebug/optimize/warning=(disable=rightshiftovr)"
$else     ! VAX with VAX C
$define/nolog lnk$library sys$library:vaxcrtl
$define/nolog sys sys$share
$endif
$if (f$getsyi("HW_MODEL") .gt. 1023)
$then     ! Alpha with DEC C
$  define/nolog sys decc$library_include
$  compile_options="/nodebug/optimize/prefix=all/warning=(disable=rightshiftovr)/name=(as_is,short)/float=ieee"
$endif
$
$
$write sys$output "Making Coders..."
$call Make art.c
$call Make avs.c
$call Make bmp.c
$call Make braille.c
$call Make cals.c
$call Make caption.c
$call Make cip.c
$call Make clip.c
$call Make clipboard.c
$call Make cmyk.c
$call Make cut.c
$call Make dcm.c
$call Make dds.c
$call Make dib.c
$call Make dng.c
$call Make dps.c
$call Make dpx.c
$call Make emf.c
$call Make ept.c
$call Make exr.c
$call Make fax.c
$call Make fits.c
$call Make fpx.c
$call Make gif.c
$call Make gradient.c
$call Make gray.c
$call Make hald.c
$call Make histogram.c
$call Make hrz.c
$call Make html.c
$call Make icon.c
$call Make info.c
$call Make inline.c
$call Make ipl.c
$call Make jbig.c
$call Make jpeg.c
$call Make jp2.c
$call Make label.c
$call Make map.c
$call Make mat.c
$call Make matte.c
$call Make meta.c
$call Make miff.c
$call Make mpc.c
$call Make mpeg.c
$call Make mpr.c
$call Make msl.c
$call Make mono.c
$call Make mtv.c
$call Make mvg.c
$call Make null.c
$call Make otb.c
$call Make palm.c
$call Make pattern.c
$call Make pcd.c
$call Make pcl.c
$call Make pcx.c
$call Make pdb.c
$call Make pdf.c
$call Make pict.c
$call Make pix.c
$call Make plasma.c
$call Make png.c
$call Make pnm.c
$call Make preview.c
$call Make ps.c
$call Make ps2.c
$call Make ps3.c
$call Make psd.c
$call Make pwp.c
$call Make raw.c
$call Make rgb.c
$call Make rla.c
$call Make rle.c
$call Make sct.c
$call Make sfw.c
$call Make sgi.c
$call Make stegano.c
$call Make sun.c
$call Make svg.c
$call Make tga.c
$call Make thumbnail.c
$call Make tiff.c
$call Make tile.c
$call Make tim.c
$call Make ttf.c
$call Make txt.c
$call Make uil.c
$call Make url.c
$call Make uyvy.c
$call Make vicar.c
$call Make vid.c
$call Make viff.c
$call Make wbmp.c
$call Make wmf.c
$call Make wpg.c
$call Make x.c
$call Make xbm.c
$call Make xc.c
$call Make xcf.c
$call Make xpm.c
$call Make xps.c
$call Make xwd.c
$call Make ycbcr.c
$call Make yuv.c
$call Make cin.c
$call Make magick.c
$call Make scr.c
$deass magick
$deass wand
$library/create libCoders.olb art,avs,bmp,braille,clip,clipboard,cip,cmyk, -
  cut,dcm,dds,dib,dng,dps,dpx,emf,ept,exr,fax,fits,fpx,gif,gradient,gray, -
  hald,histogram,hrz,html,icon,info,inline,ipl,jbig,jpeg,jp2,label,cals, -
  caption,palm,map,mat,matte, -
  meta,miff,mpc,mpr,msl,mpeg,mono,mtv,mvg,null,otb,pattern,pcd,pcl,pcx,pdb, -
  pdf,pict,pix,plasma,png,pnm,preview,ps,ps2,ps3,psd,pwp,raw,rgb,rla,rle, -
  sct,sfw,sgi,stegano,sun,svg,tga,thumbnail,tiff,tile,tim,ttf,txt,uil,url, -
  uyvy,vicar,vid,viff,wbmp,wmf,wpg,x,xbm,xc,xcf,xpm,xps,xwd,ycbcr,yuv,cin, -
  magick,scr,[-.magick]compress,[-.magick]prervicccm
$exit
$
$Make: subroutine
$!
$! Primitive MMS hack for DCL.
$!
$if (p1 .eqs. "") then exit
$source_file=f$search(f$parse(p1,".c"))
$if (source_file .nes. "")
$then
$  object_file=f$parse(source_file,,,"name")+".obj"
$  object_file=f$search( object_file )
$  if (object_file .nes. "")
$  then
$    object_time=f$file_attribute(object_file,"cdt")
$    source_time=f$file_attribute(source_file,"cdt")
$    if (f$cvtime(object_time) .lts. f$cvtime(source_time)) then -
$      object_file=""
$  endif
$  if (object_file .eqs. "")
$  then
$    write sys$output "Compiling ",p1
$    cc'compile_options'/include_directory=([-],[-.magick],[-.jpeg],[-.png], -
       [-.tiff],[-.ttf],[-.zlib]) 'source_file'
$  endif
$endif
$exit
$endsubroutine


IPv6 support

IPv6 support

# www to non-www redirect -- duplicate content is BAD:
# https://github.com/h5bp/html5-boilerplate/blob/5370479476dceae7cc3ea105946536d6bc0ee468/.htaccess#L362
# Choose between www and non-www, listen on the *wrong* one and redirect to
# the right one -- http://wiki.nginx.org/Pitfalls#Server_Name
server {
  # don't forget to tell on which port this server listens
  listen [::]:80 ipv6only=on;
  listen 80;

  # listen on the www host
  server_name www.example.com;

  # and redirect to the non-www host (declared below)
  return 301 $scheme://example.com$request_uri;
}

server {
  # listen 80 deferred; # for Linux
  # listen 80 accept_filter=httpready; # for FreeBSD
  listen [::]:80 ipv6only=on;
  listen 80;

  # The host name to respond to
  server_name example.com;

  # Path for static files
  root /sites/example.com/public;

  #Specify a charset
  charset utf-8;

  # Custom 404 page
  error_page 404 /404.html;

  # Include the basic h5bp config set
  include h5bp/basic.conf;
}

# www to non-www redirect -- duplicate content is BAD:
# https://github.com/h5bp/html5-boilerplate/blob/5370479476dceae7cc3ea105946536d6bc0ee468/.htaccess#L362
# Choose between www and non-www, listen on the *wrong* one and redirect to
# the right one -- http://wiki.nginx.org/Pitfalls#Server_Name
server {
  # don't forget to tell on which port this server listens
  listen 80;

  # listen on the www host
  server_name www.example.com;

  # and redirect to the non-www host (declared below)
  return 301 $scheme://example.com$request_uri;
}

server {
  # listen 80 deferred; # for Linux
  # listen 80 accept_filter=httpready; # for FreeBSD
  listen 80;

  # The host name to respond to
  server_name example.com;

  # Path for static files
  root /sites/example.com/public;

  #Specify a charset
  charset utf-8;

  # Custom 404 page
  error_page 404 /404.html;

  # Include the basic h5bp config set
  include h5bp/basic.conf;
}


Removed typo.

Removed typo.

git pu# www to non-www redirect -- duplicate content is BAD:
# https://github.com/h5bp/html5-boilerplate/blob/5370479476dceae7cc3ea105946536d6bc0ee468/.htaccess#L362
# Choose between www and non-www, listen on the *wrong* one and redirect to
# the right one -- http://wiki.nginx.org/Pitfalls#Server_Name

# Page caching
fastcgi_cache_path /srv/www/EXAMPLE.COM/cache levels=1:2 keys_zone=EXAMPLE.COM:100m inactive=60m;

server {
  # don't forget to tell on which port this server listens
  listen [::]:80;
  listen 80;

  # Include SSL
  listen 443 ssl;
  # Uncomment these after you have created the certificates via letsencrypt
  # ssl_certificate /etc/letsencrypt/live/EXAMPLE.COM/fullchain.pem;
  # ssl_certificate_key /etc/letsencrypt/live/EXAMPLE.COM/privkey.pem;
  include h5bp/directive-only/ssl.conf;
  include h5bp/directive-only/ssl-stapling.conf;

  # listen on the www host
  server_name www.EXAMPLE.COM;

  # and redirect to the non-www host (declared below)
  return 301 $scheme://EXAMPLE.COM$request_uri;
}

server {
  # Site level settings for fastcgi cache
  fastcgi_cache_lock on;
  fastcgi_cache_lock_age 3s;
  fastcgi_cache_lock_timeout 3s;
  fastcgi_cache_use_stale updating error timeout invalid_header http_500 http_503;

  ###################################################
  # Settings to turn on pagespeed and fastcgi cache #
  ###################################################

  # Pagespeed (on/off)
  pagespeed off;

  # Skip fastcgi caching (1/0)
  # 0 = cache is active, 1= cache is set off
  set $skip_cache 0;

  # Include SSL
  listen 443 ssl;
  # Uncomment these after you have created the certificates via letsencrypt
  # ssl_certificate /etc/letsencrypt/live/EXAMPLE.COM/fullchain.pem;
  # ssl_certificate_key /etc/letsencrypt/live/EXAMPLE.COM/privkey.pem;
  include h5bp/directive-only/ssl.conf;
  include h5bp/directive-only/ssl-stapling.conf;

  ###################################################

  # listen [::]:80 accept_filter=httpready; # for FreeBSD
  # listen 80 accept_filter=httpready; # for FreeBSD
  # listen [::]:80 deferred; # for Linux
  # listen 80 deferred; # for Linux
  listen [::]:80;
  listen 80;

  # The host name to respond to
  server_name EXAMPLE.COM;

  # Path for static files
  root /srv/www/EXAMPLE.COM/public;

  # Index files
  index index.html index.php;

  # Custom log locations. Enable if needed.
  #error_log  /srv/www/EXAMPLE.COM/logs/error.log warn;
  #access_log /srv/www/EXAMPLE.COM/logs/access.log main;

  # Specify a charset
  charset utf-8;

  # Custom 404 page
  #error_page 404 /404.html;

  # Redirects for WP sitemaps
  include global/yoast-wordpress-seo.conf;

  # Include global restrictions
  include global/restrictions.conf;

  # Include the basic h5bp config set
  include h5bp/basic.conf;

  # Include page caching exclude configuration.
  include global/cache-exclude.conf;

  location ~ /purge(/.*) {
    fastcgi_cache_purge EXAMPLE.COM "$scheme$request_method$host$1";
  }

  # Require authentication to access the directory. If you are using this you must
  # disable the global wordpress confs.
  #location / {
  # auth_basic "Login required";
  # auth_basic_user_file /srv/www/EXAMPLE.COM/htpasswd;
  #}

  # Enable configuration level
  pagespeed RewriteLevel CoreFilters;

  # Enabled extra rules
  pagespeed EnableFilters collapse_whitespace,insert_dns_prefetch;

  # Needs to exist and be writable by nginx.  Use tmpfs for best performance.
  pagespeed FileCachePath /var/ngx_pagespeed_cache/EXAMPLE.COM;

  # Needed for WPML directory test to pass
  pagespeed Disallow "*icl_validate_domain=1*";

  # Ensure requests for pagespeed optimized resources go to the pagespeed handler
  # and no extraneous headers get set.
  location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {
    add_header "" "";
  }
  location ~ "^/pagespeed_static/" { }
  location ~ "^/ngx_pagespeed_beacon$" { }

  # Only include one of the files below.
  include global/wordpress.conf;
  #include global/wordpress-ms-subdir.conf;

  # Pass all .php files onto a php-fpm/php-fcgi server.
  location ~ [^/]\.php(/|$) {
  	fastcgi_split_path_info ^(.+?\.php)(/.*)$;
  	if (!-f $document_root$fastcgi_script_name) {
  		return 404;
  	}
  	# This is a robust solution for path info security issue and works with "cgi.fix_pathinfo = 1" in /etc/php.ini (default)

  	include fastcgi.conf;
  	fastcgi_param HTTP_PROXY ""; # https://httpoxy.org/#prevent
  	fastcgi_index index.php;
  	#fastcgi_intercept_errors on;
  	fastcgi_pass 127.0.0.1:9000;

  	fastcgi_cache_bypass $skip_cache;
  	fastcgi_no_cache $skip_cache;
  	fastcgi_cache EXAMPLE.COM;
  	fastcgi_cache_valid 200 302 10m;
    fastcgi_cache_valid 301 1h;
    fastcgi_cache_valid any 1m;
  }
}


Update snoyman.com

Update snoyman.com


Options expanded.

Options expanded.

#!/usr/bin/env ruby

require File.expand_path('../../lib/terminal.com', __FILE__)

# TODO: Don't force tokens for methods that don't need them.
# TODO: terminal.com configure -> ask for the credentials and save them.
# TODO: Support booleans --featured --no-featured.

def usage
  <<-EOF
== Usage ==

1. Explicit configuration.

#{$0} [user_token] [access_token] [command]

2. With a configuration file.

~/.terminal.com.json
{"user_token": "...", "access_token": "..."}

#{$0} [command]

== Commands ==

These are identical to what the API provides.

# BROWSE SNAPSHOTS & USERS #
get_snapshot snapshot_id
get_profile username
list_public_snapshots [options]
  --username=value
  --tag=value
  --featured
  --title=value
  --page=value
  --perPage=value
  --sortby=value

count_public_snapshots [options]
  --username=value
  --tag=value
  --featured
  --title=value

# CREATE AND MANAGE TERMINALS #
list_terminals user_token access_token
get_terminal user_token access_token [options]
  --container_key=value
  --subdomain=value

start_snapshot user_token access_token snapshot_id [options]
  --cpu=value
  --ram=value
  --temporary=value
  --name=value
  --autopause=value
  --startup_script=value
  --custom_data=value

delete_terminal user_token access_token container_key
restart_terminal user_token access_token container_key
pause_terminal user_token access_token container_key
resume_terminal user_token access_token container_key
edit_terminal user_token access_token container_key [options]
  --cpu=value
  --ram=value
  --diskspace=value
  --name=value

# CREATE AND MANAGE SNAPSHOTS #
list_snapshots user_token access_token [options]
  --username=value
  --tag=value
  --featured
  --title=value
  --page=value
  --perPage=value

count_snapshots user_token access_token [options]
  --username=value
  --tag=value
  --featured
  --title=value

delete_snapshot user_token access_token snapshot_id
edit_snapshot user_token access_token snapshot_id [options]
  --body=value
  --title=value
  --readme=value
  --public
  --custom_data=value

snapshot_terminal user_token access_token container_key [options]
  --body=value
  --title=value
  --readme=value
  --public

# MANAGE TERMINAL ACCESS #
add_terminal_links user_token access_token container_key *links
remove_terminal_links user_token access_token container_key *links
list_terminal_access user_token access_token container_key
edit_terminal_access user_token access_token container_key [options]
  --is_public_list
  --access_rules=value

# MANAGE TERMINAL DNS & DOMAINS #
get_cname_records user_token access_token
add_domain_to_pool user_token access_token domain
remove_domain_from_pool user_token access_token domain
add_cname_record user_token access_token domain subdomain port
remove_cname_record user_token access_token domain

# MANAGE TERMINAL IDLE SETTINGS #
set_terminal_idle_settings user_token access_token container_key action *triggers
get_terminal_idle_settings user_token access_token container_key

# MANAGE USAGE & CREDITS #
instance_types
instance_price instance_type status (defaults to running)
balance user_token access_token
balance_added user_token access_token
gift user_token access_token email cents
burn_history user_token access_token
terminal_usage_history user_token access_token
burn_state user_token access_token
burn_estimates user_token access_token

# MANAGE SSH PUBLIC KEYS #
add_authorized_key_to_terminal user_token access_token container_key publicKey
add_authorized_key_to_ssh_proxy user_token access_token name publicKey
del_authorized_key_from_ssh_proxy user_token access_token name fingerprint
get_authorized_keys_from_ssh_proxy user_token access_token

# OTHER #
who_am_i user_token, access_token
request_progress request_id
  EOF
end

# -h | --help
if ARGV.include?('-h') || ARGV.include?('--help')
  puts usage; exit
end

# Tokens.
# TODO: Add --no-config
if File.exist?(File.expand_path('~/.terminal.com.json'))
  config = JSON.parse(File.read(File.expand_path('~/.terminal.com.json')))
  user_token, access_token = config.values_at('user_token', 'access_token')

  if user_token.nil?
    abort("Config file found, but user_token is missing. Add user_token key.")
  end

  if access_token.nil?
    abort("Config file found, but access_token is missing. Add access_token key.")
  end
else
  user_token, access_token = ARGV.shift(2)

  if user_token.nil? || access_token.nil?
    STDERR.puts("Credentials missing.\n\n")
    abort usage
  end
end

if ARGV.empty?
  STDERR.puts("Command missing.\n\n")
  abort usage
else
  command = ARGV.shift

  unless Terminal::API.respond_to?(command)
    STDERR.puts("Invalid command '#{command}'.\n\n")
    abort usage
  end

  # Not every method requires authentication.
  method_args = Terminal::API.method(command).parameters.map(&:last)

  if method_args.include?(:options)
    options = ARGV.reduce(Hash.new) do |buffer, argument|
      if argument.match(/^--(.+)=(.+)$/)
        ARGV.delete(argument)
        buffer[$1.to_sym] = $2
      end

      buffer
    end
  end

  arguments = []
  arguments << user_token if method_args.include?(:user_token)
  arguments << access_token if method_args.include?(:access_token)
  arguments.push(*ARGV)

  # Ruby **args expansion doesn't work as I expected, that's why the extra if.
  # pry(main)> def xxx(*args) args; end
  # pry(main)> xxx(**{})
  # => [{}]
  if options
    STDERR.puts("~ Terminal::API.#{command}(*#{arguments.inspect}, **#{options.inspect})\n\n")
    puts Terminal::API.send(command, *arguments, **options)
  else
    STDERR.puts("~ Terminal::API.#{command}(*#{arguments.inspect})\n\n")
    puts Terminal::API.send(command, *arguments)
  end
end

#!/usr/bin/env ruby

require File.expand_path('../../lib/terminal.com', __FILE__)

# TODO: Don't force tokens for methods that don't need them.

def usage
  <<-EOF
== Usage ==

1. Explicit configuration.

#{$0} [user_token] [access_token] [command]

2. With a configuration file.

~/.terminal.com.json
{"user_token": "...", "access_token": "..."}

#{$0} [command]

== Commands ==

These are identical to what the API provides.

# BROWSE SNAPSHOTS & USERS #
get_snapshot snapshot_id
get_profile username
list_public_snapshots **options
count_public_snapshots **options

# CREATE AND MANAGE TERMINALS #
list_terminals user_token access_token
get_terminal user_token access_token **options
start_snapshot user_token access_token snapshot_id **options
delete_terminal user_token access_token container_key
restart_terminal user_token access_token container_key
pause_terminal user_token access_token container_key
resume_terminal user_token access_token container_key
edit_terminal user_token access_token container_key **options

# CREATE AND MANAGE SNAPSHOTS #
list_snapshots user_token access_token **options
count_snapshots user_token access_token **options
delete_snapshot user_token access_token snapshot_id
edit_snapshot user_token access_token snapshot_id **options
snapshot_terminal user_token access_token container_key **options

# MANAGE TERMINAL ACCESS #
add_terminal_links user_token access_token container_key *links
remove_terminal_links user_token access_token container_key *links
list_terminal_access user_token access_token container_key
edit_terminal_access user_token access_token container_key **options

# MANAGE TERMINAL DNS & DOMAINS #
get_cname_records user_token access_token
add_domain_to_pool user_token access_token domain
remove_domain_from_pool user_token access_token domain
add_cname_record user_token access_token domain subdomain port
remove_cname_record user_token access_token domain

# MANAGE TERMINAL IDLE SETTINGS #
set_terminal_idle_settings user_token access_token container_key action *triggers
get_terminal_idle_settings user_token access_token container_key

# MANAGE USAGE & CREDITS #
instance_types
instance_price instance_type status (defaults to running)
balance user_token access_token
balance_added user_token access_token
gift user_token access_token email cents
burn_history user_token access_token
terminal_usage_history user_token access_token
burn_state user_token access_token
burn_estimates user_token access_token

# MANAGE SSH PUBLIC KEYS #
add_authorized_key_to_terminal user_token access_token container_key publicKey
add_authorized_key_to_ssh_proxy user_token access_token name publicKey
del_authorized_key_from_ssh_proxy user_token access_token name fingerprint
get_authorized_keys_from_ssh_proxy user_token access_token

# OTHER #
who_am_i user_token, access_token
request_progress request_id
  EOF
end

# -h | --help
if ARGV.include?('-h') || ARGV.include?('--help')
  puts usage; exit
end

# Tokens.
# TODO: Add --no-config
if File.exist?(File.expand_path('~/.terminal.com.json'))
  config = JSON.parse(File.read(File.expand_path('~/.terminal.com.json')))
  user_token, access_token = config.values_at('user_token', 'access_token')

  if user_token.nil?
    abort("Config file found, but user_token is missing. Add user_token key.")
  end

  if access_token.nil?
    abort("Config file found, but access_token is missing. Add access_token key.")
  end
else
  user_token, access_token = ARGV.shift(2)

  if user_token.nil? || access_token.nil?
    STDERR.puts("Credentials missing.\n\n")
    abort usage
  end
end

if ARGV.empty?
  STDERR.puts("Command missing.\n\n")
  abort usage
else
  command = ARGV.shift

  unless Terminal::API.respond_to?(command)
    STDERR.puts("Invalid command '#{command}'.\n\n")
    abort usage
  end

  # Not every method requires authentication.
  method_args = Terminal::API.method(command).parameters.map(&:last)

  if method_args.include?(:options)
    options = ARGV.reduce(Hash.new) do |buffer, argument|
      if argument.match(/^--(.+)=(.+)$/)
        ARGV.delete(argument)
        buffer[$1.to_sym] = $2
      end

      buffer
    end
  end

  arguments = []
  arguments << user_token if method_args.include?(:user_token)
  arguments << access_token if method_args.include?(:access_token)
  arguments.push(*ARGV)

  # Ruby **args expansion doesn't work as I expected, that's why the extra if.
  # pry(main)> def xxx(*args) args; end
  # pry(main)> xxx(**{})
  # => [{}]
  if options
    STDERR.puts("~ Terminal::API.#{command}(*#{arguments.inspect}, **#{options.inspect})\n\n")
    puts Terminal::API.send(command, *arguments, **options)
  else
    STDERR.puts("~ Terminal::API.#{command}(*#{arguments.inspect})\n\n")
    puts Terminal::API.send(command, *arguments)
  end
end


Updates nginx config.

Updates nginx config.

* Serve from static/dist
* Cache resources, as resources now have hash identifiers.

# NGINX configuration for playarchipelago.com.
#
# Listens for requests made to https://playarchipelago.com, serving
# static files from  the archipelago/static dir and forwards requests
# to /ws to the archipelago server.
#

# Cache map for different file types, see:
# https://www.digitalocean.com/community/tutorials/how-to-implement-browser-caching-with-nginx-s-header-module-on-centos-7
map $sent_http_content_type $expires {
	default                    off;
	text/html                  epoch;
	text/css                   max;
	application/javascript     max;
	~image/                    max;
}

# Redirect http:// -> https://
server {
	listen 80;
	listen [::]:80;
	server_name www.playarchipelago.com playarchipelago.com;
	return 301 https://playarchipelago.com$request_uri;
}

# Redirect https://www.playarchipelago.com -> https://playarchipelago.com
server {
	listen 443 ssl http2;
	listen [::]:443 ssl http2;
	server_name www.playarchipelago.com;
	ssl_certificate /etc/letsencrypt/live/playarchipelago.com/fullchain.pem;
	ssl_certificate_key /etc/letsencrypt/live/playarchipelago.com/privkey.pem;
	return 301 https://playarchipelago.com$request_uri;
}

# Primary, https://playarchipelago.com
server {
	listen 443 ssl http2;
	listen [::]:443 ssl http2;
	server_name playarchipelago.com;
	ssl_certificate /etc/letsencrypt/live/playarchipelago.com/fullchain.pem;
	ssl_certificate_key /etc/letsencrypt/live/playarchipelago.com/privkey.pem;

	access_log /var/log/playarchipelago.com/nginx.access.log;
	error_log  /var/log/playarchipelago.com/nginx.error.log;

	# Serve "/.well-known/acme-challenge" from a separate directory
	# this directory is used by let's encrypt to validate ownership
	location ^~ /.well-known/acme-challenge/ {
		root /var/www/letsencrypt/playarchipelago.com;
		try_files $uri $uri/ =404;
	}

	# Proxy requests for /ws to the archipelago server on :8080
	location /ws {
		proxy_set_header X-Real-IP  $remote_addr;
		proxy_set_header X-Forwarded-For $remote_addr;
		proxy_set_header Host $host;
		proxy_pass http://localhost:8080;
		# Websockets
		proxy_http_version 1.1;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection "upgrade";
	}

	# All other requests are served from the static folder
	root /home/deploy/go/src/github.com/verath/archipelago/static/dist;
	index index.html;
	location / {
		try_files $uri $uri/ index.html;
		expires $expires;
	}

	# Deny access to .-files
	location ~ /\. {
		return 403;
	}
}

# NGINX configuration for playarchipelago.com.
#
# Listens for requests made to https://playarchipelago.com, serving
# static files from  the archipelago/static dir and forwards requests
# to /ws to the archipelago server.
#

# Redirect http:// -> https://
server {
	listen 80;
	listen [::]:80;
	server_name www.playarchipelago.com playarchipelago.com;
	return 301 https://playarchipelago.com$request_uri;
}

# Redirect https://www.playarchipelago.com -> https://playarchipelago.com
server {
	listen 443 ssl http2;
	listen [::]:443 ssl http2;
	server_name www.playarchipelago.com;
	ssl_certificate /etc/letsencrypt/live/playarchipelago.com/fullchain.pem;
	ssl_certificate_key /etc/letsencrypt/live/playarchipelago.com/privkey.pem;
	return 301 https://playarchipelago.com$request_uri;
}

# Primary, https://playarchipelago.com
server {
	listen 443 ssl http2;
	listen [::]:443 ssl http2;
	server_name playarchipelago.com;
	ssl_certificate /etc/letsencrypt/live/playarchipelago.com/fullchain.pem;
	ssl_certificate_key /etc/letsencrypt/live/playarchipelago.com/privkey.pem;

	access_log /var/log/playarchipelago.com/nginx.access.log;
	error_log  /var/log/playarchipelago.com/nginx.error.log;

	# Serve "/.well-known/acme-challenge" from a separate directory
	# this directory is used by let's encrypt to validate ownership
	location ^~ /.well-known/acme-challenge/ {
		root /var/www/letsencrypt/playarchipelago.com;
		try_files $uri $uri/ =404;
	}

	# Proxy requests for /ws to the archipelago server on :8080
	location /ws {
		proxy_set_header X-Real-IP  $remote_addr;
		proxy_set_header X-Forwarded-For $remote_addr;
		proxy_set_header Host $host;
		proxy_pass http://localhost:8080;
		# Websockets
		proxy_http_version 1.1;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection "upgrade";
	}

	# All other requests are served from the static folder
	root /home/deploy/go/src/github.com/verath/archipelago/static/;
	index index.html;
	location / {
		try_files $uri $uri/ index.html;
	}

	# Deny access to .-files
	location ~ /\. {
		return 403;
	}
}


Delete animal_code.google.com

Delete animal_code.google.com


Add key for cibuild

Add key for cibuild


Just as in Unix, make sure to generate some kind of "random data".

$! TETSGEN.COM
$
$	__arch := VAX
$	if f$getsyi("cpu") .ge. 128 then __arch := AXP
$	exe_dir := sys$disk:[-.'__arch'.exe.apps]
$
$	T := testcert
$	KEY = 512
$	CA := [-.certs]testca.pem
$
$	set noon
$	if f$search(T+".1;*") .nes. "" then delete 'T'.1;*
$	if f$search(T+".2;*") .nes. "" then delete 'T'.2;*
$	if f$search(T+".key;*") .nes. "" then delete 'T'.key;*
$	set on
$
$	write sys$output "generating certificate request"
$
$	write sys$output "There should be a 2 sequences of .'s and some +'s."
$	write sys$output "There should not be more that at most 80 per line"
$	write sys$output "This could take some time."
$
$	append/new nl: .rnd
$	open/append random_file .rnd
$	write random_file "string to make the random number generator think it has entropy"
$	close random_file
$
$	mcr 'exe_dir'openssl req -config test.cnf -new -out testreq.pem
$	if $severity .ne. 1
$	then
$	    write sys$output "problems creating request"
$	    exit 3
$	endif
$
$	mcr 'exe_dir'openssl req -verify -in testreq.pem -noout
$	if $severity .ne. 1
$	then
$	    write sys$output "signature on req is wrong"
$	    exit 3
$	endif

$! TETSGEN.COM
$
$	__arch := VAX
$	if f$getsyi("cpu") .ge. 128 then __arch := AXP
$	exe_dir := sys$disk:[-.'__arch'.exe.apps]
$
$	T := testcert
$	KEY = 512
$	CA := [-.certs]testca.pem
$
$	set noon
$	if f$search(T+".1;*") .nes. "" then delete 'T'.1;*
$	if f$search(T+".2;*") .nes. "" then delete 'T'.2;*
$	if f$search(T+".key;*") .nes. "" then delete 'T'.key;*
$	set on
$
$	write sys$output "generating certificate request"
$
$	write sys$output "There should be a 2 sequences of .'s and some +'s."
$	write sys$output "There should not be more that at most 80 per line"
$	write sys$output "This could take some time."
$
$	mcr 'exe_dir'openssl req -config test.cnf -new -out testreq.pem
$	if $severity .ne. 1
$	then
$	    write sys$output "problems creating request"
$	    exit 3
$	endif
$
$	mcr 'exe_dir'openssl req -verify -in testreq.pem -noout
$	if $severity .ne. 1
$	then
$	    write sys$output "signature on req is wrong"
$	    exit 3
$	endif


jasper's

jasper's

# Redirect all HTTP trafic to HTTPS

server {
    listen 80;
    listen [::]:80;

    server_name tapcrate.com www.tapcrate.com api.tapcrate.com www.api.tapcrate.com static.tapcrate.com www.static.tapcrate.com beta.tapcrate.com www.beta.tapcrate.com;

    location ^~ /.well-known/acme-challenge/ {
        default_type "text/plain";
        root /tmp/letsencrypt-auto/;
    }

    location = /.well-known/acme-challenge/ {
        return 404;
    }

    location / {
        return 301 https://$server_name$request_uri;
    }
}

server {

    listen 443 ssl http2 default_server;
    listen [::]:443 ssl http2 default_server;

    include snippets/ssl-tapcrate.com.conf;
    include snippets/ssl-params.conf;

    server_name tapcrate.com www.tapcrate.com;

    root /home/jasper/tapcrate-web;
    index index.php index.html;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        include snippets/gzip.conf;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }

    location ~ /\.ht {
        deny all;
    }
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    include snippets/ssl-api.tapcrate.com.conf;
    include snippets/ssl-params.conf;

    root /home/hakon/tapcrate-api;

    server_name api.tapcrate.com www.api.tapcrate.com;

    location / {
        include proxy_params;
        include snippets/gzip.conf;
        proxy_pass http://127.0.0.1:8080;
    }
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    include snippets/ssl-beta.tapcrate.com.conf;
    include snippets/ssl-params.conf;

    root /home/hakon/tapcrate-development-api;

    server_name beta.tapcrate.com www.beta.tapcrate.com;

    location / {
        include proxy_params;
        include snippets/gzip.conf;
        proxy_pass http://127.0.0.1:8081;
    }
}

proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=static:10m inactive=60m use_temp_path=off max_size=4g;

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    include snippets/ssl-api.tapcrate.com.conf;
    include snippets/ssl-params.conf;

    root /home/hakon/tapcrate-api/Public;

    server_name static.tapcrate.com www.static.tapcrate.com;

    location / {
        include h5bp/basic.conf;

        tcp_nodelay on;
        keepalive_timeout 65;
        sendfile on;
        tcp_nopush on;
        sendfile_max_chunk 1m;

        include snippets/gzip.conf;

        proxy_cache static;
        try_files $uri =404;
    }
}

# Redirect all HTTP trafic to HTTPS

server {
    listen 80;
    listen [::]:80;

    server_name tapcrate.com www.tapcrate.com api.tapcrate.com www.api.tapcrate.com static.tapcrate.com www.static.tapcrate.com beta.tapcrate.com www.beta.tapcrate.com;

    location ^~ /.well-known/acme-challenge/ {
        default_type "text/plain";
        root /tmp/letsencrypt-auto/;
    }

    location = /.well-known/acme-challenge/ {
        return 404;
    }

    location / {
        return 301 https://$server_name$request_uri;
    }
}

server {

    listen 443 ssl http2 default_server;
    listen [::]:443 ssl http2 default_server;

    include snippets/ssl-tapcrate.com.conf;
    include snippets/ssl-params.conf;

    server_name tapcrate.com www.tapcrate.com;

    root /home/hakon/tapcrate-web;
    index index.php index.html;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        include snippets/gzip.conf;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }

    location ~ /\.ht {
        deny all;
    }
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    include snippets/ssl-api.tapcrate.com.conf;
    include snippets/ssl-params.conf;

    root /home/hakon/tapcrate-api;

    server_name api.tapcrate.com www.api.tapcrate.com;

    location / {
        include proxy_params;
        include snippets/gzip.conf;
        proxy_pass http://127.0.0.1:8080;
    }
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    include snippets/ssl-beta.tapcrate.com.conf;
    include snippets/ssl-params.conf;

    root /home/hakon/tapcrate-development-api;

    server_name beta.tapcrate.com www.beta.tapcrate.com;

    location / {
        include proxy_params;
        include snippets/gzip.conf;
        proxy_pass http://127.0.0.1:8081;
    }
}

proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=static:10m inactive=60m use_temp_path=off max_size=4g;

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    include snippets/ssl-api.tapcrate.com.conf;
    include snippets/ssl-params.conf;

    root /home/hakon/tapcrate-api/Public;

    server_name static.tapcrate.com www.static.tapcrate.com;

    location / {
        include h5bp/basic.conf;

        tcp_nodelay on;
        keepalive_timeout 65;
        sendfile on;
        tcp_nopush on;
        sendfile_max_chunk 1m;

        include snippets/gzip.conf;

        proxy_cache static;
        try_files $uri =404;
    }
}


update

update

# Redirect all HTTP trafic to HTTPS

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    server_name polymyr.com www.polymyr.com;
    return 301 https://$server_name$request_uri;
}

server {

    listen 443 ssl http2 default_server;
    listen [::]:443 ssl http2 default_server;

    server_name polymyr.com www.polymyr.com;

    include snippets/ssl-polymyr.com.conf;
    include snippets/ssl-params.conf;

    root /home/jasper/polymyr;
    index index.php;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }

    location ~ /\.ht {
        deny all;
    }

    location ~ /.well-known {
        allow all;
    }
}

server {

    listen 80;
    listen [::]:80;

    # listen 443 ssl http2;
    # listen [::]:443 ssl http2;

    # include snippets/ssl-api.polymyr.com.conf;
    # include snippets/ssl-params.conf;

    root /home/hakon/polymyr/polymyr-dev-api/;

    server_name api.polymyr.com www.api.polymyr.com;

    location ~ /.well-known {
        allow all;
        try_files $uri;
    }

    location / {
        include proxy_params;
        proxy_pass http://127.0.0.1:8080;
    }
}

proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=static:10m inactive=60m use_temp_path=off max_size=4g;

server {
    listen 80;
    listen [::]:80;

    # listen 443 ssl http2;
    # listen [::]:443 ssl http2;

    # include snippets/ssl-api.polymyr.com.conf;
    # include snippets/ssl-params.conf;

    root /home/hakon/polymyr/polymyr-dev-api/;

    server_name static.polymyr.com www.static.polymyr.com;

    location / {
        include h5bp/basic.conf;

        tcp_nodelay on;
        keepalive_timeout 65;
        sendfile on;
        tcp_nopush on;
        sendfile_max_chunk 1m;

        proxy_cache static;
        try_files Public/$uri =404;
    }

    location ~ /.well-known {
        allow all;
    }
}

# Redirect all HTTP trafic to HTTPS

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    server_name polymyr.com www.polymyr.com;
    return 301 https://$server_name$request_uri;
}

server {

    listen 443 ssl http2 default_server;
    listen [::]:443 ssl http2 default_server;

    server_name polymyr.com www.polymyr.com;

    include snippets/ssl-polymyr.com.conf;
    include snippets/ssl-params.conf;

    root /home/jasper/polymyr;
    index index.php;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }

    location ~ /\.ht {
        deny all;
    }

    location ~ /.well-known {
        allow all;
    }
}

server {

    listen 80;
    listen [::]:80;

    # listen 443 ssl http2;
    # listen [::]:443 ssl http2;

    # include snippets/ssl-api.polymyr.com.conf;
    # include snippets/ssl-params.conf;

    server_name api.polymyr.com www.api.polymyr.com;

    location / {
        include proxy_params;
        proxy_pass http://127.0.0.1:8080;
    }

    location ~ /.well-known {
        allow all;
    }
}

proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=static:10m inactive=60m use_temp_path=off max_size=4g;

server {
    listen 80;
    listen [::]:80;

    # listen 443 ssl http2;
    # listen [::]:443 ssl http2;

    # include snippets/ssl-api.polymyr.com.conf;
    # include snippets/ssl-params.conf;

    root /home/hakon/polymyr/polymyr-dev-api/;

    server_name static.polymyr.com www.static.polymyr.com;

    location / {
        include h5bp/basic.conf;

        tcp_nodelay on;
        keepalive_timeout 65;
        sendfile on;
        tcp_nopush on;
        sendfile_max_chunk 1m;

        proxy_cache static;
        try_files Public/$uri =404;
    }

    location ~ /.well-known {
        allow all;
    }
}