Skip to content

Instantly share code, notes, and snippets.

@trasherdk
trasherdk / self-signed-certificate-with-custom-ca.md
Created December 14, 2018 01:46 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@trasherdk
trasherdk / PushNotifications.php
Created November 7, 2018 05:04 — forked from joashp/PushNotifications.php
Simple PHP script to send Android Push Notification, iOS Push Notification and Windows Phone 8 Push Notification
<?php
// Server file
class PushNotifications {
// (Android)API access key from Google API's Console.
private static $API_ACCESS_KEY = 'AIzaSyDG3fYAj1uW7VB-wejaMJyJXiO5JagAsYI';
// (iOS) Private key's passphrase.
private static $passphrase = 'joashp';
// (Windows Phone 8) The name of our push channel.
private static $channelName = "joashp";
@trasherdk
trasherdk / openssl_encrypt_decrypt.php
Created November 7, 2018 04:59 — forked from joashp/openssl_encrypt_decrypt.php
Simple PHP encrypt and decrypt using OpenSSL
<?php
/**
* simple method to encrypt or decrypt a plain text string
* initialization vector(IV) has to be the same when encrypting and decrypting
*
* @param string $action: can be 'encrypt' or 'decrypt'
* @param string $string: string to encrypt or decrypt
*
* @return string
*/
@trasherdk
trasherdk / .block
Last active September 11, 2018 02:44
D3 OHLC Chart with Random data
license: mit
@trasherdk
trasherdk / .block
Last active September 11, 2018 03:04
chart.js block #1 XMR-EUR Hourly
license: mit
@trasherdk
trasherdk / .block
Last active September 24, 2018 04:45
chart.js block #1 XMR-EUR Intraday
license: mit
@trasherdk
trasherdk / randommac.sh
Created June 10, 2017 17:15 — forked from WebReflection/randommac.sh
Getting free wifi on Linux too
#!/usr/bin/env bash
# @example
# chmod a+x randommac.sh
# ./randommac.sh wlp2s0
# @credits original macOS / osX version via @rem
# https://remysharp.com/2017/05/29/getting-free-wifi
if [ "$1" != "" ]; then