Skip to content

Instantly share code, notes, and snippets.

View sovietspy2's full-sized avatar
💩
will code for food

Barney Dono sovietspy2

💩
will code for food
View GitHub Profile
@sovietspy2
sovietspy2 / bitcoinShellTicker.py
Created August 18, 2018 14:47 — forked from mattvukas/bitcoinShellTicker.py
A simple Python script that queries the Bitstamp API every 5 seconds and prints the last USD/Bitcoin price to the shell. Requires the Python Requests library.
import requests, json
from time import sleep
def getBitcoinPrice():
URL = 'https://www.bitstamp.net/api/ticker/'
try:
r = requests.get(URL)
priceFloat = float(json.loads(r.text)['last'])
return priceFloat
except requests.ConnectionError:
@sovietspy2
sovietspy2 / index.js
Created February 19, 2019 13:30
Now v2 local dev for Node.js
require("dotenv-safe").config();
const url = require("url");
const now = require("./now.json");
const routes = now.routes
.filter(route =>
now.builds.some(
build =>
build.src.startsWith(`${route.dest.substring(1)}/`) &&
@sovietspy2
sovietspy2 / screen.md
Created June 22, 2020 10:38 — forked from fredrick/screen.md
GNU Screen Cheat Sheet

#GNU Screen Cheat Sheet

##Basics

  • ctrl a c -> cre­ate new win­dow
  • ctrl a A -> set win­dow name
  • ctrl a w -> show all win­dow
  • ctrl a 1|2|3|… -> switch to win­dow n
  • ctrl a " -> choose win­dow
  • ctrl a ctrl a -> switch between win­dow
  • ctrl a d -> detach win­dow
@sovietspy2
sovietspy2 / docker-compose-mongo-replicaset.yml
Last active September 29, 2020 11:24 — forked from asoorm/docker-compose-mongo-replicaset.yml
Mongo Replica Set docker compose
STANDALONE -> REPLICA SET TUTORIAL
1. GENERATE KEY:
openssl rand -base64 756 > <path-to-keyfile>
chmod 400 file.key
2. MODIFY DOCKER COMPOSE
@sovietspy2
sovietspy2 / local-mongo-replicaset-with-docker
Created September 29, 2020 15:05 — forked from simon-contreras-deel/local-mongo-replicaset-with-docker
[Local mongo replicaset with docker] #docker #mongo
# pull the official mongo docker container
docker pull mongo
# create network
docker network create my-mongo-cluster
# create mongos
docker run -d --net my-mongo-cluster -p 27017:27017 --name mongo1 mongo mongod --replSet my-mongo-set --port 27017
docker run -d --net my-mongo-cluster -p 27018:27018 --name mongo2 mongo mongod --replSet my-mongo-set --port 27018
docker run -d --net my-mongo-cluster -p 27019:27019 --name mongo3 mongo mongod --replSet my-mongo-set --port 27019