Skip to content

Instantly share code, notes, and snippets.

View malinky's full-sized avatar

Craig Ramsay malinky

View GitHub Profile
@malinky
malinky / stop-macBook-battery-draining-while-sleep.md
Created November 28, 2018 15:25
Stop MacBook Battery Draining While Asleep

Check Sleep Settings

pmset -g

Disable Internet Access While Sleeping (on battery)

sudo pmset -b tcpkeepalive 0

Disable Internet Access While Sleeping (on power)

@malinky
malinky / scp.md
Last active November 10, 2020 08:28
SCP

SCP

Example Credentials

Server Username = craig Server IP = 100.200.300.400

Copy a file from local to remote

scp /local/file/path/filename.txt [email protected]:/remote/server/file/path

@malinky
malinky / .bash_profile
Last active December 20, 2018 15:11
BASH PROFILE
# Shell
alias bashp="subl ~/.bash_profile"
export PATH="$PATH:$HOME/.composer/vendor/bin"
# Transversing
alias ..="cd .."
alias ...="cd ../.."
@malinky
malinky / LaravelHomestead.md
Last active February 27, 2019 12:22
Laravel Homestead

LARAVEL HOMESTEAD

The Laravel Homestead virtual machine provides the ideal server configuration for a Laravel project.

With the Homestead repo https://github.com/laravel/homestead we can configure our Laravel (and non Laravel) projects.

Homestead is setup in the ~/ directory.

To run vagrant commands globally add this function to .bash_profile.

@malinky
malinky / Vagrant.md
Last active December 19, 2018 10:51
Vagrant

VAGRANT

Boxes

A Vagrant box is a base image that clones a virtual machine, for example an ubuntu server or a server containing everything to run a Laravel project.

Add a box to your computer vagrant box add VENDOR\BOXNAME.

Remove a box from your computer vagrant box remove VENDOR\BOXNAME.

@malinky
malinky / UsingSSLwithMAMP.md
Last active November 3, 2021 16:12
Using SSL with MAMP

Overview

Having read a number of guides on using SSL with MAMP I still couldn't get things working properly. This is my guide which takes ideas from a number of resources. As with the guides I'd previously read this may or may not work for you but either way I hope it helps.

Generate SSL Certificate

  1. I imagine you can generate a wildcard certficate for all local sites but this didn't work for me so I generated a certificate for each local site individually. This method uses the subjectAltName field as this is required since Chrome 58.

  2. Create the following file in your user folder and save as server.csr.cnf. Remember to change your Country (C), State (ST), Location (L), Organisation (O), Oganisational Unit (OU), Email Address( emailAddress) and Common Name (CN). For the common name I matched with my local site name as defined in my hosts file.

@malinky
malinky / gist:0c910fbcee680c523a710853be08b026
Last active April 6, 2017 13:16
Google Analytics Compare URL
Last 30 Days
%3F_u.dateOption%3Dlast30days%26_u.hasComparison%3Dtrue%26
Last 7 Days
%3F_u.dateOption%3Dlast7days%26_u.hasComparison%3Dtrue%26
@malinky
malinky / gist:84169bd7b63ed41f06f7f7b44db94796
Last active March 6, 2018 09:59
Update composer global package
composer global update vendor/package-name
or update all global packages
composer global update
bool = ! bool
@malinky
malinky / gist:60ef4cbf51c8a38d5fb4a05956433a63
Created May 10, 2016 13:42
Update composer to latest version
/usr/local/bin/composer self-update