Skip to content

Instantly share code, notes, and snippets.

DevOps for's CMS

Elijah Lynn ElijahLynn

DevOps for's CMS
View GitHub Profile
ElijahLynn / gist:a848ae3214aba1f22745
Last active Feb 16, 2021
Cherry pick range commits from another repo
View gist:a848ae3214aba1f22745
// Say you have a Repo and you are in a few levels deep. /profiles/publisher/modules/contrib/
// You have a module called ../contrib/embed_external
// You want to pull changes you made to it to upstream
// pwd ../contrib
// git clone embed-external-upstream EE-upstream
// cd EE-upstream
git -C ../embed_external/ diff --relative 76da308..HEAD . | patch -p1
ElijahLynn / pipe_to_docker_examples
Last active Jan 24, 2021
How to pipe to `docker exec` examples
View pipe_to_docker_examples
# These examples assume you have a container currently running.
# 1 Pipe from a file
sudo docker exec --interactive CONTAINER_NAME /bin/bash < | 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 /
Last active Sep 30, 2020
Delete all Digital Ocean droplets - good for testing
function droplet_delete_all
echo "Getting list of droplets"
set --local droplets (doctl compute droplet list | tail --lines=+2 | awk '{print $2}')
if test -n "$droplets"
echo "Deleting droplets: $droplets"
for droplet in $droplets
doctl compute droplet delete $droplet
echo "Deleted droplet: $droplet"
View gist:76e5580806c3b1de2ff116dabb7d1f1c
### Keybase proof
I hereby claim:
* I am elijahlynn on github.
* I am elijahlynn ( on keybase.
* I have a public key ASBeMFqKeluy3X7oeF-D-Zh05Q3rxHtuggP7XY2ICXlgoQo
To claim this, I am signing this object:
ElijahLynn / simplehttp.service
Last active May 7, 2019 — forked from funzoneq/simplehttp.service
A systemd file for a Python SimpleHTTPServer
View simplehttp.service
# Upstream
Description=Job that runs the Python SimpleHTTPServer daemon
ExecStartPre=-/usr/bin/mkdir /tmp/backups
ExecStart=/usr/bin/python -m SimpleHTTPServer 80 &
ElijahLynn /
Last active Oct 13, 2018
Script to toggle fullscreen for Guake 0.8.x
#!/usr/bin/env python2
# -*- coding: utf-8; -*-
# Depends on
import dbus
bus = dbus.SessionBus()
remote_object = bus.get_object('org.guake.RemoteControl', '/org/guake/RemoteControl')
View countCSSRules.js
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
for (var i = 0; i < document.styleSheets.length; i++) {
function countSheet(sheet) {
ElijahLynn / gist:75f75ef17592d31b4152175b31584ae1
Last active Jul 5, 2017
Google News - 'Top Stories' Hider - Userscript
View gist:75f75ef17592d31b4152175b31584ae1
// ==UserScript==
// @name Google News - Top Stories Hider
// @namespace
// @version 0.1
// @description Permanently hides the Top Stories section on Google News
// @author Elijah Lynn
// @match*
// @grant none
// @downloadURL
// @updateURL
View f.txt
document.write('\x3cimg src\x3d\x22\x3dncs2016\x26amp;at\x3dview\x26amp;rt\x3dbanner\x26amp;st\x3dimage\x26amp;ca\x3dchase_ev_012417\x26amp;cr\x3d80580412\x26amp;pc\x3d144822244\x26amp;ce\x3d10787013_DCM\x26amp;rnd\x3d3209337560\x22 height\x3d\x221\x22 width\x3d\x221\x22 border\x3d\x220\x22\x3e\x3cscript type\x3d\x22text/javascript\x22 src\x3d\x22\x3d10787013\x26amp;si\x3d851407\x26amp;pc\x3d144822244\x26amp;pi\x3d319652813\x26amp;cr\x3d80580412\x26amp;dm\x3d\x26amp;ai\x3d3092936\x26amp;ui\x3dAMsySZY-5abb1GYAnjQ-u_lv224d\x26amp;cb\x3d3209337560\x26amp;pp\\x26amp;dt\x3d6755111439323588633001\x22\x3e\x3c/script\x3e');(function() {if (!window.GoogleTyFxhY || typeof window.GoogleTyFxhY.push !== 'function') {window.GoogleTyFxhY = [];}window.GoogleTyFxhY.push({'_scs_': 'BR2W_jGbVWOPCBI-xMfbOi7gDAAAAADgB4AQC','_bgu_': ''
ElijahLynn /
Last active Mar 14, 2017
Quickly change timezone from the command line
# I make an abbreviation with `abbr --add ct change_timezone` and then just type `ct ny`.
function change_timezone --description "Change timezone to; LA or NY"
set --local zone $argv[1]
if string match --ignore-case --quiet 'LA' $zone
timedatectl set-timezone America/Los_Angeles
echo 'set zone to America/Los_Angeles'
else if string match --ignore-case --quiet 'NY' $zone
timedatectl set-timezone America/New_York
echo 'set zone to America/New_York'