Skip to content

Instantly share code, notes, and snippets.

View jningtho's full-sized avatar

Jassy Ningthoujam jningtho

View GitHub Profile
@jningtho
jningtho / xmr-stak_cuda_setup.md
Created September 23, 2021 13:17 — forked from stackexchange3301/xmr-stak_cuda_setup.md
Setting up xmr-stak miner on Ubuntu 18.04 with Nvidia card(s)

I wrote this tutorial because I've seen bits and chips of this topic, but never a full tutorial (especially not an up-to-date one).

This tutorial is intented for miners who want to mine Monero (or any other coin supported by xmr-stak) on a Ubuntu based system, with Nvidia cards (note: the tutorial works fine with CPU-only mining, just skip the driver installing part, and use -DCUDA_ENABLE=OFF -DOpenCL_ENABLE=OFF flags for cmake)

I assume You have a fresh install of Ubuntu, make sure Your system is up-to-date

sudo apt update && sudo apt upgrade

Install the latest version of the Nvidia driver avialable in the apt repository (which is 384 as of now)

@jningtho
jningtho / .babelrc
Created June 14, 2020 17:50 — forked from federicofazzeri/.babelrc
Node Express-based REST API (CRUD) using Firebase cloud Functions and FireStore cloud database + Babel config (The current Node version running in Cloud Functions is 6.10)
{
"presets": [
["env", {
"targets": {
"node": "6.10"
}
}]
]
}
@jningtho
jningtho / takeoff_and_land.py
Created June 5, 2019 10:48 — forked from dbaldwin/takeoff_and_land.py
Basic takeoff to 20m and land with DroneKit, Raspberry Pi and Pixhawk
from dronekit import connect, VehicleMode, LocationGlobalRelative
from pymavlink import mavutil
import time
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--connect', default='127.0.0.1:14550')
args = parser.parse_args()
# Connect to the Vehicle
@jningtho
jningtho / write-to-firebase.js
Created May 14, 2019 15:34 — forked from magician11/write-to-firebase.js
Writing data to Firebase from Node.js
const admin = require('firebase-admin');
admin.initializeApp({
credential: admin.credential.cert('./movies-387bf-firebase-adminsdk-4hoi8-c52699119b.json'),
databaseURL: 'https://movies-387bf.firebaseio.com',
});
// Get a database reference to our blog
const db = admin.database();
@jningtho
jningtho / git-deployment.md
Created February 10, 2019 03:58 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your lokal GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like my Deepl.io to act upon a Web-Hook that's triggered that service.

@jningtho
jningtho / d3-server.js
Created February 9, 2019 09:43 — forked from caged/d3-server.js
Directly render and serve d3 visualizations from a nodejs server.
// Start `node d3-server.js`
// Then visit http://localhost:1337/
//
var d3 = require('d3'),
http = require('http')
http.createServer(function (req, res) {
// Chrome automatically sends a requests for favicons
// Looks like https://code.google.com/p/chromium/issues/detail?id=39402 isn't
// fixed or this is a regression.
@jningtho
jningtho / user-data bootstrap
Last active September 12, 2018 15:17
AWS Associate Training
Bootstraping https service while launching Amazon AMI EC2 instance
#!/bin/bash
sudo yum update -y
sudo yum install httpd -y
service httpd start
@jningtho
jningtho / nginx.conf
Created July 30, 2018 08:14 — forked from nrollr/nginx.conf
NGINX config for SSL with Let's Encrypt certs
# Advanced config for NGINX
server_tokens off;
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options nosniff;
# Redirect all HTTP traffic to HTTPS
server {
listen 80;
server_name www.domain.com domain.com;
return 301 https://$host$request_uri;
@jningtho
jningtho / letsencrypt_2018.md
Created July 6, 2018 11:47 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@jningtho
jningtho / certbot-renew.sh
Created June 3, 2018 15:11 — forked from printminion/certbot-renew.sh
renew ssl letsencrypt certificate on bitnami server
#!/bin/bash
#renew ssl letsencrypt certificate on bitnami server
#https://gist.github.com/printminion/6ec2fc0fefaba8e0a98a63a6d73b0802/edit
sudo /opt/bitnami/ctlscript.sh stop apache
cd /home/user/certbot
#./certbot-auto certonly --standalone -w /opt/bitnami/apache2/conf/ -d example
.com -d www.example.com
./certbot-auto renew
sudo cp /etc/letsencrypt/live/example.com/fullchain.pem /opt/bitnami/apache2/conf/server.crt