Skip to content

Instantly share code, notes, and snippets.

@gbirke
gbirke / .drone.yml
Last active September 10, 2020 17:54
Notes from my experimentation with Drone CI
---
kind: pipeline
type: docker
name: default
steps:
- name: deploy
image: wikimediade/fundraising-ansible-deploy
pull: never # Until we publish the image
user: ansible
@gbirke
gbirke / dependencies.md
Last active June 7, 2019 13:43
A Wikibase interactive MUD

Node dependencies:

  • wikibase-sdk
  • bluereq
  • vorpal
@gbirke
gbirke / test.md
Last active September 12, 2018 09:54
testing hashes in syntax highlighting

Follow these steps:

if [ -f test ]; then
  echo "exists!"
else 
  echo "missing!"
fi
@gbirke
gbirke / fdeploy.sh
Last active May 13, 2019 13:36
WMDE Fundraising deployment shell menu
#!/bin/bash
HEIGHT=15
WIDTH=40
CHOICE_HEIGHT=4
TITLE="Deploy fundraising apps"
MENU="Choose one of the following options:"
OPTIONS=(T "Fundraising Frontend TEST "
L "Fundraising Frontend LAIKA SKIN"
@gbirke
gbirke / php_feature_toggle_review.md
Last active June 11, 2018 08:39
Overview of PHP feature toggle libraries

Overview of PHP feature toggle libraries

Ordered by personal preference, while thinking about using them for https://github.com/wmde/FundraisingFrontend

Pro:

  • Common checks based on user/environment/date are already defined.
  • Provides logging/audit
  • Allows caching of feature sets so feature config does not need to be read on every request
  • Uses PHP 7
@gbirke
gbirke / update_all.sh
Created February 19, 2018 14:54
Update a mediawiki installation from git repositories
#!/bin/sh
echo "Updating core"
git pull
composer update
for e in extensions/*; do
if [ -d "$e" ]; then
cd $e
echo "Updating $(pwd)"
@gbirke
gbirke / svg-background-test.html
Created December 29, 2017 09:24
Testing SVG background images
<!DOCTYPE html>
<html>
<head>
<title>SVG-Test</title>
<style>
.foo {
background:url('Thank-you-2017-background-900.svg') no-repeat top center;
background:url('https://upload.wikimedia.org/wikipedia/commons/9/9b/Thank-you-2017-background-1200.svg') no-repeat>
background-size: cover;
height:300px;
@gbirke
gbirke / count_error_severities.jq
Last active August 31, 2019 15:21
jq example files
reduce inputs as $obj (
{};
if $obj.severity == "E" then
. + {
($obj.severity): (.[$obj.severity] + 1)
}
else
.
end
)
@gbirke
gbirke / adduser_github_sshpub_key.yml
Created March 27, 2017 12:38 — forked from shohey1226/adduser_github_sshpub_key.yml
Ansible playbook add user using public ssh key on Github
---
- name: add user and create ssh key
user: name=shohei
- name: dowanload pubkey from Github and placed as authorized_keys
get_url: url=https://github.com/shohey1226.keys dest=/tmp/shohei.authorized_keys
delegate_to: 127.0.0.1
- name: Create authorized_keys from the file that just downloaded
authorized_key: user=shohei key="{{ lookup('file', '/tmp/shohei.authorized_keys') }}"
@gbirke
gbirke / php.service
Created November 16, 2016 11:13
Example systemd config for local PHP server
[Unit]
Description=PHP Server
After=home.mount network.target
[Service]
User=vagrant
Group=vagrant
ExecStart=/usr/bin/php -S 127.0.0.1:8000 -t /vagrant/www
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process