Skip to content

Instantly share code, notes, and snippets.

View danmatthews's full-sized avatar
😃
Working.

Dan Matthews danmatthews

😃
Working.
View GitHub Profile
@fideloper
fideloper / install.sh
Last active October 30, 2023 20:03
Vagrant Provisioning Script for PHP applications. This installs a LAMP stack.
#!/usr/bin/env bash
echo ">>> Starting Install Script"
# Update
sudo apt-get update
# Install MySQL without prompt
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
# paths
set fish_path $HOME/.oh-my-fish
set -x PATH /usr/local/bin /usr/local/share/npm/bin /usr/local/sbin ~/bin /usr/local/pear/bin $PATH
set -x DYLD_LIBRARY_PATH /usr/local/mysql/lib $DYLD_LIBRARY_PATH
set -x GHI_TOKEN "REDACTED"
set -x PYTHONPATH /usr/local/lib/python2.7/site-packages $PYTHONPATH
# Because of some bullshit in the listing feed
set -x STATSD_PORT 1
@pborreli
pborreli / YourCommand.php
Last active August 23, 2020 09:48
Show progress of a file download inside Symfony 2.3 console #howto
<?php
protected function execute(InputInterface $input, OutputInterface $output)
{
$progress = $this->getHelperSet()->get('progress');
$ctx = stream_context_create(array(), array('notification' => function ($notification_code, $severity, $message, $message_code, $bytes_transferred, $bytes_max) use ($output, $progress) {
switch ($notification_code) {
case STREAM_NOTIFY_FILE_SIZE_IS:
$progress->start($output, $bytes_max);
break;
@coldclimate
coldclimate / gist:5186432
Created March 18, 2013 10:58
A one liners to strip all the crap from php.ini so you can diff it easily when you upgrade
cat php.ini.ucf-old | sed '/^;/ d' | sed '/^\[/ d' | sed '/^$/d' | sort > php.old
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
# Download the compiled elasticsearch rather than the source.
wget http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.2.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
sudo mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share