Skip to content

Instantly share code, notes, and snippets.

@forgotpw1
forgotpw1 / diskio.sh
Created August 23, 2018 22:18
Disk IO debian
iotop -a -p $(sed 's, , -p ,g' <<<`pgrep "_raid|_resync|jbd2"`)
@forgotpw1
forgotpw1 / gist:0dd4df2674a2f302fb0b3ffb3d1fb5df
Last active February 23, 2018 21:50
Upgrading quasar framework - Maintaining old quasar-cli on upgrades
Install the 0.14-compatible quasar-cli as a dev dependency in your legacy project:
npm install --save-dev [email protected]
this will place the legacy cli in your project node_modules
to run quasar for your project:
npx quasar dev etc
npx is a wrapper that runs ./node_modules/.bin/quasar
source: steveclarke @ quasar discourse channel 2.23.2018
@forgotpw1
forgotpw1 / nginx.conf
Created January 19, 2018 19:11 — forked from sj26/nginx.conf
Proxy mailcatcher with nginx including WebSockets
daemon off;
error_log stderr;
events {
worker_connections 1024;
}
http {
# As suggested in http://nginx.org/en/docs/http/websocket.html
map $http_upgrade $connection_upgrade {
@forgotpw1
forgotpw1 / run_headless_specs.sh
Created June 1, 2016 16:39
Headless rspec run
xvfb-run -a bundle exec rspec spec/
@forgotpw1
forgotpw1 / mailcatcher.sh
Created May 25, 2016 17:12
Expose mailcatcher for remote viewing. Make sure your server is firewalled.
mailcatcher --http-ip=0.0.0.0
@forgotpw1
forgotpw1 / cors.rb
Created November 19, 2015 21:27
Sinatra Response Header To Work Around CORS
response['Access-Control-Allow-Origin'] = '*'
@forgotpw1
forgotpw1 / gist:dc45e9588b6c95c0bdb9
Created October 24, 2015 20:11
Reference different versions of postgresql installed
psql --cluster 9.1/main --version
@forgotpw1
forgotpw1 / gist:c90178145a3cfbb13b7d
Created June 3, 2015 22:46
Find where disk space clutter accumulates on ubuntu
sudo ncdu /
@forgotpw1
forgotpw1 / gist:2b73f61daadc5c66061d
Created April 17, 2015 19:53
Example ShopSense SKU
{:size=>nil, :size_id=>nil, :color=>"FUCHSIA", :color_id=>5639, :vendor_color_id=>1, :sku=>{"color_id"=>1, "no_returns"=>{"enabled"=>false, "message"=>""}, "price"=>{"alternate_copy"=>"", "list_price"=>"&#36;295.00", "list_price_label"=>"Was", "on_sale"=>true, "sale_price"=>"&#36;118.00", "sale_price_label"=>"Now"}, "size_id"=>-1, "sku_id"=>"1689949379079855", "status_alias"=>"waitlist", "status_label"=>"Sold Out > Add to Wait List", "status_message"=>"", "upc"=>"888246184384"}}
@forgotpw1
forgotpw1 / gist:4c2792a0c878d41c32ba
Last active August 29, 2015 14:18
Find out which database tables are locked
SELECT relation, transaction, pid, mode, granted, relname
FROM pg_locks
INNER JOIN pg_stat_user_tables
ON pg_locks.relation = pg_stat_user_tables.relid
WHERE pg_locks.pid='pid';