Skip to content

Instantly share code, notes, and snippets.

public async Task<HttpResponseMessage> Post(string name)
{
var response = "Success!";
var httpResponse = new HttpResponseMessage(HttpStatusCode.OK);
httpResponse.Headers.ConnectionClose = true;
string body = Request.Content.ReadAsStringAsync().Result;
// Do your thing with the body content
// Update the response
// Add function to set required google event parameters
stopPropagation : function (e){
if(!e){
e=window.event;
}
e.cancelBubble=true;
if(e.stopPropagation){
e.stopPropagation();
}

Keybase proof

I hereby claim:

  • I am auronmatrix on github.
  • I am a21n (https://keybase.io/a21n) on keybase.
  • I have a public key ASCmTzDUMta-F6VonB2oJiTY67L1i4-fdKyU4-VlvJgx0go

To claim this, I am signing this object:

@Auronmatrix
Auronmatrix / authorize.js
Created March 9, 2018 15:35
Google Oauth for Nodejs
// Authorization code extracted from google quickstart guide
// https://developers.google.com/sheets/api/quickstart/nodejs
const fs = require('fs')
const readline = require('readline')
const { OAuth2Client } = require('google-auth-library')
// If modifying these scopes, delete your previously saved credentials
// at ~/.credentials/sheets.googleapis.com-nodejs-quickstart.json
const SCOPES = ['https://www.googleapis.com/auth/spreadsheets']
#!/bin/bash
for d in */ ; do
cd $d
if [ -d .git ];
then
TAG=$(git describe --abbrev=0 --tags 2>/dev/null)
if [[ $TAG =~ ^v ]];
then
echo "$d : $TAG"
@Auronmatrix
Auronmatrix / index.sh
Created October 19, 2018 10:37 — forked from max-mapper/index.sh
generate ES512 and RS256 elliptic curve keypairs for JWT JWK (JSON Web Token JSON Web Key) using openssl
# RS256
# private key
openssl genrsa -out rs256-4096-private.rsa 4096
# public key
openssl rsa -in rs256-4096-private.rsa -pubout > rs256-4096-public.pem
# ES512
# private key
openssl ecparam -genkey -name secp521r1 -noout -out ecdsa-p521-private.pem
# public key
@Auronmatrix
Auronmatrix / recursive_check.sh
Last active November 27, 2018 10:35
BashScript to check all subfolders for compromised dependency (https://github.com/dominictarr/event-stream/issues/116)
#!/bin/bash
function recursiveCheck() {
for d in * ; do
if [ $d == "node_modules" ] ; then
#echo "Skipping $PWD"
else if [ -d "$d" ]; then
cd "$d"
#echo "Checking $PWD"
if [ -f "package.json" ];
@Auronmatrix
Auronmatrix / gist:efd8925a1ae02e93eb6a837415b96f80
Created January 24, 2019 13:23
Check certificate expiration
openssl x509 -enddate -noout -in certificate.pem
# Must be run as sudo
# Install Java 1.8
## Download Java tar and extract
cd /opt/
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "https://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-linux-x64.tar.gz"
tar xzf jdk-8u201-linux-x64.tar.gz
## Configure alternatives
cd jdk1.8.0_201/
@Auronmatrix
Auronmatrix / README.md
Last active June 26, 2019 07:50
DASH - Difficulty Drop (v0.13.3) after DIP8 Activation - Potential Network Segmentation

DASH Difficulty Drop Post Mortem & Potential Network Segmentation

Issue

Around 17.06.2019 our DASH node started showing some strange behaviour. When requesting blocks from the node, their reported difficulty was around ~50x lower than the actual network.

Average Daily Dash Difficulty

|Date | Difficulty|