Skip to content

Instantly share code, notes, and snippets.

View timothy-r's full-sized avatar

Tim Rodger timothy-r

  • London
View GitHub Profile
egrep -roh 'REDIS_DB_ID=..' /var/run/fleet/units* | sort
sudo mkdir -p /etc/systemd/system/docker.service.d/
# Add the following into /etc/systemd/system/docker.service.d/50-proxies.conf
[Service]
EnvironmentFile=/etc/environment
sudo systemctl daemon-reload
sudo systemctl restart docker
#!/bin/bash
cd /var/run/fleet/units
fleetctl stop *
fleetctl start *.service
export SELENIUM_RC_USER=''
export SELENIUM_RC_HOST=172.17.8.101
export SELENIUM_RC_STARTUP_SCRIPT=''
export SELENIUM_RC_SHUTDOWN_SCRIPT=''
export SELENIUM_RC_BROWSER_NAME=chrome
export SELENIUM_RC_BROWSER=chrome
@timothy-r
timothy-r / gist:6ac86b6393c6b9748d34
Created April 29, 2015 15:53
Destroy and restart my fleetctl services
for s in $(fleetctl list-units | egrep failed | awk '{print $1}')
do
# copy service file to current dir
fleetctl cat $s > $s
fleetctl destroy $s
fleetctl start $s
done
@timothy-r
timothy-r / gist:7acfbee851c430139228
Created April 29, 2015 15:35
Restart my fleet controlled services
for s in $(fleetctl list-units | egrep failed | awk '{print $1}')
do
fleetctl stop $s
fleetctl start $s
done
@timothy-r
timothy-r / gist:1b77d7b80ac787f10c66
Created February 13, 2015 00:29
Some bash functions
# print a column
function col {
awk -v col=$1 '{print $col}'
}
function skip {
n=$(($1 + 1))
cut -d' ' -f$n-
}
@timothy-r
timothy-r / Email auth
Created May 21, 2013 22:08
Discussion of an authentication idea for web applications
I've heard recently that something like 50% of all log in attempts result in a password reset request. (I was resetting my own password for an on-line service at the time.) Password resets generally allow a user to reset an account's password by using a token mailed to them.
So why not support an "email auth" method explicitly rather than by default?
That is to say why not allow users to create accounts with an email address only. To create a session and log in, they only enter their email address, the site then mails to them a short lived, one time token to use to complete the authentication process. Clicking thorough with the url that contains this token in the email and the user is logged in to a new session.
Is this secure?
Yes, it is at least as secure as allowing users to reset their password using a single reset password token. If an attacker has access to your email address they can use it to reset your account's password to whatever they want in the same way that they could use that account to
@timothy-r
timothy-r / gist:5331540
Last active December 15, 2015 22:18
Track a user's history thorough the pages of a web application.
I want a reliable way to track a user's click path through a web application. That is to trace the full path taken and not simply store all the requests and referrers as this wont capture a multi tab session where pages may be loaded by different paths to the same page.
Javascript can set a window's name which persists when the user navigates to a different url and so js can record the user page history for a single window using the name and local storage. But when a page is opened in a new tab/window that history is lost.