Skip to content

Instantly share code, notes, and snippets.

View ebuildy's full-sized avatar
🌴
A Montréal - hey bière ??

Thomas Decaux ebuildy

🌴
A Montréal - hey bière ??
View GitHub Profile
@ebuildy
ebuildy / gist:5d4ad0998848eaefdad8
Last active November 7, 2018 19:14
Setup sentry logger on a fresh Ubuntu server
sudo apt-get update
sudo apt-get install python-virtualenv
sudo apt-get install python-dev
sudo apt-get install postgresql
sudo apt-get install postgresql-server-dev-9.3
sudo apt-get install redis-server
sudo -u postgres createuser -s sentry
sudo -u postgres psql -c "alter user sentry with password 'sentry';"
@ebuildy
ebuildy / Grunt task splitr
Created November 14, 2014 16:58
This small piece of NodeJS code allows you to split in files the Grunt task file. I wrote this because mine was too big, much better to have small files.
---------------------------------------------------------------
Splitr.js
---------------------------------------------------------------
var json = {
watch: {
js: {
files: ['<%= yeoman.app %>/scripts/{,*/}*.js', '<%= yeoman.common %>/js/{,*/}*.js'],
tasks: ['concat']
},
#!/bin/bash
#
# MongoDB installer for Debian/Ubuntu (32- and 64-bit)
#
# curl -sL https://gist.githubusercontent.com/ebuildy/c8dd49169f10b86b2980/raw/693afca681c277411017d95ef9ec2708b5aceb87/install_mongodb | sudo bash -
#
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
@ebuildy
ebuildy / boot_carbon
Created December 11, 2014 15:20
install_graphite
#!/bin/sh
### BEGIN INIT INFO
# Provides: carbon
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Carbon
# Description: Carbon interface for Whisper storage.
### END INIT INFO
@ebuildy
ebuildy / AngularRequest.php
Last active August 29, 2015 14:12
Symfony2 seems not capable to parse Angular $http data. This class overrides default SF2 Request to parse request body sent by Angular then put data in query field.
class AngularRequest extends \Symfony\Component\HttpFoundation\Request
{
/**
* Creates a new request with values from PHP's super globals.
*
* @return Request A new request
*
* @api
*/
public static function createFromGlobals()
#!/bin/sh
sudo apt-get install snmpd xinetd
#sudo nano /etc/snmp/snmpd.conf
sudo curl -o /usr/bin/observium_agent https://gist.githubusercontent.com/ebuildy/6aab534af385ab535b99/raw/c6665fbcc086ca953c08b9b85189d67d6bfd5387/observium_agent
sudo curl -o /etc/xinetd.d/observium_agent_xinetd https://gist.githubusercontent.com/ebuildy/6aab534af385ab535b99/raw/ec27ea4f5d2b11d6b0f35296dbdbbca5f2cc3ee1/observium_agent_xinetd
sudo chmod a+x /usr/bin/observium_agent
@ebuildy
ebuildy / gist:1fb1bc7768d4e0d5416a
Created February 18, 2015 09:17
Test ElasticSearch suggest and delete
#!/bin/bash
curl -X DELETE localhost:9200/music
curl -X PUT localhost:9200/music
curl -X PUT localhost:9200/music/song/_mapping -d '{
"song" : {
"properties" : {
"name" : { "type" : "string" },
"suggest" : { "type" : "completion",
Vagrant.configure("2") do |config|
config.vm.provider :azure do |azure, override|
override.vm.box = "azure"
override.ssh.username = "tom"
azure.mgmt_certificate = '/Users/tom/Documents/Azure/Kinoulink/mgt.pem'
azure.mgmt_endpoint = 'https://management.core.windows.net'
azure.subscription_id = '*******************************'
@ebuildy
ebuildy / config.inc.php
Last active August 29, 2015 14:25
PhpMyAdmin on Rancher: Auto mysql server Docker container discovery. This will use Rancher API to browse the containers list, and search for container who expose 3306 port or has label "type:mysql"
<?php
$buffer = json_decode(file_get_contents('http://*****:*******@********/v1/containers'), true);
$containers = $buffer['data'];
$mysqlContainers = [];
$i = 0;
foreach($containers as $container)
{
$valid = false;
@ebuildy
ebuildy / docker-compose-sentry.yml
Created November 24, 2015 08:12
A simple docker-compose YML to run Sentry.
redis:
image: redis
postgres:
image: postgres:9.4
environment:
- POSTGRES_USER:sentry
- POSTGRES_PASSWORD:sentry
volumes:
- /var/data/sentry/postgre:/var/lib/postgresql/data:rw