Skip to content

Instantly share code, notes, and snippets.

View peter-mcconnell's full-sized avatar
🏴

Peter McConnell peter-mcconnell

🏴
View GitHub Profile
@peter-mcconnell
peter-mcconnell / composer-update.sh
Created February 24, 2014 11:13
Composer - update composer to latest version
composer self-update
## ---------- or ------------ ##
rm /usr/local/bin/composer
curl -s https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
composer self-update
@peter-mcconnell
peter-mcconnell / irssi.sh
Created February 24, 2014 19:47
irssi add server
/SERVER ADD -auto -network worknet irc.mycompany.com 6667 password
@peter-mcconnell
peter-mcconnell / jenkinsjuju.sh
Last active August 29, 2015 13:56
jenkins test micro juju build
juju bootstrap --constraints "cpu-power=0"
juju deploy jenkins
juju deploy -n 1 jenkins-slave
juju add-relation jenkins jenkins-slave
# delete it
juju destroy-environment
@peter-mcconnell
peter-mcconnell / omz.sh
Created February 25, 2014 13:15
oh my zsh install
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
@peter-mcconnell
peter-mcconnell / singularize.php
Created March 25, 2014 08:48
PHP singularize
<?php
/**
* Singularize a string.
* Converts a word to english singular form.
*
* Usage example:
* {singularize "people"} # person
*/
function singularize ($params)
{
@peter-mcconnell
peter-mcconnell / ngram.php
Last active August 29, 2015 13:57
ngram
<?php
/**
* Simple Ngram word extraction from phrases
* For large dictionaries it's advised this is ran from terminal
* php ngram.php
*
* @author Peter McConnell
**/
@peter-mcconnell
peter-mcconnell / multipic.py
Created April 4, 2014 12:10
python - take multiple photos
import cv2
# Camera 0 is the integrated web cam on my netbook
camera_ports = range(0, 2)
def get_image():
retval, im = camera.read()
return im
for c in camera_ports:
@peter-mcconnell
peter-mcconnell / mysqlreset.sh
Created April 7, 2014 09:22
Mysql - reset root password
1. Stop the MySQL Server.
`sudo /etc/init.d/mysql stop`
2. Start the mysqld configuration.
`sudo mysqld --skip-grant-tables &`
3. Login to MySQL as root.
`mysql -u root mysql`
4. Replace YOURNEWPASSWORD with your new password!
@peter-mcconnell
peter-mcconnell / pspell.config
Created April 10, 2014 15:32
Elastic Beanstalk - PHP55 - Pspell
packages:
yum:
aspell: []
aspell-devel: []
aspell-en: []
php55-pspell.x86_64: []
@peter-mcconnell
peter-mcconnell / password.config
Last active November 16, 2022 15:10
Elastic Beanstalk - Password protect
files:
"/etc/httpd/conf.d/allow_override.conf":
mode: "000644"
owner: ec2-user
group: ec2-user
encoding: plain
content: |
<Directory /var/www/html/myproject/>
AllowOverride AuthConfig
</Directory>