Skip to content

Instantly share code, notes, and snippets.

export function world(){
return "hello Sean";
}
@akashgoswami
akashgoswami / nsim
Last active September 6, 2021 19:16
nsim demo
function hello() {
return 'World';
}
export { hello };
@akashgoswami
akashgoswami / js-processor.js
Last active August 28, 2021 11:02
A simple NATS.io jetstream publish/subscribe example in nats.js
const { connect, JSONCodec, AckPolicy } = require("nats");
async function main(count = 1000){
const nc = await connect(['nats://localhost:4222']);
// create a jetstream client:
const jsm = await nc.jetstreamManager();
console.log("JSM connected");
await jsm.consumers.add("results", {
@akashgoswami
akashgoswami / Server.java
Created December 1, 2018 20:39 — forked from rostyslav/Server.java
Sample TCP server
import java.io.*;
import java.nio.*;
import java.nio.channels.*;
import java.net.*;
import java.util.*;
import java.nio.charset.*;
public class Server {
public Selector sel = null;
@akashgoswami
akashgoswami / how-to-install-latest-gcc-on-ubuntu-lts.txt
Created September 24, 2018 14:29 — forked from application2000/how-to-install-latest-gcc-on-ubuntu-lts.txt
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@akashgoswami
akashgoswami / script.sh
Created July 2, 2018 08:43
Bash script to wait for IOTIFY API
#!/bin/bash
# Provide your API Token
TOKEN=
# Provide the name of the template
TEMPLATE=hive
STATUS="pending"
#Invoke the run
RESULT=$(curl -X POST --silent -H "Content-Type: application/json" -H "X-Auth:$TOKEN" \
-d '{"template": "'$TEMPLATE'", "repeat": 5, "interval":10, "clients":1 }' \
---- install Oracle JDK 1.8
$ wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u141-b15/336fa29ff2bb4ef291e347e091f7f4a7/jdk-8u141-linux-x64.rpm
$sudo yum install -y jdk-8u141-linux-x64.rpm
---- install OpenJDK
$ vi install.sh
yum install -y java-1.8.0-openjdk-devel
yum remove java-1.7.0-openjdk
wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
@akashgoswami
akashgoswami / install-scylla-on-aws-with-dpdk.sh
Created June 2, 2018 21:47 — forked from dbathgate/install-scylla-on-aws-with-dpdk.sh
Installing ScyllaDB in AWS with DPDK enabled
# Installing ScyllaDB in AWS with DPDK enabled
# Prerequisites:
# - Red Hat Enterprise Linux 7.2 (HVM)
# - Instance type that supports enhanced networking (see http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/enhanced-networking.html#enhanced_networking_instance_types)
# - Secondary NIC installed via Network Interfaces in AWS
# - Instance type with 2 hard drives for RAID0 array
########## DO THIS FIRST ################
# Fetch the latest linux kernel
yum update -y

Redis Cluster Setup with Docker Swarm

Setup

./redis.sh

Test

test the redis cluster

Updated the address as per transition phase.
Please send your donation to IOTA peer manager development at following address
HRFEUTWRFOWRJQWRTQRINKWLMOFO9BTGAFCSSFLXAYLLSZPNKJUBGYKXFHGENPZCROFESEYQPBVBFHSDBBEGUK9OKA
Many thanks in advance!