Skip to content

Instantly share code, notes, and snippets.

View grumpysi's full-sized avatar

Simon Nicklin grumpysi

  • The Greenhouse People
  • Stoke-on-Trent, UK
  • X @SimonNjO
View GitHub Profile
@grumpysi
grumpysi / gist:8754c3107a039e3d1f387f20b6c6210a
Created March 16, 2022 11:20
Create a self signed local certificate for localhost development.
openssl req -x509 -out localhost.crt -keyout localhost.key \
-newkey rsa:2048 -nodes -sha256 \
-subj '/CN=localhost' -extensions EXT -config <( \
printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
@grumpysi
grumpysi / gist:c7636c8cffc466c3ce919e67b6eee09d
Created June 3, 2021 14:15
Install pisignage docker image on AWS EC2 instance using user data script
Amazon Linux 2 AMI (HVM) x86
Instance Type: t2.micro
Key pair create
VPC
Security:
SSH 22 from current IP
Custom TCP 3000 from current IP
Add the following to user data box:
@grumpysi
grumpysi / gist:4e21fb8e2df943ff18a236b5eeeb5af0
Created December 9, 2020 11:37
Laravel Forge provisioned server: Upgrade Nginx 1.15.8 to 1.18.0 on Ubuntu
sudo apt update
apt list --upgradable
mkdir nginx-backup2
sudo cp -r /etc/nginx/* /etc/nginx-backup2/
sudo add-apt-repository ppa:nginx/stable
sudo apt update
apt list --upgradable
...
@grumpysi
grumpysi / gist:4cb8602de54887c0217c26c92e21a80d
Created October 21, 2020 10:44
Find which folder is using too much disk space on Ubuntu
du -cha --max-depth=1 / | grep -E "M|G"
du -cha --max-depth=1 /var | grep -E "M|G"
du -cha --max-depth=1 /srv/www/ | grep -E "M|G"
@grumpysi
grumpysi / gist:265a420507f1f54e3e8a457db88ca637
Created September 24, 2019 09:13
Generate new ssh Laravel Forge deploy key
ssh-keygen -f /home/forge/.ssh/id_rsa -t rsa -N ''
@grumpysi
grumpysi / gist:c9b6a6766071524644534250c29e3aa6
Last active July 17, 2019 13:38
Fix import warnings in PHPStorm for VueJS projects
For vue-cli3, you need to specify node_modules/@vue/cli-service/webpack.config.js
as a webpack configuration file in Settings | Languages & Frameworks | JavaScript | Webpack
@grumpysi
grumpysi / gist:4a5e3e02ac2cc2a1d778b35407cc0036
Created July 16, 2019 10:12
Quickly Toggle X-Debug for testing - Homebrew
nano /usr/local/etc/php/7.2/conf.d/ext-xdebug.ini
brew services restart php@7.2
ln -s ../../plugins/sms_branch_details/app/addons/sms_branch_details sms_branch_details
ln -s ../../../../plugins/sms_branch_details/var/langs/en/addons/sms_branch_details.po sms_branch_details.po
wget "https://www.cs-cart.com/index.php?dispatch=pages.get_trial&page_id=297&edition=ultimate" -O cscart.zip
@grumpysi
grumpysi / Find files changed between two dates
Last active August 30, 2017 11:59
Find files changed between two dates
find -type f -newermt "2011-12-22 00:00:00" \! -newermt "2011-12-24 13:23:00"
or
find -type f -newermt "2011-12-22" \! -newermt "2011-12-24"