Skip to content

Instantly share code, notes, and snippets.

@anandanand84
anandanand84 / inj.sh
Created June 15, 2023 15:05
Injective script
sudo parted /dev/sdc --script mklabel gpt mkpart xfspart xfs 0% 100%
sudo mkfs.xfs /dev/sdc1
sudo partprobe /dev/sdc1
mkdir /home/azureuser/.injectived
sudo mount /dev/sdc1 /home/azureuser/.injectived
sudo chown -R azureuser:azureuser /home/azureuser/.injectived/
sudo apt update
sudo apt install -y unzip wget
var publicKeyCredentialCreationOptions = {
challenge: Uint8Array.from(
"randomStringFromServer", c => c.charCodeAt(0)),
rp: {
name: "dev",
id: "developers.yubico.com",
},
user: {
id: Uint8Array.from(
"UZSL85T9AFC", c => c.charCodeAt(0)),
import asyncio
import websockets
import hashlib
import hmac
import base64
import time
import json
key = ''
secret = ''
host = 'wss://demo.dvchain.co/websocket'
@anandanand84
anandanand84 / Caddyfile
Created March 30, 2020 13:12
Docker and Caddy File for proxy Hasura Graphql
:8001 {
proxy /graphql :8080 {
without /graphql
websocket
}
proxy / :3001 {
}
}
@anandanand84
anandanand84 / nginx.conf
Created November 5, 2019 02:33
Simple nginx Webassembly
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
types {
application/wasm wasm;
}
import { PolymerElement, html } from 'https://unpkg.com/@polymer/polymer@3.0.0-pre.18/polymer-element.js';
const styleElement = document.createElement('dom-module');
styleElement.innerHTML =
`<template>
<style>
paper-button {
--paper-button: {
color : var(--theme-primary-text-color);
};
@anandanand84
anandanand84 / Makefile
Created May 1, 2018 23:37 — forked from itamarhaber/Makefile
Module development environment walkthrough
SHOBJ_CFLAGS ?= -fno-common -g -ggdb
SHOBJ_LDFLAGS ?= -shared -Bsymbolic
CFLAGS = -Wall -g -fPIC -lc -lm -Og -std=gnu99
CC=gcc
all: example.so
example.so: example.o
$(LD) -o $@ example.o $(SHOBJ_LDFLAGS) $(LIBS) -lc
04b219b7c8482b9652f3ba0124b4d245fe4eec64c40eece7d9362bff05d09cb243fed8a320d97518e09f4049206ec73f29aa8f8195fd23ac5b91204fcd8105d423
@anandanand84
anandanand84 / get_oracle_jdk_linux_x64.sh
Created May 1, 2017 13:11 — forked from n0ts/get_oracle_jdk_x64.sh
Get latest Oracle JDK package bash shell script
#!/bin/bash
# You must accept the Oracle Binary Code License
# http://www.oracle.com/technetwork/java/javase/terms/license/index.html
# usage: get_jdk.sh <ext> <jdk_version>
# ext: rpm
# jdk_version: default 8
ext=rpm
jdk_version=8
@anandanand84
anandanand84 / inference.py
Created April 24, 2017 16:42
Prediction of normalized data from tensorflow
#Actaul inference
square_sum = tf.reduce_sum(tf.square(x), axis=1, keep_dims=True)
sqrt = tf.sqrt(square_sum)
inv_sqrt = tf.rsqrt(square_sum)
normalized = tf.multiply(x, inv_sqrt)
infer_pred = BiRNN(normalized, weights, biases)
trend = tf.multiply(infer, sqrt)