Skip to content

Instantly share code, notes, and snippets.

Ben Dilley bendilley

  • Skillstream Ltd
  • London, UK
Block or report user

Report or block bendilley

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bendilley
bendilley / mozy_backup.md
Last active Aug 29, 2015
Mozy backup and restore with Linux servers
View mozy_backup.md

Backup to Mozy

sudo mozyutil activate --email hostname@skillstream.co.uk
@bendilley
bendilley / trace.rb
Created Feb 10, 2015
Get a trace from a 'stack too deep' error in Rails
View trace.rb
$enable_tracing = false
#$trace_out = File.open(Rails.root + 'trace.txt', 'w')
set_trace_func proc { |event, file, line, id, binding, classname|
if $enable_tracing && event == 'call'
#$trace_out.puts "#{file}:#{line} #{classname}##{id}"
raise "crash me" if caller_locations.length > 500
end
}
@bendilley
bendilley / Raspberry Pi with Meridian Explorer setup.md
Last active Nov 20, 2015
Raspberry Pi with Meridian Explorer setup
View Raspberry Pi with Meridian Explorer setup.md

Raspberry Pi Meridian Explorer setup

Update firmware using rpi-update and software using apt-get dist-upgrade

Disable onboard sound by commenting it out in /etc/modules

In /etc/modprobe.d/alsa-base.conf comment-out the line

options snd-usb-audio index=-2
@bendilley
bendilley / slow_connection.sh
Last active Aug 29, 2015
Simulate slow connection on OS X/BSD
View slow_connection.sh
# set-up a narrow pipe
sudo ipfw pipe 1 config bw 350kbit/s plr 0.05 delay 500ms
# assign that pipe to all connections on port 8080
sudo ipfw add pipe 1 dst-port 8080
# delete that pipe
sudo ipfw pipe delete 1
# or just flush everything back to its original state
@bendilley
bendilley / VelocityTools2View.java
Created Jan 16, 2013
Spring View which supports the Velocity Tools 2.0 sub-project. Configured using the Spring Bean xml snippet below.
View VelocityTools2View.java
public class VelocityTools2View extends VelocityLayoutView {
private ViewToolManager toolManager;
@Override
protected Context createVelocityContext (Map<String, Object> model,
HttpServletRequest request,
HttpServletResponse response) {
ToolContext toolContext = toolManager.createContext(request, response);
VelocityContext context = new VelocityContext(toolContext);
You can’t perform that action at this time.