Skip to content

Instantly share code, notes, and snippets.

View gcamerli's full-sized avatar

G. Camerlingo gcamerli

View GitHub Profile
@gcamerli
gcamerli / docker_setup.sh
Last active February 24, 2023 10:31
Shell script to properly setup docker inside 42 clusters
#!/bin/sh
# sh docker_setup.sh
# Assuming you’re using zsh and you’ve already installed
# VirtualBox from MSC
LOGIN=$(whoami)
# Setup Brew
curl -fsSL https://rawgit.com/gcamerli/42brew/master/set.sh | zsh
@gcamerli
gcamerli / docker-clean.sh
Created July 9, 2018 20:31
Shell script to clean the space burnt by docker.
#!/bin/sh
# Clean containers
docker container prune -f
# Clean images
docker image prune -f
# Clean networks
docker network prune -f
@gcamerli
gcamerli / test-net.sh
Last active July 5, 2018 09:59
Docker bridge network.
#!/bin/bash
# ./docker-test-net.sh
# Create a test network with a subnet (e.g.)
docker network create --driver bridge --subnet 172.42.0.0/16 --gateway 172.42.0.1 test-net
# Run an nginx server on the test network assigning a static ip
docker run -d -h test --net test-net --ip 172.42.0.2 -p 8080:80 --name nginx nginx
@gcamerli
gcamerli / reset_attr.sh
Created June 14, 2018 18:43
Reset all extended attributes on the passed argument
#!/bin/sh
# ./reset_attr.sh $1
# Remove no-change attributes
chflags nouchg $1
# Remove extended attributes
xattr -rc $1
@gcamerli
gcamerli / hello.py
Last active March 2, 2018 15:48
Static page rendering from Flask
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "<h1>Hello World</h1>"
if __name__ == "__main__":
app.run(host='0.0.0.0', port=3000)
@gcamerli
gcamerli / py_virtualenv
Last active April 6, 2017 19:34
Shell script to set properly a virtual environment for python
#!/bin/sh
INIT_ENV=bootstrap
# Name your "bootstrap" environment
PYTHON=$(which python)
# Set python interpreter you want for your environment
URL_BASE=https://pypi.python.org/packages/source/v/virtualenv
# Set the package url
@gcamerli
gcamerli / keybase.md
Created November 9, 2016 12:54
Keybase proof

Keybase proof

I hereby claim:

  • I am gcamerli on github.
  • I am gcamerli (https://keybase.io/gcamerli) on keybase.
  • I have a public key ASCGqMERHavumfhrddd0un2LvF3nHc2gMzbWs5pC1M-KYAo

To claim this, I am signing this object: