Skip to content

Instantly share code, notes, and snippets.

View Kali-lightsaber's full-sized avatar
💤
on the edges

Igor Razvozjaev Kali-lightsaber

💤
on the edges
  • Russia
View GitHub Profile
@Kali-lightsaber
Kali-lightsaber / gist:cc6ce021a5c924159c3506a3f9ea74c7
Created March 30, 2018 15:40 — forked from mtigas/gist:952344
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.

Using self-signed certificate.

Create a Certificate Authority root (which represents this server)

Organization & Common Name: Some human identifier for this server CA.

openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
@Kali-lightsaber
Kali-lightsaber / gist:0670664c6c35aeb019772bc876d54686
Created March 30, 2018 15:40 — forked from mtigas/gist:952344
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.

Using self-signed certificate.

Create a Certificate Authority root (which represents this server)

Organization & Common Name: Some human identifier for this server CA.

openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
@Kali-lightsaber
Kali-lightsaber / postgres-cheatsheet.md
Created March 30, 2018 19:46 — forked from kgrvamsi/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

If run with -E flag, it will describe the underlaying queries of the \ commands (cool for learning!).

Most \d commands support additional param of __schema__.name__ and accept wildcards like *.*

@Kali-lightsaber
Kali-lightsaber / Puppet-101
Created March 30, 2018 19:48 — forked from kgrvamsi/Puppet-101
Puppet Installation of Server and Node
###Installtion of Master
wget https://apt.puppetlabs.com/puppetlabs-release-precise.deb
sudo dpkg -i puppetlabs-release-precise.deb
sudo apt-get update
sudo apt-get install puppetmaster-passenger -y ---- For Production based Master Setup
######### Only for Testing ################
sudo apt-get install puppetmaster -y ---- For test Master Server Setup
@Kali-lightsaber
Kali-lightsaber / openresty-ubuntu-install.sh
Created April 2, 2018 02:54 — forked from kingtuna/openresty-ubuntu-install.sh
Easy install openresty (used and tested on Ubuntu 14.04, 15.10 and 16.04)
#!/bin/bash
apt-get -y update
apt-get -y install nginx-extras build-essential libpcre3-dev libssl-dev libgeoip-dev libpq-dev libxslt1-dev libgd2-xpm-dev
wget -c https://openresty.org/download/openresty-1.11.2.1.tar.gz
tar zxvf openresty-1.11.2.1.tar.gz
cd openresty-1.11.2.1
./configure \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
user nginx;
worker_processes 1;
error_log logs/error.log info;
pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
  • create tasks T{NNNN} asign them
  • create a branch with name like "T{NNNN}-boo-hoo"
  • git checkout -b T1234-boo-foo
  • commit changes on that branch until it gets ready to be reviewed
  • git commit -am 'first'
  • git commit -am 'now it works'
  • check if it's lint free (NOTE: it runs lint against only modified files)
  • arc lint
  • push a review request to the server. This will create a diff with id D{NNNN}
  • arc diff
<?php
/*
* Copyright 2013 Disqus, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@Kali-lightsaber
Kali-lightsaber / install.sh
Created April 2, 2018 17:14 — forked from tkuchiki/install.sh
Ubuntu 16.04 に nginx-build を使って openresty + ngx_small_light + ngx_dynamic_upstream を入れる
#!/bin/bash
apt-get update -y
apt-get install -y libpcre2-dev imagemagick libimlib2-dev libgd-dev libmagickwand-dev libxml2-dev libxslt-dev libgeoip-dev libperl-dev curl git openssl libssl-dev
ln -s /usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16/Wand-config /usr/bin/
mkdir -p /usr/local/src/nginx/modules
cd /usr/local/src/nginx/modules
git clone https://github.com/cubicdaiya/ngx_dynamic_upstream
git clone https://github.com/cubicdaiya/ngx_small_light
cd ngx_small_light
./setup --with-imlib2 --with-gd