Skip to content

Instantly share code, notes, and snippets.

View lattmann's full-sized avatar

Zsolt Lattmann lattmann

  • San Jose, CA, USA
View GitHub Profile
@lattmann
lattmann / keybase.md
Last active January 28, 2018 15:45
Verifying identity with Keybase

Keybase proof

I hereby claim:

  • I am lattmann on github.
  • I am lattmann (https://keybase.io/lattmann) on keybase.
  • I have a public key ASBrU86rDkYlbXAd6FMrNjvGZJh0j1NIvICu6W6LNDr2KQo

To claim this, I am signing this object:

@lattmann
lattmann / install-mesos-slave.sh
Created February 28, 2016 15:23
Installs mesos slave with docker container support
#!/bin/bash
# setup script for mesos slave
MESOS_MASTERS=10.2.204.10:2181
# https://open.mesosphere.com/getting-started/install/
# Setup
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv E56151BF
DISTRO=$(lsb_release -is | tr '[:upper:]' '[:lower:]')
CODENAME=$(lsb_release -cs)
@lattmann
lattmann / letsencrypt-renew-certs.sh
Last active February 18, 2016 23:29
Renews lets encrypt certifications
#!/bin/sh
# Source is based on: https://letsencrypt.org/howitworks/#writing-your-own-renewal-script
# Latest [potentially unsafe]:
# $ sudo curl https://gist.github.com/lattmann/3d0e2b9a3947e878e902/raw/letsencrypt-renew-certs.sh -L -o /etc/cron.monthly/letsencrypt-renew-certs
# Use a fixed version:
# $ sudo curl https://gist.github.com/lattmann/3d0e2b9a3947e878e902/raw/72b3a2c955707c9f15ca53b266600bbee8f4ee06/letsencrypt-renew-certs.sh -L -o /etc/cron.monthly/letsencrypt-renew-certs
#!/usr/bin/python
"""Generates a csv file with random numbers following a set of rules.
Usage:
python generate_tables.py -h
Examples:
python generate_tables.py -t 1 -c 11 -m 14 -r 4
python generate_tables.py -t 1 -c 14 -m 14 -r 4
@lattmann
lattmann / Q all vs Q allSettled.js
Created July 7, 2015 17:59
Difference between Q all and Q allSettled
var Q = require('q'),
id = 0;
function doWork(timeout, shouldFail) {
var deferred = Q.defer(),
_id;
id += 1;
_id = id;
console.log(_id + ' should fail: ' + (shouldFail ? true : false).toString());
@lattmann
lattmann / git_mirror_and_bundle.sh
Created May 2, 2015 05:04
Pull git repository from one source and mirrors it to another remote. Saves a full bundle (--all) of the repository.
#!/bin/bash
# FIXME: add show_help function
# FIXME: add example how to use it
# A POSIX variable
OPTIND=1 # Reset in case getopts has been used previously in the shell.
# Initialize our own variables:
mirror_dir=mirror
@lattmann
lattmann / GitLab-CI-nodejs-job.sh
Created May 1, 2015 16:20
Sample job for GitLab CI nodejs job
# Using this docker container as runner https://gist.github.com/lattmann/867ce63e5c87918afcee
source $NVM_DIR/nvm.sh
nvm --version
nvm use 0.12.2
node -v
npm -v
git submodule update --init
git log -1
@lattmann
lattmann / Dockerfile
Last active September 11, 2018 14:39
A docker file for gitlab ci runner with nvm and mongo
# docker-gitlab-ci-runner-nvm
# Usage:
# docker build -t gitlab-ci-runner-nvm .
# sudo mkdir -p /opt/gitlab-ci-runner-nvm-01
# docker run --name gitlab-ci-runner-nvm-01 -it --rm -v /opt/gitlab-ci-runner-nvm-01:/home/gitlab_ci_runner/data gitlab-ci-runner-nvm app:setup
# Run it interactively
# docker run --name gitlab-ci-runner-nvm-01 -it --rm -v /opt/gitlab-ci-runner-nvm-01:/home/gitlab_ci_runner/data gitlab-ci-runner-nvm
# Run it in the background
# docker run --name gitlab-ci-runner-nvm-01 -it -d -v /opt/gitlab-ci-runner-nvm-01:/home/gitlab_ci_runner/data gitlab-ci-runner-nvm