Skip to content

Instantly share code, notes, and snippets.

💭
Looking for cool hardware projects

Shantam Raj armsp

💭
Looking for cool hardware projects
Block or report user

Report or block armsp

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@armsp
armsp / fontawesome-github.svg
Last active Mar 5, 2020
Gist for seeing the difference in Chrome and Firefox renderings for a two.js project
View fontawesome-github.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@armsp
armsp / username@hostname.py
Created Nov 11, 2019
Generate cool <username>@<hostname> like Docker does using Python
View username@hostname.py
import random
left = ["admiring",
"adoring",
"affectionate",
"agitated",
"amazing",
"angry",
"awesome",
"beautiful",
View Model+Predictive+Control+for+Closed+Loop+Insulin+Delivery-4.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@armsp
armsp / query.md
Last active Feb 8, 2020
GraphQL query to get user statistics like total followers, stargazers, watchers, issues, pull requests
View query.md
query {
  user(login:"<any user name>"){               #Use "viewer" if you want to run it on your profile
    repositories(orderBy: {field: STARGAZERS, direction: DESC}){
      totalCount
    }
    followers{
      totalCount
    }
    issues_sum:issues{
@armsp
armsp / highqualitygif.md
Last active Jan 14, 2019
How to create high quality gifs for Github READMEs
View highqualitygif.md

Steps:

  • Record a asciicast file

    • Use termtosvg record <outputfilename.cast> to record a asciicast file
    • Alternatively use asciinema rec to do the same i.e get an asciicast file
  • Then use asciicast2gif <asciicastfilename.cast> <outputfilename.gif> to convert asciicast to high quality gif

@armsp
armsp / Dockerfile
Created Dec 12, 2018
Gist containing simple Dockerfile and steps to run GUI from a docker container
View Dockerfile
#FROM python:3.7 ## Works with either of the base images. Size is larger with Python due to there being python2.7 too
FROM ubuntu:18.10
RUN apt-get update && apt-get upgrade -y
RUN apt-get install python3-dev python3-pip -y
RUN apt-get install python3-gi -y && \
apt-get install gir1.2-gtk-3.0 -y && \
apt-get install gir1.2-appindicator3-0.1 -y
@armsp
armsp / 30-randomize-mac-address.conf
Created Dec 9, 2018 — forked from paulfurley/30-randomize-mac-address.conf
MAC address randomization in Ubuntu 17+ (>= 1.4.1): save to /etc/NetworkManager/conf.d/
View 30-randomize-mac-address.conf
# /etc/NetworkManager/conf.d/30-randomize-mac-address.conf
# REQUIRES NETWORK MANAGER >= 1.4.1 (Ubuntu Zesty and above)
# Thanks to https://blogs.gnome.org/thaller/2016/08/26/mac-address-spoofing-in-networkmanager-1-4-0/
# This randomize your MAC address for *new* connections
# Be sure to change your existing (saved) connections in
# /etc/NetworkManager/system-connections/*
@armsp
armsp / punch.py
Created Aug 29, 2018 — forked from koenbollen/punch.py
Proof of Concept: UDP Hole Punching
View punch.py
#!/usr/bin/env python
#
# Proof of Concept: UDP Hole Punching
# Two client connect to a server and get redirected to each other.
#
# This is the client.
#
# Koen Bollen <meneer koenbollen nl>
# 2010 GPL
#
@armsp
armsp / HTTP status codes.md
Created Aug 26, 2018
Proper way to return HTTP status codes with custom messages when a restful API on Flask server fails while processing inputs.
View HTTP status codes.md

HTTP Error Codes

  • 1xx : Informational
  • 2xx : Success
  • 3xx : Redirection
  • 4xx : Client Error
  • 5xx : Server Error

HTTP Status Codes from MDN

200 OK

@armsp
armsp / Dockerfile
Last active Aug 25, 2018
Dockerfile to install python, pandas, sklearn, numpy, scipy on a ubuntu 18.10 container (works under restricted ssl certificate environments too)
View Dockerfile
FROM ubuntu:18.10
RUN apt-get update && apt-get upgrade -y \
&& apt-get install -y --no-install-recommends apt-utils software-properties-common wget \
&& apt-get install -y build-essential python3 python3-distutils \
&& wget --no-check-certificate https://bootstrap.pypa.io/get-pip.py \
&& python3 get-pip.py --trusted-host pypi.org --trusted-host files.pythonhosted.org
#RUN apt-get install python3.6 python-pip
#RUN python -m pip install pip --upgrade
#RUN python -m pip install wheel
#RUN apt-get install -y python3-numpy
You can’t perform that action at this time.