Skip to content

Instantly share code, notes, and snippets.

@webbj74
webbj74 / drupal-quick-dump.sh
Last active October 29, 2023 10:10
Script to dump Drupal database structure, but exclude data from massive/unneeded tables.
#!/bin/bash
# usage: drupal-quick-dump user host database
USER="$1"
HOST="$2"
DB="$3"
DATE=`date +%Y%m%d`
# Get User Password
echo "Please provide the password for ${USER} on db ${DB} hosted at ${HOST}:"
@webbj74
webbj74 / init-org.el
Created September 22, 2015 20:00
org-mode file+function capture template example
;; I am not a regular emacs user and haven't played with lisp for many years.
;; I struggled for a couple of days trying to tweak org-capture-templates to
;; get my desired behavior for journal entries. I hope this helps someone!
;;
;; I have been following the excellent guide http://doc.norang.ca/org-mode.html
;; The "journal" template was the one I wanted to tweak. I use a date-based
;; journal filename, e.g. "2015-09-22-Journal-Entry.org". The contents of the
;; file consist of a top-level headline with a human-friendly date, followed
;; by second-level headline with the time and brief journal note. For example:
;;
@webbj74
webbj74 / Gentoo-Linux-with-FDE-on-Framework-DIY-edition.md
Last active June 22, 2022 18:44
Gentoo Linux with FDE on Framework DIY

Gentoo Linux with FDE on Framework DIY

System Specs

BIOS: InsydeH2O GFW30 03.07 (originally 03.02) Processor: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40 GHz System Bus: 100 MHz System Memory: 3200 MT/s Cache RAM: 5120 MB Total Memory: 16384 MB

@webbj74
webbj74 / CHEATSHEET.md
Created September 26, 2012 14:54
Generic Git Cheatsheet

Git Cheatsheet

Add an upstream remote repo

git remote add <name> <url>
git remote add upstream git@github.com:central-github-repo-username/sitename.git
@webbj74
webbj74 / default-site-redirect.settings.php
Created April 12, 2012 00:42
Drupal Default Site Redirection Template
<?php
/**
* Redirection rules for default Drupal site
*
* This drop-in for the default site's settings.php provides HTTP 301
* redirection rules for any request which does not already have a Drupal
* site folder assigned. Redirect rules are located in the global
* default_redirect array.
*
@webbj74
webbj74 / phpenv-osx.sh
Last active September 6, 2017 23:46
Setup multiple versions of PHP on OSX using homebrew
#!/usr/bin/env bash
# Use this script to install or re-install multiple versions of PHP
# You should be able to re-run the script multiple times; it will update/reinstall what it needs.
# Check OS
if [ "${OSTYPE//[0-9.]/}" != "darwin" ]; then
echo "This script is intended for OSX users."
exit
@webbj74
webbj74 / name.webbj74
Created June 13, 2014 23:21
OSX Packet Filter Rules for using privateinternetaccess.com VPN
#
# OSX packet filter rules
# References:
# * https://gist.github.com/scy/8122924
#
# The purpose of this config is to make sure that my system uses the
# privateInternetAccess VPN connection for everything and not to communicate
# unencrypted when the VPN connection goes down. Therefore, I block
# everything on the physical interfaces except for ICMP, DHCP, DNS and the
@webbj74
webbj74 / getnarrative.php
Created September 28, 2016 18:20
Sample Narrative API Client
#!/usr/bin/env php
<?php
// Make sure this file is executable (chmod +x getnarrative.php)
// Run as:
// $ ./getnarrative.php <bearerToken>
//
// See: https://github.com/NarrativeOP/python_oauth2_token for method to fetch token
if (empty($argv[1])) {

title: This is my title created: 20160806152645348 modified: 20160806152717955 tags: multi-line-field: | line1 line2 complex-field:

  • line1
@webbj74
webbj74 / webbj74.pp
Last active January 2, 2016 23:19
Personal Boxen manifest
# Personal Boxen Manifest
# File: /opt/boxen/repo/modules/people/manifests/webbj74.pp
#
# Requires the following added to Puppetfile:
#
# github "adium", "1.3.0"
# github "autoconf", "1.0.0"
# github "chrome", "1.1.2"
# github "fitbit", "1.0.0.9.1", :repo => "webbj74/puppet-fitbit"
# github "iterm2", "1.0.4"