Skip to content

Instantly share code, notes, and snippets.


Marek Skrobacki skrobul

View GitHub Profile
chrisroos / hsbc-friendly-account-names.user.js
Created Feb 7, 2014
A simple Greasemonkey style user script to replace account numbers with friendly names in the HSBC business banking user interface
View hsbc-friendly-account-names.user.js
// ==UserScript==
// @name HSBC - Friendly account names
// @namespace
// @description Replace account numbers with friendly names to help differentiate accounts in HSBC UK Business banking
// @include*
// ==/UserScript==
(function() {
var accounts = {
'12345678': 'Current account',
arvidkahl /
Created Feb 21, 2012
recursive unrar script (with rm) that keeps directory structure intact
for f in `find . -type f -name "*.rar"`
echo "Unpacking " $f " into " `dirname $f`
unrar x -y $f `dirname $f`
rm $f
tach /
Last active Aug 7, 2016
My tips using Synology NAS (DS215j)

Synology NAS Tips

Shell operation tips

Password of root is same as administrator account as you created on setup.

How to change shell prompt

PS1="\u@\h:\w$ "
View get-docker-socket-from-remote
# get-docker-socket-from-remote <name> <user>@<host>
# Create a unix socket at /tmp/<name>-docker.sock which, when
# used will ssh to <user>@<host> and connect to the docker
# socket at <host>:///var/run/docker.sock
# Note:
# 1. This forks a subjob that manages the local socket.
# Rmember to kill that when your finished
joelmoss / gist:2470666
Created Apr 23, 2012
Capistrano recipe for Puma start/stop/restarts
View gist:2470666
set :shared_children, shared_children << 'tmp/sockets'
namespace :deploy do
desc "Start the application"
task :start, :roles => :app, :except => { :no_release => true } do
run "cd #{current_path} && RAILS_ENV=#{stage} bundle exec puma -b 'unix://#{shared_path}/sockets/puma.sock' -S #{shared_path}/sockets/puma.state --control 'unix://#{shared_path}/sockets/pumactl.sock' >> #{shared_path}/log/puma-#{stage}.log 2>&1 &", :pty => false
desc "Stop the application"
task :stop, :roles => :app, :except => { :no_release => true } do
stevenhaddox /
Last active Jun 16, 2018
Bootstrap Synology DS215j DSM 5.x provisioner steps

Boostrap the Synology DS215j with optware, ipkg, and sudo

Inspired mostly from the Bootstrap DS215j blog post

Download & Install ipkg in a persistent manner

# Create a directory that won't get nuked during DSM security updates
mkdir /volume1/@optware
cd /volume1/@optware
dangreaves /
Last active May 19, 2019
Installing Sentry on Debian

Installing Sentry on Debian

Install aptitude packages

sudo apt-get update
sudo apt-get install python python-setuptools python-pip python-dev libxslt1-dev libxml2-dev libmysqlclient-dev

Install and activate virtualenv

sudo pip install -U virtualenv
virtualenv /clients/sentry/
source /clients/sentry/bin/activate
f-f /
Last active Jul 31, 2019 — forked from robphoenix/
Spacemacs Cheat Sheet

Useful Spacemacs commands

  • SPC q q - quit
  • SPC w / - split window vertically
  • SPC w - - split window horizontally
  • SPC 1 - switch to window 1
  • SPC 2 - switch to window 2
  • SPC w c - delete current window
  • SPC TAB - switch to previous buffer
  • SPC b b - switch buffers
ryanray / deploy.rb
Created Nov 21, 2013
I couldn't find a quick example of how to deploy a node.js app using Capistrano 3. This gist assumes you are using Capistrano 3, Upstart, Forever, ssh/forward agent, and an unprivileged user named 'deploy'. Hopefully this simple setup will help to get you started.
View deploy.rb
# config/deploy.rb
# probably a lot of ways to improve this...
set :application, 'my_app'
set :repo_url, ''
# should set up a deploy user
set :user, 'deploy'
set :deploy_to, '/var/www/my_app'
set :scm, :git
janko / 01-activerecord.rb
Created May 27, 2015
PostgreSQL JSON querying in Sequel (my presentation from our local Ruby meetup)
View 01-activerecord.rb
require "active_record"
ActiveRecord::Migration.verbose = false
ActiveRecord::Migration.class_eval do
create_table :played_quizzes, force: true do |t|
t.integer :player_ids, array: true
t.json :quiz_snapshot