Skip to content

Instantly share code, notes, and snippets.

View 64lines's full-sized avatar

Julian Alexander Murillo 64lines

  • Huge Inc.
  • Medellin - Colombia
View GitHub Profile
@64lines
64lines / ruby_setup.sh
Last active July 4, 2017 14:35
[RUBY] - Install fluentd plugins on Ubuntu trusty
apt-get -y install software-properties-common
apt-add-repository ppa:brightbox/ruby-ng
sudo apt-get update
apt-get install -y ruby2.1 ruby2.1-dev libruby2.1
gem install fluent-plugin-postgres
@64lines
64lines / vagrant_commands.md
Created June 29, 2017 13:58
[VAGRANT] Useful vagrant commands

Useful Vagrant commands

vagrant up
vagrant ssh
vagrant reload
vagrant halt
vagrant destroy # Just for destroying the image
vagrant port    # Shows a list of the ports forwarded from the guest to the host machine
@64lines
64lines / Dockerfile
Created June 28, 2017 20:48
[Docker] Example Dockerfile
# Use an official Python runtime as a base image
FROM python:2.7-slim
# Set the working directory to /app
WORKDIR /app
# Copy the current directory contents into the container at /app
ADD . /app
# Install any needed packages specified in requirements.txt
@64lines
64lines / hello_world.js
Created June 28, 2017 16:06
[NODE] Hello world server
// Load the http module to create an http server.
var http = require('http');
// Configure our HTTP server to respond with Hello World to all requests.
var server = http.createServer(function (request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.end("Hello World\n");
});
// Listen on port 8000, IP defaults to 127.0.0.1
@64lines
64lines / installing_nginx.sh
Created June 27, 2017 14:20
[BASH] Nginx install and configuration
echo "*** Installing nginx packages... ***"
apt-get install -y nginx-core
mkdir /var/www/
echo "*** Setting stuff up... ***"
STATIC_NGINX_CONF="/etc/nginx/conf.d/static.conf"
echo "<h1>This is a static content server with nginx</h1>" >> /var/www/index.html
echo "server {" > $STATIC_NGINX_CONF
echo " listen 80;" >> $STATIC_NGINX_CONF
echo " location / {" >> $STATIC_NGINX_CONF
echo " root /var/www/;" >> $STATIC_NGINX_CONF
@64lines
64lines / docker_images.yaml
Created June 23, 2017 22:23
[ANSIBLE] Manage docker images
- name: pull an image
docker_image:
name: pacur/centos-7
- name: Tag and push to docker hub
docker_image:
name: pacur/centos-7
repository: dcoppenhagan/myimage
tag: 7.0
push: yes
@64lines
64lines / deb_basic_packages.sh
Last active June 21, 2017 00:43
Debian Basic Packages
apt-get update
apt-get install -y w3m vim docker nmap ngrep tmux
@64lines
64lines / docker_commands.md
Last active April 29, 2020 02:36
[DOCKER] Docker Useful Commands

Useful Docker commands

docker build -t friendlyname .                                       # Create image using this directory's Dockerfile
docker run -p 4000:80 friendlyname                                   # Run "friendlyname" mapping port 4000 to 80
docker run -d -p 4000:80 friendlyname                                # Same thing, but in detached mode
docker run -d -p 4000:80 -n containername friendlyname               # With the container name
docker run -dit --name apache2 apache2                               # Run in the background
docker ps                                                            # See a list of all running containers
docker stop <hash>                                                   # Gracefully stop the specified container
@64lines
64lines / vagrant_commands.sh
Created June 20, 2017 21:40
Vagrant Commands
vagrant up
vagrant ssh
vagrant reload
vagrant halt
vagrant destroy # Never ever...
proxy_cache_path /var/cache/nginx/sidebar levels=1:2 keys_zone=SIDEBAR:10m inactive=24h max_size=1g;
upstream sidebar {
ip_hash;
server xxx.xxx.xx.xxx:80;
server yyy.yyy.yy.yyy:80;
}
server {