Skip to content

Instantly share code, notes, and snippets.

@lontivero
lontivero / Program.cs
Created December 14, 2013 03:43
Shows how to manipulate raw wcf messages per operation.
using System;
using System.IO;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Dispatcher;
using System.Text;
using System.Text.RegularExpressions;
using System.Xml;
using TinyClient.CustomerService;
@lontivero
lontivero / gist:593fc51f1208555112e0
Last active September 6, 2024 17:24
Generates Markdown from VS XML documentation file
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Xml;
using System.Xml.Linq;
namespace GithubWikiDoc
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using Open.Nat;
namespace ConsoleApplication3
{
class Program
@lontivero
lontivero / brainfuck.coffee
Last active July 12, 2016 00:58
My Brainfuck language interpreter in exactly 19 LOC
run=(code, input)->
[dptr, cptr, marks, mem, output, stack]=[0, 0, [], (0 for [1..100]), [], []]
for cmd, pos in code
if cmd is '[' then stack.push(pos)
if cmd is ']' then marks[marks[pos] = stack.pop()]=pos
while cptr < code.length
switch code[cptr]
when '+' then mem[dptr] = mem[dptr] + 1 or 1
@lontivero
lontivero / SchnorSignatureBatchVerification.py
Created July 31, 2018 17:36
Verify schnorr signatures in batch
import hashlib
import binascii
p = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F
n = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141
G = (0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798, 0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8)
def point_add(p1, p2):
if (p1 is None):
return p2
@lontivero
lontivero / Vagrantfile
Created August 2, 2018 18:45
Install VirtaulBox VM with Wasabi Wallet install
require 'fileutils'
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.provider "virtualbox" do |vb|
vb.memory = "4096"
vb.gui = true
@lontivero
lontivero / dumpheap.sh
Last active January 9, 2019 19:16
Dumps a .NET memory heap
#!/bin/bash
sudo lldb-4.0 -o "process attach -p $1" \
-o "plugin load /usr/share/dotnet/shared/Microsoft.NETCore.App/2.2.0/libsosplugin.so" \
-o "sos DumpHeap -stat" \
-o "exit"
@lontivero
lontivero / wasabi-install.sh
Last active February 5, 2019 14:04
Wasabi Wallet Installer Script v1.0
set -e
wget https://github.com/zkSNACKs/WalletWasabi/releases/download/v1.1.0/WasabiLinux-1.1.0.tar.gz{,.asc}
gpg --keyserver pgp.mit.edu --recv-keys B4B72266C47E075E
gpg --verify WasabiLinux-1.1.0.tar.gz{.asc,}
tar -xf WasabiLinux-1.1.0.tar.gz
@lontivero
lontivero / wasabi-perf.sh
Created November 26, 2018 03:23
Runs and measure performace
#!/bin/bash
COMPlus_PerfMapEnabled=1 dotnet ~/GitHub/WalletWasabi/WalletWasabi.Gui/bin/Debug/netcoreapp2.1/WalletWasabi.Gui.dll &
sudo perf record -p $! -g
sudo perf script -f | ~/GitHub/FlameGraph/stackcollapse-perf.pl | ~/GitHub/FlameGraph/flamegraph.pl > flame.svg
sudo python -m SimpleHTTPServer 80