Skip to content

Instantly share code, notes, and snippets.

View anudit's full-sized avatar
🤌
Breaking and Buidling

Anudit Nagar anudit

🤌
Breaking and Buidling
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<meta name="author" content="">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
@anudit
anudit / update.py
Created October 4, 2019 13:08
Update all python packages using pip.
import pkg_resources
from subprocess import call
packages = [dist.project_name for dist in pkg_resources.working_set]
for packageName in packages:
call(f"pip install --upgrade {packageName}", shell=True)
@anudit
anudit / ngrok-fileserver.py
Created December 26, 2019 08:43
A Simple File Server with an exposed tunnel using Ngrok
'''
A simple file server with ngrok.
@requires
pip3 install --quiet flask flask-ngrok Flask-AutoIndex
Example: python3 ngrok-fileserver.py -d /content/
'''
import argparse
from os import getcwd
@anudit
anudit / ipfs-install.sh
Last active January 10, 2020 16:48
Install and Setup IPFS
wget https://dl.google.com/go/go1.13.5.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.13.5.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
source $HOME/.profile
sudo apt-get update
wget https://dist.ipfs.io/go-ipfs/v0.4.22/go-ipfs_v0.4.22_linux-amd64.tar.gz
tar xvfz go-ipfs_v0.4.22_linux-amd64.tar.gz
sudo mv go-ipfs/ipfs /usr/local/bin/ipfs
rm go1.13.5.linux-amd64.tar.gz
rm go-ipfs_v0.4.22_linux-amd64.tar.gz
@anudit
anudit / setup-dp.sh
Last active January 26, 2020 06:22
Setup Docker Playground for Heroku
apk add nodejs
apk add npm
curl https://cli-assets.heroku.com/install.sh | sh
@anudit
anudit / Counter.sol
Created February 1, 2020 13:04
A simple Solidity Contract for testing.
pragma solidity 0.4.24;
contract Counter {
int private count = 0;
event counterIncremented(int indexed cnt, uint _time);
event counterDecremented(int indexed cnt, uint _time);
function incrementCounter() public {
count += 1;
@anudit
anudit / app.py
Created May 17, 2020 12:59
Minimal python file upload
from flask import Flask, render_template, request
from werkzeug import secure_filename
app = Flask(__name__)
@app.route('/upload')
def upload_file():
return render_template('upload.html')
@app.route('/uploader', methods = ['GET', 'POST'])
def uploader():
@anudit
anudit / command.txt
Last active February 1, 2021 04:58
Setup Node 14, npm, yarn, make on Ubuntu 20 or WSL
bash <(curl -sL ${https://gist.githubusercontent.com/anudit/194f764c922d5329fe70ebdb3de65de4/raw/d0eb310ddf86a214843a8fa5701595c53dcfc2e4/setup.sh})