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
Got error 'PHP message: PHP Notice: Undefined index: attributes in /home/imakr/public_html/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 529\nPHP message: PHP Notice: Undefined index: attributes in /home/imakr/public_html/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 556\nPHP message: PHP Notice: Undefined index: cms in /home/imakr/public_html/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 433\nPHP message: PHP Notice: Trying to get property of non-object in /home/imakr/public_html/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 433\nPHP message: PHP Notice: Trying to get property of non-object in /home/imakr/public_html/tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 433\nPHP message: PHP Notice: Undefined index: search_query in /home/imakr/public_html/tools/smarty/sysplugins/smarty_internal_templatebase.php(15
server {
listen 80;
server_name _;
location / {
root /var/www/html;
index index.html;
expires -1;
add_header Pragma "no-cache";
add_header Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0";
@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() {
Rollout post compile script
Rollout: going to generate structure and code
Rollout: using dsym generated by Xcode: "/Users/XXXX/Library/Developer/Xcode/DerivedData/YYY-hklmhitxgpbwmbfnqlkgfxroecpo/Build/Products/Debug-iphonesimulator/YYY.app.dSYM/Contents/Resources/DWARF/YYY"
tweaker error: ExtractSymbols generated errors: MethodsDumper: discovered 35 null compile units\nTypesDumper: discovered 35 null compile units\n
Command /bin/sh failed with exit code 13
#!/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)
Sentry.setCaptureListener(new SentryEventCaptureListener() {
@Override
public SentryEventBuilder beforeCapture(SentryEventBuilder builder) {
try {
PackageInfo pInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), PackageManager.GET_META_DATA);
builder.getTags().put("Build version", pInfo.versionName);
} catch (NameNotFoundException e) {}
return builder;