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$ "
// ==UserScript== | |
// @name HSBC - Friendly account names | |
// @namespace http://chrisroos.co.uk/ | |
// @description Replace account numbers with friendly names to help differentiate accounts in HSBC UK Business banking | |
// @include https://www.business.hsbc.co.uk/* | |
// ==/UserScript== | |
(function() { | |
var accounts = { | |
'12345678': 'Current account', |
#!/bin/bash | |
for f in `find . -type f -name "*.rar"` | |
do | |
echo "Unpacking " $f " into " `dirname $f` | |
unrar x -y $f `dirname $f` | |
rm $f | |
done |
Password of root is same as administrator account as you created on setup.
PS1="\u@\h:\w$ "
#!/bin/bash | |
# 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 |
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 | |
end | |
desc "Stop the application" | |
task :stop, :roles => :app, :except => { :no_release => true } do |
Inspired mostly from the Bootstrap DS215j blog post
# Create a directory that won't get nuked during DSM security updates
mkdir /volume1/@optware
cd /volume1/@optware
sudo apt-get update
sudo apt-get install python python-setuptools python-pip python-dev libxslt1-dev libxml2-dev libmysqlclient-dev
sudo pip install -U virtualenv
virtualenv /clients/sentry/
source /clients/sentry/bin/activate
SPC q q
- quitSPC w /
- split window verticallySPC w
- - split window horizontallySPC 1
- switch to window 1SPC 2
- switch to window 2SPC w c
- delete current windowSPC TAB
- switch to previous bufferSPC b b
- switch buffers# config/deploy.rb | |
# probably a lot of ways to improve this... | |
set :application, 'my_app' | |
set :repo_url, 'git@github.com:USERNAME/my_app.git' | |
# should set up a deploy user | |
set :user, 'deploy' | |
set :deploy_to, '/var/www/my_app' | |
set :scm, :git |
require "active_record" | |
ActiveRecord::Base.establish_connection('postgres:///testing') | |
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 | |
end |