Skip to content

Instantly share code, notes, and snippets.

View Crowles's full-sized avatar

Chris Rowles Crowles

View GitHub Profile
@Crowles
Crowles / Vagrantfile
Last active April 16, 2016 23:41 — forked from aweijnitz/Vagrantfile
This is a Vagrant file and a provisioning script to create a Debian-based Jenkins server, including Java, Ant and Tomcat. Also see "provision.sh" below
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Every Vagrant virtual environment requires a box to build off of.
# Named boxes, like this one, don't need a URL, since the are looked up
@Crowles
Crowles / Vagrantfile
Last active July 5, 2020 18:13
Vagrantfile and provisioning script to create a CentOS dev environment.
Vagrant.configure(2) do |config|
# Box to use.
config.vm.box = "puphpet/centos65-x64"
# Port forwarding.
config.vm.network "forwarded_port", guest: 80, host_ip: "127.0.0.1", host: 8080
config.vm.provider "virtualbox" do |vb|
# Display the VirtualBox GUI when booting the machine
<?php
// ==============================================================================
// BEGIN VERBOSE DEBUGGING
curl_setopt($ch, CURLOPT_VERBOSE, true);
$verbose = fopen('php://temp', 'w+');
curl_setopt($ch, CURLOPT_STDERR, $verbose);
$result = curl_exec($ch);
if ($result === 0) {
printf("cUrl error (#%d): %s<br>\n", curl_errno($ch),
@Crowles
Crowles / rebuild_vbga.sh
Last active August 3, 2016 18:54
Rebuild VBox Guest Additions - For when shared folders fail to mount.
#!/bin/bash
# will probably see: /sbin/mount.vboxsf: mounting failed with the error: No such file or directory
# this is fine, carry on.
mount -t vboxsf Shared_Folder ~/SF/
cd /opt/VBoxGuestAdditions-*/init
./vboxadd setup
@Crowles
Crowles / python33_install.sh
Last active August 26, 2016 09:01
Install Python 3.3 without breaking yum (RHEL / CentOS)
#!/bin/bash
echo "updating packages"
yum -y update
echo "install YUM development tools"
yum groupinstall -y development
echo "installing additional packages"
yum install -y zlib-dev openssl-devel sqlite-devel bzip2-devel
@Crowles
Crowles / slack-webhook.php
Created January 20, 2017 16:58
Slack Webhook Integration
<?php
return slack();
function slack() {
$data = [];
// You can get your webhook endpoint from your Slack settings
$ch = curl_init("");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, array('payload' => $data));
@Crowles
Crowles / backup.sh
Last active October 10, 2023 15:35
Android ADB
#!/bin/bash
# Backup device
adb backup -apk -shared -all -f 'C:\android_backup.ab'
# confirm
# keyevents:
# 22 - KEYCODE_DPAD_RIGHT - "back up my data"
# 23 - KEYCODE_DPAD_CENTER - "enter"
# adb shell input text <your password>
@Crowles
Crowles / crstov.zsh-theme
Last active August 8, 2017 18:01
Shell themes
# crstov-zsh (2017).
# Chris Rowles <github.com/Crowles>
if [[ $TERM = *256color* || $TERM = *rxvt* ]]; then
turquoise="%F{81}"
orange="%F{166}"
purple="%F{135}"
hotpink="%F{161}"
limegreen="%F{118}"
grey="%F{250}"
@Crowles
Crowles / .bashrc
Last active October 23, 2018 15:34
Useful aliases, commands, ini configs etc. (general resource)
alias statc="stat -c '%a %G:%U %n'"
alias ccat="pygmentize -g"
alias tlog="tail -f -n 0 storage/logs/laravel.log"
alias phpcf="php --ini | grep 'Loaded'"
eval $(thefuck --alias)
# custom functions
# IP Lookup
function rip
@Crowles
Crowles / extra
Last active August 16, 2017 20:02
Vagrant VM - extra provisioning script - merging individual scripts.
#!/bin/bash
if ! type vim > /dev/null; then
echo "installing vim"
yum install -y vim
else
echo "Vim installed, continuing"
fi
if ! type dos2unix > /dev/null; then