Skip to content

Instantly share code, notes, and snippets.

View farazdagi's full-sized avatar

Victor Farazdagi farazdagi

View GitHub Profile
package initialsync
import (
"bytes"
"context"
"encoding/hex"
"fmt"
"time"
"github.com/libp2p/go-libp2p-core/peer"
#! /bin/bash
USER=$1
PASS=$2
usermod --password $(echo $PASS | openssl passwd -1 -stdin) $USER
@farazdagi
farazdagi / clickjack.js
Created February 14, 2018 06:10
External JS code for ClickJacking project (CS6262)
alert("clickjack");
0xadaf150b905cf5e6a778e553e15a139b6618bbb7
// jail.Send() expects to find the current message id in `status.message_id`
// (if not found message id will not be injected, and operation will proceed)
var status = {
message_id: '42' // global message id, gets replaced in sendTransaction (or any other method)
};
var _status_catalog = {
commands: {},
responses: {}
};
@farazdagi
farazdagi / esenio-widget-sample.html
Created December 19, 2015 08:15
How to include Esenio widget on your own web-site.
<script>
(function(window, undefined) {
window.esenio = window.esenio || {};
window.esenio.url = 'https://events.esen.io';
window.esenio.eventSlug = 'demo';
window.esenio.widgetWidth = '100%';
window.esenio.widgetHeight = undefined;
document.writeln('<script src="' + window.esenio.url + '/scripts/widget.js"><\/script>');
}(window));
</script>
@farazdagi
farazdagi / gist:b60972f006fb272c2fc8
Last active September 12, 2015 12:07 — forked from siddarth/gist:6241382
Stripe FX: Getting the converted amount from the BalanceTransaction

Creating a USD charge on a GBP account:

$ curl https://api.stripe.com/v1/charges \
    -u REDACTED: \
    -d amount=400 \
    -d currency=usd \
    -d card[number]=4242424242424242 \
    -d card[exp_month]=04 \
    -d card[exp_year]=16 \

-d card[cvv]=390 \

@farazdagi
farazdagi / bitonic.go
Created September 3, 2015 15:22
Bitonic Sorter in Go
package bitonic
const (
SORT_ASC bool = true
SORT_DESC bool = false
)
var lst []int
func Sort(input []int, dir bool) {
### Keybase proof
I hereby claim:
* I am farazdagi on github.
* I am farazdagi (https://keybase.io/farazdagi) on keybase.
* I have a public key whose fingerprint is 0F9C BFAE 03CD 209B 51E7 D19F BA58 0291 4C6B 4732
To claim this, I am signing this object: