Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Chris Fidao fideloper

🏠
Working from home
View GitHub Profile
@fideloper
fideloper / convert_attach_from_db_to_file.php
Last active Dec 7, 2016
Converting Database Stored Attachments to the File System
View convert_attach_from_db_to_file.php
<?php
/*
* Notes:
* This script will convert attachments from being stored on the DB to the file system
* NOTE: This script removes the atachments from your database. Before running this script make a backup. For real.
*/
//No time limit
set_time_limit(0);
@fideloper
fideloper / develop
Created Nov 24, 2016
Helper for Laravel + Docker dev workflow
View develop
#!/usr/bin/env bash
# Set environment variables for dev
export APP_ENV=local
export APP_PORT=80
export DB_PORT=3306
export DB_ROOT_PASS=secret
export DB_NAME=homestead
export DB_USER=homestead
export DB_PASS=secret
@fideloper
fideloper / tags.py
Created Nov 4, 2016
Change many aws instances tags (boto3)
View tags.py
import boto3
import sys
ec2 = boto3.client('ec2')
# Grab where backup retention is 14 days so we can reduce it to 7
instances = ec2.describe_instances(Filters=[{'Name': 'tag:Retention', 'Values': ['14']}])
ids = []
@fideloper
fideloper / provision.sh
Created Jun 27, 2016
Provision ubuntu 16.04 vagrant machine
View provision.sh
#!/usr/bin/env bash
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get -y upgrade
# Get "add-apt-repository" Command
sudo apt-get install -y software-properties-common
@fideloper
fideloper / 22-fluentd.conf
Last active Apr 8, 2016
Quick notes on using Fluentd
View 22-fluentd.conf
# rsyslog conf referenced in tasks.yml
*.* @127.0.0.1:42185
@fideloper
fideloper / mysql.md
Last active Mar 31, 2016
MySQL 5.7, Ubuntu 14.04 mystery
View mysql.md

Install

I have mysql 5.7.11-log installed on Ubuntu 14.04, installed from MySQL official deb repository deb http://repo.mysql.com/apt/ubuntu/ trusty mysql-5.7.

Configuration

Basically everything is stock configuration.

  • Innodb buffer pool is set to only 250M to ensure MySQL doesn't allocate too much to the buffer pool. There's only one innodb pool.
@fideloper
fideloper / SlackOAuthController.php
Last active Feb 17, 2017
Slack oAuth2.0 Round Trip
View SlackOAuthController.php
<?php
namespace App\Http\Controllers\Auth;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use GuzzleHttp\Client;
View authorize_request.py
class SignedRequest:
def __init__(self, request, secret):
self.request = request
self.secret = secret
def expected_signature(self):
method = self.request.method
uri = self.request.path
extras = self._get_extra_parameters()
@fideloper
fideloper / update_curl.sh
Last active Jun 26, 2020
Update curl on Ubuntu 14.04
View update_curl.sh
#! /usr/bin/env bash
# Install any build dependencies needed for curl
sudo apt-get build-dep curl
# Get latest (as of Feb 25, 2016) libcurl
mkdir ~/curl
cd ~/curl
wget http://curl.haxx.se/download/curl-7.50.2.tar.bz2
tar -xvjf curl-7.50.2.tar.bz2
You can’t perform that action at this time.