Skip to content

Instantly share code, notes, and snippets.

View BjornW's full-sized avatar

BjornW BjornW

View GitHub Profile
@BjornW
BjornW / solarize.sh
Created May 13, 2012 15:13 — forked from codeforkjeff/solarize.sh
shell script for setting gnome-terminal color palette to use Solarized theme
#!/bin/sh
#
# Shell script that configures gnome-terminal to use solarized theme
# colors. Written for Ubuntu 11.10, untested on anything else.
#
# Solarized theme: http://ethanschoonover.com/solarized
#
# Adapted from these sources:
# https://gist.github.com/1280177
# http://xorcode.com/guides/solarized-vim-eclipse-ubuntu/
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"
COLOR_NONE="\[\e[0m\]"
@BjornW
BjornW / noise.sh
Last active February 3, 2024 06:02 — forked from rsvp/noise.sh
noise : relaxing ambient Brown noise generator (cf. white noise) | Linux bash script using sox | CogSci notes
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2011-10-04
#
# _______________| noise : ambient Brown noise generator (cf. white noise).
#
# Usage: noise [minutes=59] [band-pass freq center=1786] [wave]
# ^minutes can be any positive integer.
# Command "noise 1" will display peak-level meter.
#
# Dependencies: play (from sox package)
@BjornW
BjornW / wachtwoorden-in-email.md
Last active February 3, 2024 05:57
Waarom wachtwoorden in een email versturen niet verstandig is.md

Organisaties die emails versturen met daarin je gebruikersnaam en wachtwoord realiseren zich blijkbaar niet dat dit een slecht idee is. In dit stukje probeer ik kort en bondig uit te leggen waarom het versturen van wachtwoorden of andere gevoelige informatie per email onveilig is.

Ik gebruik hierbij als metafoor 'de Post' zoals die al honderden jaren acief is

Emails zijn eigenlijk net ansichtkaarten

Email is te vergelijken met een ansichtkaart. Een ansichtkaart heeft geen envelope. Het adres en de boodschap zijn door iedereen die de ansichtkaart verwerkt direct te lezen. Een ansichtkaart wordt daarom niet gebruikt voor gevoelige informatie. Een wachtwoord op een ansichtkaart zetten is daarom onverstandig omdat iedereen dit direct kan lezen.

Om ietwat gevoeligere informatie te versturen gebruik je een envelope. Een envelope bevat een ontvangst adres en eventueel een retour adres. In de envelope stop je de brief of kaart. Daarmee blijft de boodschap met gevoeligere

@BjornW
BjornW / canned-linkedin-connection-request-response.txt
Last active February 3, 2024 05:54
Canned LinkedIn Connection Request reponse
Hi,
Thanks for your interest on connecting via LinkedIn.
Sadly your LinkedIn Connection Request contains just the plain default LinkedIn Connection request text without any context, personal touch or proper introduction. Therefore I assume this LinkedIn Connection Request was written by an automated algorithm and thus has been declined.
Bye!
PS: For any humans reading this, please communicate in a human-friendly way and I will respond accordingly.
@BjornW
BjornW / RandomStringTask.php
Created January 24, 2012 16:32
A first attempt at writing a Phing Task
<?php
require_once "phing/Task.php";
class RandomStringTask extends Task {
/**
* The length of the random string
*/
private $length = 32;
@BjornW
BjornW / gist:8a5566ebe33e767101df8ae7a01295f9
Created June 30, 2021 11:03
In reactie op Internet consultatie https://www.internetconsultatie.nl/terrorismebestrijding Wet verwerking persoonsgegevens coördinatie en analyse terrorismebestrijding en nationale veiligheid
Geachte meneer/mevrouw,
Een heftig en omstreden voorstel dat gaat over de verwerking van gevoelige persoonsgegevens van iedereen in Nederland. Een constructieve reactie daarop kan alleen gegeven worden na een grondige bestudering. Daarvoor zijn vijf werkdagen niet alleen niet genoeg, ze zijn een schoffering van de tegenmacht. Dit kan en moet beter. U heeft hiervoor de mogelijkheden, door deze consultatie opnieuw te doen of de reactietermijn te verlengen en iedereen die wil reageren daarvoor de tijd te geven. Zoals al meerdere organisaties (Amnesty International, Waag, Bits of Freedom etc) publiekelijk hebben betoogd.
Hun voorstel? Minstens vier weken. Ik sluit me daar bij aan. Dat is geen onredelijke eis, maar gewoon de minimumtermijn die hiervoor staat. En dat heeft een reden.
In de hoop dat u mijn en andere reacties mee zult wegen en hierop de juiste beslissing neemt,
@BjornW
BjornW / Setup WordPress Multi-tenant infrastructure
Last active March 16, 2021 04:54
A short description of how I've setup a WordPress Multi-Tenant architecture. This is based on the excellent post by Jason McCreary http://jason.pureconcepts.net/2013/04/updated-wordpress-multitenancy/ and the great ascii art explanations by Wes Koop (https://gist.github.com/weskoop/3796570) & Mark Jaquith (https://gist.github.com/markjaquith/622…
I'm using Ubuntu 12.04 and I'm following the Debian/Ubuntu way of dealing with config files. I presume you know how to work with sudo and such
- Install last stable version of WordPress (in my case 3.6) with Subversion into /opt/wordpress/3.6
- create a symlink /opt/wordpress/stable ==> /opt/wordpress/3.6
- create a directory sites in /var/www/sites
- create a directory specific for your site using the domain name e.g. /var/www/sites/example.com
- create a directory wp-content in /var/www/sites/example.com
- create a directory wordpress in /etc
- create a directory named as you site's domain name, e.g. in /etc/wordpress
- copy from /opt/wordpress/stable/wp-config-sample.php to /etc/wordpress/example.com/wp-config.php
@BjornW
BjornW / gist:e460e519e51d5eec6966176455469357
Created January 9, 2019 09:57
Xiaomi Redmi Note5 Pro notes
Q: How to boot into TWRP after it being installed?
A: Poweroff the phone. Then press power button while keeping the volume up pressed as well until the TWRP logo is shown
<?php print_r(__FILE__); ?>