Skip to content

Instantly share code, notes, and snippets.

View cescoferraro's full-sized avatar
🏠
Working from home

cesco cescoferraro

🏠
Working from home
View GitHub Profile
@cescoferraro
cescoferraro / worker.form.tsx
Created February 23, 2017 02:09
testador de cpf.js
const TestaCPFFunction = (strCPF) => {
let Soma;
let Resto;
Soma = 0;
if (strCPF == "00000000000") {
return false
}
for (let i = 1; i <= 9; i++) {
Soma = Soma + parseInt(strCPF.substring(i - 1, i)) * (11 - i);
package image
import (
"io"
"os"
"strings"
"archive/tar"
"bytes"
"io/ioutil"
FROM alpine:3.4
RUN apk add --no-cache ca-certificates apache2-utils
ADD ./dist/bin/goapp /bin/goapp
CMD ["/bin/goapp"]
@cescoferraro
cescoferraro / Dockerfile.dev
Created October 11, 2016 13:20
GLIDE INSTALL DOCKERFILE
# GLIDE INSTALLATION
#WORKDIR /tmp
# RUN curl -sL https://github.com/Masterminds/glide/releases/download/v0.12.3/glide-v0.12.3-linux-amd64.tar.gz | tar xvz
# RUN chmod +x /tmp/linux-amd64/glide
# RUN mv /tmp/linux-amd64/glide /usr/local/bin/glide
# RUN chmod +x /usr/local/bin/glide
# RUN glide install
@cescoferraro
cescoferraro / kubelet wrapper
Last active September 16, 2016 00:47
core os
[Unit]
Description=Kubernetes Kubelet
After=docker.service
Requires=docker.service
[Service]
User=root
EnvironmentFile=/home/core/environment
Environment=KUBELET_VERSION=v1.3.6_coreos.0
Environment="RKT_OPTS=--volume=kubeconfig,kind=host,source=/home/core/.kube/config \
FROM ubuntu:14.04
MAINTAINER Francesco Ferraro <francescoaferraro@gmail.com>
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y curl
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
RUN DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:masterminds/glide
RUN DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:ubuntu-lxc/lxd-stable
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y git
---
apiVersion: v1
kind: Service
metadata:
name: tech-blog
namespace: blog
labels:
name: tech-blog
romulus/route: public
romulus/lb: vulcan
@cescoferraro
cescoferraro / cloud-config kubernetes on coreos
Last active March 22, 2016 14:01
All necessary binaries to run Kubernetes on CoreOS from https://github.com/cescoferraro/kube/ because the original releases link keep crashing on Digital Ocean
# this clone the repo at /opt/bin which is under the $PATH buy may conflict \
with existing copies of these binaries on core os machines \
while on a shell environment. Service files should use absolute path anyway. \
Keep that in mind when sshing into the servers
TODO : Create a service that remove the installation binaries
- name: binaries.service
command: start
content: |
core@coreos2 ~ $ export ETCDCTL_CERT_FILE=/home/core/ssl/etcd1.pem
core@coreos2 ~ $ export ETCDCTL_KEY_FILE=/home/core/ssl/etcd1-key.pem
core@coreos2 ~ $ export ETCDCTL_CA_FILE=/home/core/ssl/ca.pem
core@coreos2 ~ $ export ETCDCTL_ENDPOINT=https://${MASTER_PRIVATE}:2379,https://${DATABASE_PRIVATE}:2379