Skip to content

Instantly share code, notes, and snippets.

@dvas0004
dvas0004 / decompiler.py
Created Oct 26, 2018
grpc-web reverse engineer
View decompiler.py
import jsbeautifier
import requests
import pprint
enumerateMessagesSearchString = 'exportSymbol("proto.'
r = requests.get('http://localhost:8081/dist/main.js')
jsInput = r.text
pretty_js = jsbeautifier.beautify(jsInput).split('\n')
View sslCertificatTranparency.go
package main
import (
"bytes"
"crypto/sha256"
"encoding/base64"
"encoding/json"
"fmt"
"net/http"
"strings"
View howto_python_flask_iis_wfastcgi.md

Assume IIS is installed. My machine already had IIs 8.5.

DV : Adding some notes when using MS IIS Express 10

Install Python

  1. Download web installer (Python 3.6.3).
  2. Run as Administrator.
  3. Select custom installation for all users.
  4. Choose install directory such that there are no white spaces in the path. Not sure if it needs to be done. Just being cautious.
View main.go
package main
import (
"bytes"
"encoding/json"
"fmt"
"log"
"net/http"
"strconv"
"sync"
@dvas0004
dvas0004 / DefaultRouter.kt
Last active Oct 7, 2020
A clear, simple example of multipart file upload using Reactive Spring (http://blog.davidvassallo.me/2018/07/09/reactive-spring-webflux-multipart-file-upload/)
View DefaultRouter.kt
package com.example.FileUploadExample
import com.example.FileUploadExample.HomeHandler
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.http.MediaType
import org.springframework.web.reactive.function.server.HandlerFunction
import org.springframework.web.reactive.function.server.RequestPredicates
import org.springframework.web.reactive.function.server.RouterFunction
import org.springframework.web.reactive.function.server.RouterFunctions
@dvas0004
dvas0004 / daveOLED.py
Created Mar 9, 2014
raspi pi OLED code showing IP and temperature + humidity
View daveOLED.py
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Meant for use with the Raspberry Pi and an Adafruit monochrome OLED display!
# This was coded by David Vassallo, modified from code by The Raspberry Pi Guy
# Imports all of the necessary modules
import gaugette.ssd1306
import time
View ble_demo.java
package com.sixpmplc.ble_demo;
import android.annotation.TargetApi;
import android.app.Activity;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCallback;
import android.bluetooth.BluetoothGattCharacteristic;
import android.bluetooth.BluetoothGattDescriptor;
View reverseCssSelector.js
var TopLevelObject = {}
TopLevelObject.DOMNodePathStep = function(value, optimized)
{
this.value = value;
this.optimized = optimized || false;
}
TopLevelObject.DOMNodePathStep.prototype = {
/**
* @override
* @return {string}
View android_to_ubuntu.py
from bluetooth import *
import sys
from subprocess import call
if sys.version < '3':
input = raw_input
addr = None
@dvas0004
dvas0004 / eidVerifySignature.py
Created Feb 25, 2019
python script to verify ECDSA signatures generated from the newer Estonian eID cards. Signature and Certificate must be obtained from eID itself, eg by using: https://hwcrypto.github.io/demo/
View eidVerifySignature.py
# pip install ecdsa
# pip install cryptography
# https://github.com/warner/python-ecdsa
# https://cryptography.io/en/latest/
from ecdsa import VerifyingKey, BadSignatureError
from cryptography import x509