Skip to content

Instantly share code, notes, and snippets.

View tuliomonteazul's full-sized avatar

Tulio Monte Azul tuliomonteazul

View GitHub Profile
@gullitmiranda
gullitmiranda / Azkfile.js
Created April 23, 2015 16:22
Azkfile.js to configure `public` folder in nginx of `php-fpm`
systems({
"my-app": {
image: {"docker": "azukiapp/php-fpm"},
provision: [
// "composer install",
],
workdir: "/azk/#{manifest.dir}",
mounts: {
'/azk/#{manifest.dir}': path("."),
'/etc/nginx/sites-enabled/nginx_public.conf': path("./nginx_public.conf")
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@ZwodahS
ZwodahS / copy_redis_key.sh
Created March 1, 2016 06:07
copy a redis db key to another place (use MIGRATE COPY for v3.0<= redis)
#!/bin/bash
# source http://stackoverflow.com/questions/23222616/copy-all-keys-from-one-db-to-another-in-redis
#set connection data accordingly
source_host=localhost
source_port=6379
source_db=1
target_host=localhost
target_port=6379
target_db=2
@zthomas
zthomas / intercom-delete-old-users.js
Last active May 1, 2023 15:28
Script to delete and clear old users from intercom. Useful for lowering the monthly bill
// License: MIT, feel free to use it!
const Intercom = require('intercom-client');
const appId = 'APP_ID'
const apiKey = 'APP_KEY'
const client = new Intercom.Client(appId, apiKey);
const async = require('async-q')
//REF: https://developers.intercom.com/reference#iterating-over-all-users
//WARNING: you can only have one scroll working at once. you need to wait for that scroll to clear to try again