Skip to content

Instantly share code, notes, and snippets.

@carloswherbet
carloswherbet / Makefile
Created December 5, 2022 17:22 — forked from mpneuried/Makefile
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@carloswherbet
carloswherbet / ubuntu_ldap_auth.sh
Created December 28, 2017 12:43 — forked from ahamilton55/ubuntu_ldap_auth.sh
Ubuntu Client Auth over LDAP
#!/bin/bash
# Set environment vars for a silent install through apt-get
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_PRIORITY=critical
# Install the LDAP utilities
apt-get -y install libpam-ldap libnss-ldap nss-updatedb libnss-db
# Reset environment vars for apt-get
@carloswherbet
carloswherbet / Gemfile
Created May 23, 2017 14:05 — forked from rubencp/Gemfile
Override Confirm dialog Rails 4 and Bootbox.js
gem 'bootbox-rails', '~>0.3'
#!/usr/bin/env ruby
# This pre-commit hook will prevent any commits to forbidden branches
# It will also help prevent you leaving debuggers and merge conflig flags
# Put this file in your local repo, in the .git/hooks folder
# and make sure it is executable by running: chmod u+x pre-commit
# The name of the file *must* be "pre-commit" for Git to pick it up.
class String
def black; "\e[30m#{self}\e[0m" end
@carloswherbet
carloswherbet / post-receive
Created October 5, 2016 18:35 — forked from lemiorhan/post-receive
Post-receive hook to deploy the code being pushed to production branch to a specific folder
#!/bin/bash
target_branch="production"
working_tree="PATH_TO_DEPLOY"
while read oldrev newrev refname
do
branch=$(git rev-parse --symbolic --abbrev-ref $refname)
if [ -n "$branch" ] && [ "$target_branch" == "$branch" ]; then
@carloswherbet
carloswherbet / .gitconfig
Created October 5, 2016 17:00 — forked from robmiller/.gitconfig
Some useful Git aliases that I use every day
#
# Working with branches
#
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = "!git push -u origin $(git branch-name)"
server {
listen 80;
listen [::]:80;
server_name domain.com;
autoindex off;
index index.php index.html;
root /srv/www/domain.com/public;
@carloswherbet
carloswherbet / crossbuild_qt5_for_rpi.sh
Last active August 29, 2015 14:25 — forked from Jokymon/crossbuild_qt5_for_rpi.sh
Protocol from Cross compiling Qt5 for Raspberry Pi
set -e
PREFIX=~/opt/qt5pi
ROOTFS_MOUNT=/mnt/rasp-pi-rootfs
# On Ubuntu 14.04 do the following first to get the ia32-lib
if [ `lsb_release -ds` -eq "Ubuntu 14.04 LTS" ]
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6
fi