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
CONNECT | |
DELETE | |
GET | |
HEAD | |
OPTIONS | |
PATCH | |
POST | |
PUT | |
TRACE |
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
#Front Controller rewrite | |
RewriteEngine on | |
RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^.*$ index.php [L,NC] | |
# Ensure we are using HTTPS | |
RewriteCond %{HTTPS} !on | |
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
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 add . [-A] | |
- Recursively add all modified files to staging area | |
-A - Include removed files | |
git blame | |
- Show last modigified timestamp / author for each line of a file | |
git branch [-a] [-r] [-m] [-d] [-D] [<branch-name>] | |
- Lists local branches, give name to create branch | |
- Flags:git |
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
TERMINOLOGY | |
----------- | |
Images - The file system and configuration of our application which are used to create containers | |
Dockerfile describes an image | |
Image identifiers can be repo:tag or ID | |
Containers - Running instances of Docker images — containers run the actual applications. A container includes an application and all of its dependencies. It shares the kernel with other containers, and runs as an isolated process in user space on the host OS. You created a container using docker run which you did using the alpine image that you downloaded. A list of running containers can be seen using the docker ps command. | |
Image ID != Container ID | |
When containers are recreated they will have lost any changes made since last created | |
Docker daemon - The background service running on the host that manages building, running and distributing Docker containers. | |
Docker client - The command line tool that allows the user to interact with the Docker daemon. |
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
sed -n '<int>,<int>p' <file> | |
- Grab contents of file between lines (inclusive) | |
sed [-n] '/<regex>/<command>' <inputfile> [> <outputfile>] | |
- Fine lines with text in inputfile and optionally put in outputfile | |
- -n makes command silent | |
- use !d or p (with -n) to show only matched lines | |
sed 's/<regex>/<replace>/' <inputfile> [> <outputfile>] | |
- Replaces matches text in infile and optionally put in outputfile |
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 Single character | |
-+ = One or more of preceding character | |
-? = Zero or one of preceding character | |
-* = One or more of preceding character | |
-^ = Start of string | |
-$ = End of string | |
-| = or | |
-(Escape any of above with \, for literal \ use \\) | |
-{n} = n of preceding character | |
-{n,} = At least n of preceding character |
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
Basics | |
====== | |
Expansion (special symbols replaced by values) and word splitting (arguments being split into several aruments) must have attemtion paid or pain will follow. | |
- # for comments | |
- Lots of internal variables available to bash scripts, see: http://tldp.org/LDP/abs/html/internalvariables.html#ARGLIST | |
- Name of script will be $0 | |
- Parameters passed to script will be in $1, $2, $3.... vars and count in $# |
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
Ansible pushes IT Infra / Config from a control node using SSH | |
Commands are parallelised between hosts | |
Ordering can be important, watch out for deadlocks | |
Ansible is written in Python | |
===== | |
Inventory File | |
- Lives at /etc/ansible/hosts by default | |
- Can be flat file |
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
Enable tracing example: | |
zend_extension="/usr/lib/php5/20090626+lfs/xdebug.so" | |
xdebug.auto_trace=1 | |
xdebug.trace_output_dir="/tmp/xdebug/" | |
xdebug.collect_params=4 | |
xdebug.collect_return=1 | |
xdebug.trace_options=1 | |
xdebug.show_local_vars=1 |
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
AFGHANISTAN,AF | |
ALBANIA,AL | |
ALGERIA,DZ | |
AMERICAN SAMOA,AS | |
ANDORRA,AD | |
ANGOLA,AO | |
ANGUILLA,AI | |
ANTARCTICA,AQ | |
ANTIGUA AND BARBUDA,AG | |
ARGENTINA,AR |
NewerOlder