Skip to content

Instantly share code, notes, and snippets.

View pqant's full-sized avatar
💭
I may be slow to respond.

Dr.Emmett Brown pqant

💭
I may be slow to respond.
View GitHub Profile
@pqant
pqant / cheatsheet.cpp
Last active October 29, 2020 01:00 — forked from satwikkansal/cheatsheet.cpp
C++ STL cheatsheet for competitive progrmming
/*
This a header file that includes every standard library.
You can use it to save time.
NOTE: This header file may not be recognized by compilers
other than gcc.
*/
#include <bits/stdc++.h>
/*
//Use this if the above header file doesn't work.
@pqant
pqant / install_openresty_in_mac.md
Created February 18, 2020 12:58 — forked from ejlp12/install_openresty_in_mac.md
Install openresty in Mac OS-X

Install 3scale self managed API gateway (openresty) in Mac OS-X

brew update
brew install pcre openssl

wget http://openresty.org/download/ngx_openresty-1.9.7.2.tar.gz
tar xzvf ngx_openresty-1.9.7.2.tar.gz
cd ngx_openresty-1.9.7.2
@pqant
pqant / iptables.md
Created December 24, 2019 09:13 — forked from DominicBreuker/iptables.md
iptables firewall

iptables cheat sheet

Concepts

iptables defines tables, which group features:

  • filter: use it to filter traffic
  • nat: use it to implement NAT
  • raw: use it to define which connections iptables should track (stateful firewall)
  • mangle: use it to change some fields in packets (e.g., TTL)
  • security: use it to define access control
@pqant
pqant / CKAD.md
Created November 1, 2019 07:52 — forked from veggiemonk/CKAD.md
CKAD exam preparation
@pqant
pqant / CKAD.md
Created November 1, 2019 07:52 — forked from veggiemonk/CKAD.md
CKAD exam preparation
@pqant
pqant / vagrant-cheat-sheet.md
Created September 14, 2019 21:21 — forked from wpscholar/vagrant-cheat-sheet.md
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
@pqant
pqant / how-to-set-up-stress-free-ssl-on-os-x.md
Created February 21, 2018 09:24 — forked from jed/how-to-set-up-stress-free-ssl-on-os-x.md
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@pqant
pqant / index.html
Created July 2, 2017 12:32
JS Bin this is just a console command reminder. // source https://jsbin.com/yevomic
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="this is just a console command reminder.">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
body {
color:red;