Skip to content

Instantly share code, notes, and snippets.

View x2es's full-sized avatar

Konstantin x2es

  • Saint-Petersburg
View GitHub Profile
x2es / la_control.rb
Created February 23, 2011 15:54
Controls server load by 1min load average bounds using SIGSTOP and SIGCONT signals
#!/usr/bin/env ruby
# -- 8< --
# Original source:
# Author: x@ES (
# This is draft.
# For load test you can run in therminal
# $ perl -e '$|=1;do{$l==$r or print "."; $l=$r}until(($r=time-$^T)>5000)'
x2es /
Created March 26, 2016 21:28

actual RAM available

$ free | grep 'buffers/cache' | awk '{ print $4 }'

x2es /
Created January 20, 2018 01:36 — forked from branneman/
Better local require() paths for Node.js

Better local require() paths for Node.js


When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

var Article = require('../../../models/article');

Those suck for maintenance and they're ugly.

Possible solutions

echo "# This file is GENERATED, all changes would be overwritten by ~/bin/build_ssh_config, place config to ~/.ssh/config.d/ instead" > ~/.ssh/config
cat ~/.ssh/config.d/* >> ~/.ssh/config
require 'bundler/inline'
gemfile do
source ''
gem "dry-schema"
gem "awesome_print"
gem "minitest"