Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Chris Fidao fideloper

🏠
Working from home
View GitHub Profile
@fideloper
fideloper / install_mysql.sh
Last active Jul 1, 2020
instal mysql5.7 non-interactive on ubuntu 14.04
View install_mysql.sh
#!/usr/bin/env bash
# This is assumed to be run as root or with sudo
export DEBIAN_FRONTEND=noninteractive
# Import MySQL 5.7 Key
# gpg: key 5072E1F5: public key "MySQL Release Engineering <mysql-build@oss.oracle.com>" imported
apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys 5072E1F5
echo "deb http://repo.mysql.com/apt/ubuntu/ trusty mysql-5.7" | tee -a /etc/apt/sources.list.d/mysql.list
@fideloper
fideloper / stream_file.php
Last active Jun 30, 2020
Stream file from S3 to browser, assume Laravel Filesystem usage
View stream_file.php
<?php
/*************************************************************************
* Get File Information
*/
// Assuming these come from some data source in your app
$s3FileKey = 's3/key/path/to/file.ext';
$fileName = 'file.ext';
@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
@fideloper
fideloper / start-container.sh
Last active Jun 23, 2020
Enable/Disable xDebug depending on env.
View start-container.sh
#!/usr/bin/env bash
###
# A CMD or ENTRYPOINT script for a Dockerfile to use to start a Nginx/PHP-FPM
#
# For more details, see 🐳 https://shippingdocker.com
##
if [ ! "production" == "$APP_ENV" ] && [ ! "prod" == "$APP_ENV" ]; then
# Enable xdebug
@fideloper
fideloper / ngxdis
Created Jan 4, 2014
Nginx scripts for enable and disabling a site. This will create or destroy a symlink between a real config file in /etc/nginx/sites-available and a symlink in /etc/nginx/sites-enabled.
View ngxdis
#!/usr/bin/env bash
if [ $EUID -ne 0 ]; then
echo "You must be root: \"sudo ngxdis\""
exit 1
fi
# -z str: Returns True if the length of str is equal to zero.
if [ -z "$1" ]; then
echo "Please choose a site."
View chipper_box.md

The pipeline could use a selection of pre-set features.

Goals

  1. Give the pipeline more polish by allowing users to "build" their pipeline (preset items they can run)
  2. Make Chipper feel more integrated with services such as AWS, Forge, Envoyer, Vapor
  3. Make it easier to script more complex items such as conditional actions, or creating build artifacts

It might be nice to have a way to have icons for each as well - PHP, NodeJS, Composer, Dusk, Vapor, etc etc etc.

View prom.yml
groups:
- name: node_rules
rules:
- record: instance:node_cpu:avg_rate5m
expr: 100 - avg (irate(node_cpu_seconds_total{job="helpspot-cloud", mode="idle"}[5m])) by (instance) * 100
@fideloper
fideloper / vhost.py
Last active May 11, 2020
Create vHost Ubuntu Lamp-Server (bash and python)
View vhost.py
#! /usr/bin/python
from sys import argv
from os.path import exists
from os import makedirs
from os import symlink
from os import system
import getopt
#
@fideloper
fideloper / crypt.py
Created Jun 4, 2015
Decrypt Laravel-encrypted value
View crypt.py
import os
import base64
import json
from Crypto.Cipher import AES
from phpserialize import loads
def decrypt(payload):
data = json.loads(base64.b64decode(payload))
@fideloper
fideloper / gist:8bc66ce0102fdc98f030
Created Jun 10, 2015
Apache redirect http to https
View gist:8bc66ce0102fdc98f030
<VirtualHost *:80>
ServerName site.example.com
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</IfModule>
</VirtualHost>
<VirtualHost *:443>
You can’t perform that action at this time.