Skip to content

Instantly share code, notes, and snippets.

Wojciech Adam Koszek wkoszek

Block or report user

Report or block wkoszek

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gwillem
gwillem / ansible-bootstrap-ubuntu-16.04.yml
Created Jun 16, 2016
Get Ansible to work on bare Ubuntu 16.04 without python 2.7
View ansible-bootstrap-ubuntu-16.04.yml
# Add this snippet to the top of your playbook.
# It will install python2 if missing (but checks first so no expensive repeated apt updates)
# gwillem@gmail.com
- hosts: all
gather_facts: False
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
@cecilemuller
cecilemuller / letsencrypt_2019.md
Last active Jun 23, 2019
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)
View letsencrypt_2019.md

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

View sshclient.go
package main
import (
"bufio"
"io/ioutil"
"os/signal"
//"syscall"
"fmt"
"log"
"os"
@hvasconcelos
hvasconcelos / gen_keys.sh
Last active May 16, 2019
Create an Sinatra SSL Server
View gen_keys.sh
# Generate a self-signed Certificate and a Private Key
openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout pkey.pem -out cert.crt
@floriankugler
floriankugler / gist:6870499
Last active Jun 24, 2019
Mapping of NSURLConnection to NSURLSession delegate methods. Created by Mattt Thompson.
View gist:6870499
NSURLConnection | NSURLSession
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
NSURLConnectionDelegate connectionShouldUseCredentialStorage: |
------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------
NSURLConnectionDelegate connection:willSendRequestForAuthenticationChallenge: | NSURLSessionDelegate URLSession:didReceiveChallenge:completionHandler:
| N
View create-release.rb
require "net/https"
require "json"
gh_token = ENV.fetch("GITHUB_TOKEN")
gh_user = ARGV.fetch(0)
gh_repo = ARGV.fetch(1)
release_name = ARGV.fetch(2)
release_desc = ARGV[3]
uri = URI("https://api.github.com")
@mattn
mattn / sinachiku.rb
Created May 8, 2012
sinatra on mruby
View sinachiku.rb
require 'HTTP'
require 'UV'
module Sinachiku
@routes = { 'GET' => [], 'POST' => [] }
def self.route(method, path, opts, &block)
@routes[method] << [path, opts, block]
end
def self.do(r)
@routes[r.method].each {|path|
You can’t perform that action at this time.