Skip to content

Instantly share code, notes, and snippets.

Vincent Viallet zbal

Block or report user

Report or block zbal

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
@zbal
zbal / Dockerfile
Created Jan 28, 2019
Dockerfile - Multi step build process for node.js
View Dockerfile
# One single Dockerfile with a multi step build process
# 1. build all native extensions, dependencies, etc.
# 2. copy resulting files into a clean container
FROM node:10-alpine as builder
# Add core packages to allow building native extensions
RUN apk add --no-cache make gcc g++ python
RUN npm install -g yarn
WORKDIR /src
COPY package.json yarn.lock /src/
@zbal
zbal / README.md
Created Jan 15, 2019 — forked from xuqingfeng/README.md
Demo terraform script for spawning k8s multi AZ cluster in AliCloud
View README.md

Install terraform

Refer to the official documentation and download page:

Configure

export ALICLOUD_ACCESS_KEY="anaccesskey"
export ALICLOUD_SECRET_KEY="asecretkey"
View gist:60fe043de880f4050db5
# Prepare the app
- run: devops nodejs app add
options:
name: "{{ app_name }}"
root: /opt/{{ app_name }}/bundle
script: main.js
node_env: prod
user: devops
extra_env: >
"PORT=3000
View nginx_release.sh
#!/bin/bash
#####
# Builds a custom nginx
#
RELEASE_TAGS="+lua+$(lsb_release -s -c)"
RELEASE_MAINTAINER=
RELEASE_MAINTAINER_EMAIL=
RELEASE_MESSAGE="Add LUA support to nginx"
#
View gist:8643893
---
some:
thing: is
awesome:
- that
- is
- an
- array
View gist:7800423
# Based on https://gist.github.com/fernandoaleman/5083680
# Start the old vagrant
$ vagrant init ubuntu_saucy
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
View gist:6971545
Option 1 - using a class:
def run(env, command, args):
plugin = Plugin(env)
# Check if the command is defined in the plugin
if 'do_'+ command not in dir(plugin):
return False
# Call function
getattr(plugin, 'do_'+ command)(args)
@zbal
zbal / gist:6724926
Last active Nov 7, 2016
new Dockerfile based on the previous base image
View gist:6724926
FROM id_from_prev_build_image
MAINTAINER me@example.com
RUN apt-get update
RUN apt-get upgrade -y
RUN echo 'toto' > /test
@zbal
zbal / gist:6724907
Created Sep 27, 2013
base Dockerfile
View gist:6724907
FROM ubuntu:precise
MAINTAINER me@example.com
# Prepare chinese apt mirror - upgrade to latest
RUN printf "deb http://mirrors.163.com/ubuntu precise main\ndeb http://mirrors.163.com/ubuntu/ precise universe\n" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get upgrade -y
# Cheat upstart
RUN dpkg-divert --local --rename --add /sbin/initctl
@zbal
zbal / gist:6172020
Last active Dec 20, 2015
rename - delete - create -- git ...
View gist:6172020
Vincents-MacBook-Pro:sandbox balou$ git init
Initialized empty Git repository in /Users/balou/workspace/sandbox/.git/
Vincents-MacBook-Pro:sandbox balou$ vim a
Vincents-MacBook-Pro:sandbox balou$ cat a
aaaaa
Vincents-MacBook-Pro:sandbox balou$ git add a
Vincents-MacBook-Pro:sandbox balou$ git status
# On branch master
#
You can’t perform that action at this time.