Skip to content

Instantly share code, notes, and snippets.

View Shashwatsh's full-sized avatar

Shashwat Shagun Shashwatsh

View GitHub Profile
create VMs
git clone https://github.com/kubernetes-incubator/kargo.git
cd kargo
cp ~/inventory.cfg inventory/.
vi inventory.cfg
(copy IPs and save)
date
ansible-playbook -u centos -b -i inventory/inventory.cfg cluster.yml
date (show elapsed time)
@Shashwatsh
Shashwatsh / golang-tls.md
Created June 9, 2017 07:08 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@Shashwatsh
Shashwatsh / boid.js
Created April 18, 2017 15:05 — forked from brannondorsey/boid.js
Butterfly Habitat in Three.js
// by Joshua Koo @BlurSpline !!! http://www.joshuakoo.com/
// http://www.lab4games.net/zz85/blog/2013/12/30/webgl-gpgpu-and-flocking-part-1/
var Boid = function() {
var vector = new THREE.Vector3(),
_acceleration, _width = 500, _height = 500, _depth = 200, _goal, _neighborhoodRadius = 100,
_maxSpeed = 4, _maxSteerForce = 0.1, _avoidWalls = false;
this.position = new THREE.Vector3();
@Shashwatsh
Shashwatsh / README.md
Created April 4, 2017 20:47 — forked from oodavid/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@Shashwatsh
Shashwatsh / recover_source_code.md
Created March 17, 2017 14:19 — forked from simonw/recover_source_code.md
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
@Shashwatsh
Shashwatsh / samba-access.sh
Last active February 18, 2017 00:56 — forked from gugat/samba-access.sh
Script to install and configure Samba in Ubuntu.
#!/bin/bash
# Description: Script to install and configure Samba in Ubuntu.
# Author: Gustavo Salazar L.
# Date: 2013-03-27
#
# How to use:
# chmod +x samba-access.sh
# ./samba-access.sh PATH_TO_SHARED_DIRECTORY PERMISSIONS
@Shashwatsh
Shashwatsh / readme.md
Created December 29, 2016 11:24 — forked from endolith/readme.md
How to stream a webcam to a web browser in Ubuntu

Grr this took hours to figure out. I was trying to install MJPG-streamer and running VLC command lines and all this crap but nothing worked.

First install motion:

~> sudo apt-get install motion

Then create a config file:

~> mkdir ~/.motion

~> nano ~/.motion/motion.conf