Skip to content

Instantly share code, notes, and snippets.

View tenken's full-sized avatar

David Gurba tenken

View GitHub Profile
@tenken
tenken / git-pushing-multiple.rst
Created February 13, 2018 23:32 — forked from rvl/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@tenken
tenken / post-mortem-template.md
Created September 13, 2017 18:13 — forked from juliandunn/post-mortem-template.md
Post mortem template

INCIDENT DATE - INCIDENT TYPE

Meeting

Waiving meetings

In some cases the IC might determine that a PM meeting for the incident isn't needed. If the IC decides to waive the meeting please replace the Meeting section with a note indicating the meeting has been waived (example: Meeting waived: Paul Mooring)

@tenken
tenken / vbo-fast-bulk-selection.php
Created May 23, 2017 16:26
Example Prototype of fast item selection using VBO
<?php
// This example code is for D7. It uses a single hardcoded queue named essentially "workqueue_001".
// A relatively simple revision to this code may add a vbo_configurable form to the Action defintion
// to support any previously created EntityQueue as the list storage mechanism. Although in VBO-3.4
// this vbo_configurable attempt is breaking for me with a search_api based View display. Meh.
function prez_bulkadmin_action_info() {
return array(
'prez_bulkadmin_add_staff_work_queue_01' => array(
@tenken
tenken / .sh
Created October 21, 2016 21:03
Example of git diff --names-only usage on Project
dgurba at aw-dgurba in .../presidency/drupal7-project on master△
$ git diff --name-only master...add-sqlite-migrate-wizard
build/gemini/htdocs/sites/presidency-ets-gemini/modules/contrib/config_pages/CHANGES.TXT
build/gemini/htdocs/sites/presidency-ets-gemini/modules/contrib/config_pages/LICENSE.txt
build/gemini/htdocs/sites/presidency-ets-gemini/modules/contrib/config_pages/README.txt
build/gemini/htdocs/sites/presidency-ets-gemini/modules/contrib/config_pages/TODO.TXT
build/gemini/htdocs/sites/presidency-ets-gemini/modules/contrib/config_pages/config_pages.admin.inc
build/gemini/htdocs/sites/presidency-ets-gemini/modules/contrib/config_pages/config_pages.features.inc
build/gemini/htdocs/sites/presidency-ets-gemini/modules/contrib/config_pages/config_pages.field.inc
build/gemini/htdocs/sites/presidency-ets-gemini/modules/contrib/config_pages/config_pages.inc
{
"cap_add" : [],
"cap_drop" : [],
"cmd" : "",
"cpu_priority" : 0,
"ddsm_bind_share" : "",
"devices" : [],
"enable_publish_all_ports" : false,
"enable_restart_policy" : false,
"enabled" : true,
@tenken
tenken / convert.sh
Created March 8, 2016 22:20 — forked from akost/convert.sh
Bash script for recursive file convertion windows-1251 --> utf-8
#!/bin/bash
# Recursive file convertion windows-1251 --> utf-8
# Place this file in the root of your site, add execute permission and run
# Converts *.php, *.html, *.css, *.js files.
# To add file type by extension, e.g. *.cgi, add '-o -name "*.cgi"' to the find command
find ./ -name "*.php" -o -name "*.html" -o -name "*.css" -o -name "*.js" -type f |
while read file
do
@tenken
tenken / windows-1251-convert.sh
Created March 3, 2016 23:58 — forked from mustangostang/windows-1251-convert.sh
Convert windows-1251 to utf-8
#!/bin/zsh
for file in ./**/*.php
do
iconv -f windows-1251 -t UTF-8 "$file" > "${file%.php}-utf8.php"
rm $file
mv ${file%.php}-utf8.php $file
done
#!/usr/bin/env bash
echo "Nooma.tv Recording Script"
hash recordmydesktop 2>/dev/null || { echo >&2 "I require recordmydesktop but it's not installed. Aborting."; exit 1; }
recordmydesktop --x=100 --channels 2 --freq 44100 --width 1200 -height 720 --follow-mouse --no-frame -o /home/dgurba/720.ogv &
PID=$!
sleep 9000
# Send recordmydesktop the Ctrl+C it wants to Stop recording.
kill -INT $PID
@tenken
tenken / exec style aliases
Created February 7, 2016 16:56 — forked from hilbix/exec style aliases
`git exec` to exec command within GIT directory. `git top` to exec on submodule top level directory (somewhat).
git config --global alias.exec '!exec '
git config --global alias.top '!f() { GIT_TOP="${GIT_DIR%%/.git/modules/*}"; [ ".$GIT_TOP" != ".$GIT_DIR" ] && cd "$GIT_TOP"; exec "$@"; }; f'
# THIS IS PUBLIC DOMAIN.
#
# `git exec` executes something in the current GIT module's base directory. `git exec pwd` gives this base.
# Stolen from http://stackoverflow.com/questions/957928/is-there-a-way-to-get-the-git-root-directory-in-one-command/957978#comment9747528_957978
#
# `git top` is like `git exec`, but executes in the topmost GIT directory, even from within a GIT submodule.
@tenken
tenken / certchain.sh
Created January 18, 2016 01:52 — forked from joshenders/certchain.sh
Simple Bash function to visualize PKI chain-of-trust for a given domain
function certchain() {
# Usage: certchain
# Display PKI chain-of-trust for a given domain
# GistID: https://gist.github.com/joshenders/cda916797665de69ebcd
if [[ "$#" -ne 1 ]]; then
echo "Usage: ${FUNCNAME} <ip|domain[:port]>"
return 1
fi
local host_port="$1"