Skip to content

Instantly share code, notes, and snippets.

@jedi4ever
jedi4ever / README.md
Created March 18, 2014 07:43
Nodejs & Versioning etc.. in Continous Delivery

Current setup

  • npm install from public repo
  • use of github URLs for private dependencies:
    • PRO: easy to use, using #master always fetches latests
    • BAD: npm install downloads every time, need to npm link or rm -rf node_modules to make sure
  • rebuild of consolidated/minified files every time, using Git version
    • BAD: results in consistent build overwriting
    • IMPROVE: using hash of result and upload to cloudfront

Improved flow:

http://testflightapp.com/install/0ad4aa4dee1873848fd900cb9bc14d61-MTMyMTk5Mjk/
@jedi4ever
jedi4ever / gist:8da590c05d66ffbdcffb
Last active August 29, 2015 14:18
monkey patch net.connect nodejs to support SRV records
// Proof of concept of monkey patching net.connect to make it support SRV records
// If require a monkey patched connect function before any other requires we can make a generic fix for handling SRV records
// We need of course to handle a few different cases & more robust error handling
// We can require a lib and even specify a filter for which hosts to resolve SRV and which not
var net = require('net');
var dns = require('dns');
// Set a specific Nameserver to be used
dns.setServers(['172.17.42.1']);
@jedi4ever
jedi4ever / gist:b6013f313aacdac844bf
Created May 19, 2015 11:53
redis - redis sentinel - docker setup
#!/bin/bash
DOCKER_IP=$(ip addr show docker0|grep "inet "|sed -e 's/^[ ]*//g'| cut -d ' ' -f 2| cut -d '/' -f 1)
docker stop redis_0
docker stop redis_1
docker stop sentinel_0
docker stop sentinel_1
docker stop sentinel_2
Created vm ubuntu 14.04
Tried installing via apt-get install youtube-dl
- kept getting errors on Unable to download webpage: <urlopen error [Errno 8] _ssl.c:510: EOF occurred in violation of protocol>
- this is a bug when using python2 (default on ubuntu)
- So remove the apt package
Install via pip:
- apt-get install pip
- alias python=`/usr/bin/python3`
- pip install youtube-dl
@jedi4ever
jedi4ever / floatsign.sh
Last active August 29, 2015 14:26 — forked from mediabounds/floatsign.sh
A small bash script to re-sign iOS applications.
# !/bin/bash
# Copyright (c) 2011 Float Mobile Learning
# http://www.floatlearning.com/
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
@jedi4ever
jedi4ever / gist:5d916c1b1c2d767f3f65
Created April 8, 2015 13:10
rsync -> docker exec
Looking for the correct syntax
rsync -avz <host-dir> | docker exec rsync --server --daemon <inside-container-dir>
@jedi4ever
jedi4ever / gist:818432
Created February 9, 2011 13:00
create vagrant - lucid box with veewee
gem instal veewee
#if needed replace amd64 with i386
vagrant basebox define 'lucid-box' 'ubuntu-10.04.1-server-amd64'
#for tweeking look at definitions/lucid-box/
vagrant basebox build 'lucid-box'
vagrant basebox export 'lucid-box'
@jedi4ever
jedi4ever / Scripted Install.cfg - Freebsd
Created February 11, 2011 09:20
Why is sysinstall not creating the partitions?
#http://www.freebsd.org/doc/en_US.ISO8859-1/articles/remote-install/installation.html
dd if=/dev/zero of=/dev/ad4 count=2
#bsdlabel -wB /dev/ad4
sysctl kern.geom.debugflags=16
cat <<EOF >/install.cfg
# This is the installation configuration file for our rackmounted FreeBSD
# cluster machines
## VagrantFile
config.vm.provision :puppet do |puppet|
puppet.pp_path = "/tmp/vagrant-puppet"
puppet.manifests_path = "manifests"
puppet.module_path = "modules"
puppet.manifest_file = "newbox.pp"
end
## modules/newbox.pp (what the box needs)
include pxe-server