Skip to content

Instantly share code, notes, and snippets.

View ElijahLynn's full-sized avatar
😎
All Your DevOps Belong To Us

Elijah Lynn ElijahLynn

😎
All Your DevOps Belong To Us
View GitHub Profile
http://askubuntu.com/a/620985/11929
GIT_SSH_COMMAND="ssh -v"
git clone example
function amazons3_stream_wrappers() {
// This hook is called before hook_init(), so we have to manually register
// the autoloader. We also need to handle module upgrades where
// composer_manager might not be enabled yet.
if (!module_exists('composer_manager')) {
return array();
}
// If the module has been enabled, but the user didn't update composer
# Fish while loop example
# This was to come up with how many URLs I could fit in the 50KB max purge request to Akamai for invalidation purges.
while test (du -b /tmp/ak | awk '{print $1}') -lt 50001
echo (du -b /tmp/ak | awk '{print $1}') bytes
echo "https://community.akamai.com/thread/2706" >> /tmp/ak; echo (wc -l /tmp/ak | awk '{print $1}' ) lines
end
@ElijahLynn
ElijahLynn / springer-free-maths-books.md
Created December 29, 2015 03:23 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of maths books available for free, here are the direct links
@ElijahLynn
ElijahLynn / pdfcrop.sh
Created January 13, 2016 00:03
Replacement of the Perl pdfcrop, this one is in Bash.
#!/bin/bash
# http://tex.stackexchange.com/questions/42236/pdfcrop-generates-larger-file/42259#42259
function usage () {
echo "Usage: `basename $0` [Options] <input.pdf> [<output.pdf>]"
echo
echo " * Removes white margins from every page in the file. (Default operation)"
echo " * Trims page edges by given amounts. (Alternative operation)"
echo
@ElijahLynn
ElijahLynn / purge-ban-domain-varnish.md
Created January 21, 2016 19:50 — forked from aderowbotham/purge-ban-domain-varnish.md
Purge (ban) an entire domain in Varnish Cache 3

How to purge ('ban') an entire domain in Varnish Cache 3

#####EDIT: NB Ban is technically different from Purge. Banned objects remain in memory but banning is faster than purging. Read the Varnish 3 documentation here and here.

Purge may be a more appropriate action for your use-case; although the examples in the gist below work, it's not necessarily the best way of doing this.


@ElijahLynn
ElijahLynn / pipe_to_docker_examples
Last active March 13, 2024 03:29
How to pipe to `docker exec` examples
# These examples assume you have a container currently running.
# 1 Pipe from a file
sudo docker exec --interactive CONTAINER_NAME /bin/bash < the_beginning.sh | tee the_beginning_output.txt`
#2a Pipe by piping
echo "echo This is how we pipe to docker exec" | sudo docker exec --interactive CONTAINER_NAME /bin/bash -
@ElijahLynn
ElijahLynn / pagination.md
Created February 2, 2016 12:18 — forked from mislav/pagination.md
"Pagination 101" by Faruk Ateş

Pagination 101

Article by Faruk Ateş, [originally on KuraFire.net][original] which is currently down

One of the most commonly overlooked and under-refined elements of a website is its pagination controls. In many cases, these are treated as an afterthought. I rarely come across a website that has decent pagination, and it always makes me wonder why so few manage to get it right. After all, I'd say that pagination is pretty easy to get right. Alas, that doesn't seem the case, so after encouragement from Chris Messina on Flickr I decided to write my Pagination 101, hopefully it'll give you some clues as to what makes good pagination.

Before going into analyzing good and bad pagination, I want to explain just what I consider to be pagination: Pagination is any kind of control system that lets the user browse through pages of search results, archives, or any other kind of continued content. Search results are the o

@ElijahLynn
ElijahLynn / syncdb manual gnu parallel import command
Created June 21, 2016 16:42
Run this in bash, won't work in fish.
find /tmp/user/1000/syncdb/loc_mvpd_admin -name '*sql' | parallel --use-cpus-instead-of-cores --jobs 700% -v drush sql-query --file={}
@ElijahLynn
ElijahLynn / replify
Created August 19, 2016 22:13 — forked from danielrw7/ replify
replify - Create a REPL for any command
#!/bin/sh
command="${*}"
printf "Initialized REPL for [%s]\n" "$command"
printf "%s> " "$command"
read -r input
while [ "$input" != "" ];
do
eval "$command $input"
printf "\n%s> " "$command"