Skip to content

Instantly share code, notes, and snippets.

@iCyberon
iCyberon / verify_certificate.go
Created November 13, 2019 13:26 — forked from devtdeng/verify_certificate.go
Verify a certificate with chain with golang crypto library
package main
import (
"crypto/x509"
"encoding/pem"
"io/ioutil"
"log"
"os"
)
@iCyberon
iCyberon / TestingRNGs.md
Created July 10, 2019 11:12 — forked from blixt/TestingRNGs.md
Testing random number generators with DieHarder

Testing RNGs with Dieharder

This guide is specifically for pseudo-random number generators (PRNGs) written in JavaScript, and tested in Mac OS X.

Prerequisites

Homebrew

@iCyberon
iCyberon / WireGuard_Setup.txt
Created April 30, 2019 18:29 — forked from chrisswanda/WireGuard_Setup.txt
Stupid simple setting up WireGuard - Server and multiple peers
Install WireGuard via whatever package manager you use. For me, I use apt.
$ sudo add-apt-repository ppa:wireguard/wireguard
$ sudo apt-get update
$ sudo apt-get install wireguard
MacOS
$ brew install wireguard-tools
Generate key your key pairs. The key pairs are just that, key pairs. They can be
@iCyberon
iCyberon / postgres_queries_and_commands.sql
Created September 14, 2016 04:14 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@iCyberon
iCyberon / global-variables-are-bad.js
Created April 17, 2016 15:25 — forked from hallettj/global-variables-are-bad.js
How and why to avoid global variables in JavaScript
// It is important to declare your variables.
(function() {
var foo = 'Hello, world!';
print(foo); //=> Hello, world!
})();
// Because if you don't, the become global variables.
(function() {
#!/bin/sh
#
# Postgresql backup script
# http://www.bitweaver.org/wiki/pg_backup+PostgreSQL+backup+script
#
# Author
# |
# +-- speedboy (speedboy_420 at hotmail dot com)
# +-- spiderr (spiderr at bitweaver dot org)
# +-- flexiondotorg (code at flexion dot org)
@iCyberon
iCyberon / nsolid-install.sh
Created January 19, 2016 21:41 — forked from pmuellr/nsolid-install.sh
sample script to install N|Solid components into ~/nsolid
#!/bin/bash
#-------------------------------------------------------------------------------
# download/unpack componentry for N|Solid into ~/nsolid
#-------------------------------------------------------------------------------
# updates:
# 2016-01-12 upgrade to N|Solid 1.2.0
# 2015-12-04 upgrade to N|Solid 1.1.1
# 2015-11-18 upgrade to N|Solid 1.1.0
# 2015-10-20 first published
@iCyberon
iCyberon / using-raw-socket-io-in-sails.js
Last active August 29, 2015 14:27 — forked from mikermcneil/using-raw-socket-io-in-sails.js
Using raw socket.io functionality in a Sails.js controller
module.exports = {
/**
*
* Using raw socket.io functionality from a Sails.js controller
*
*/
index: function (req,res) {