This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git diff -U0 -w --no-color -- controllers/UserController.php | git apply --cached --ignore-whitespace --unidiff-zero |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pull url from vagrant up | |
wget https://vagrantcloud.com/ubuntu/boxes/xenial64/versions/20190406.0.0/providers/virtualbox.box | |
vagrant box add ubuntu/xenial64 ~/virtualbox.box | |
cd ~/.vagrant.d/boxes/ubuntu-VAGRANTSLASH-xenial64/ | |
mv 0 20190406.0.0 | |
echo 'https://vagrantcloud.com/ubuntu/boxes/xenial64' > metadata_url | |
perl -pe 'chomp if eof' metadata_url > metadata_url | |
vagrant box update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uname -a > /tmp/lamp-versions.txt | |
lsb_release -a >> /tmp/lamp-versions.txt | |
apache2 -v >> /tmp/lamp-versions.txt | |
mysql --version >> /tmp/lamp-versions.txt | |
php -v >> /tmp/lamp-versions.txt | |
cat /tmp/lamp-versions.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# list local merged feature branches | |
git branch --merged | grep feature | grep -v '>' | xargs -L1 | |
git branch --merged | grep hotfix | grep -v '>' | xargs -L1 | |
# delete local merged feature branches | |
git branch --merged | grep feature | grep -v '>' | xargs -L1 | xargs git branch -D | |
git branch --merged | grep hotfix | grep -v '>' | xargs -L1 | xargs git branch -D | |
# list what will be removed - check me | |
git branch -r --merged | grep origin | grep -v '>' | grep -v epic/reporting | xargs -L1 | cut -d"/" -f2- | grep feature |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Encrypt file with key pair | |
http://krisjordan.com/essays/encrypting-with-rsa-key-pairs | |
data to encrypt | |
vim plain.txt | |
Create the PEM (I wish I could avoid this step and use a .pub file) | |
openssl rsa -in ~/.ssh/id_rsa -pubout > ~/.ssh/id_rsa.pub.pem | |
Encrypt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# change 'id_rsa' to your key name | |
ssh-keygen -b 4096 -t rsa -f id_rsa -q -N "" -C your@email.com | |
chmod 400 ~/.ssh/id_rsa | |
eval `ssh-agent -s` | |
ssh-add ~/.ssh/id_rsa | |
cat ~/.ssh/id_rsa.pub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Any copyright is dedicated to the Public Domain. | |
// http://creativecommons.org/publicdomain/zero/1.0/ | |
/********************************************* | |
This camera example takes a picture. If a | |
directory is specified with the --upload-dir | |
flag, the picture is saved to that directory. | |
*********************************************/ | |
var tessel = require('tessel'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z "$1" -a "$1"=" " ]; then | |
echo "Creates a dev mysql user, pass and db with the same name" | |
echo "Usage: make-db.sh name" | |
exit | |
fi | |
# mysql user and table naming restriction | |
regex='^[A-Za-z][A-Za-z0-9_]*$' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo mkdir /usr/share/adminer | |
sudo wget "http://www.adminer.org/latest.php" -O /usr/share/adminer/latest.php | |
sudo ln -s /usr/share/adminer/latest.php /usr/share/adminer/adminer.php | |
echo "Alias /adminer.php /usr/share/adminer/adminer.php" | sudo tee /etc/apache2/conf-available/adminer.conf | |
echo "Alias /adminer /usr/share/adminer/adminer.php" | sudo tee -a /etc/apache2/conf-available/adminer.conf | |
sudo a2enconf adminer.conf | |
sudo service apache2 restart | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If mysql is started with Upstart, you cant kill it any way but this - it will continue to respawn | |
sudo service mysql stop | |
sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking & | |
mysql -u root | |
FLUSH PRIVILEGES; | |
SET PASSWORD FOR root@'localhost' = PASSWORD(''); | |
FLUSH PRIVILEGES; | |
QUIT |
NewerOlder