Skip to content

Instantly share code, notes, and snippets.

View cema-sp's full-sized avatar
🗺️
Living life

Semyon Pisarev cema-sp

🗺️
Living life
View GitHub Profile
alias l='ls -1A' # Lists in one column, hidden files.
alias ll='ls -lh' # Lists human readable sizes.
alias lr='ll -R' # Lists human readable sizes, recursively.
alias la='ll -A' # Lists human readable sizes, hidden files.
alias lm='la | "$PAGER"' # Lists human readable sizes, hidden files through pager.
alias lx='ll -XB' # Lists sorted by extension (GNU only).
alias lk='ll -Sr' # Lists sorted by size, largest last.
alias lt='ll -tr' # Lists sorted by date, most recent last.
alias lc='lt -c' # Lists sorted by date, most recent last, shows change time.
alias lu='lt -u' # Lists sorted by date, most recent last, shows access time.
@cema-sp
cema-sp / select.sql
Created October 6, 2016 13:27
Time series selection
select
d, sum(COALESCE(value,0))
from
generate_series('2016-01-01', '2016-10-01', '1 months'::interval) as "d"
left join
metrics_raw
on
d = date_trunc('months', metrics_raw.timestamp)
where
metrics_raw.type is null OR
@cema-sp
cema-sp / update.sh
Created March 21, 2016 13:32
Bundle update local source
bundle update --local --source ./path
@cema-sp
cema-sp / webpack-dev-server.coffee
Created February 2, 2016 11:11
Gulp task for webpack-dev-server
gulp = require 'gulp'
util = require 'gulp-util'
webpack = require 'webpack'
WebpackDevServer = require 'webpack-dev-server'
webpackConfig = require '../../../config/webpack.js'
gulp.task 'webpack-dev-server', (callback) ->
# Start a webpack-dev-server
myConfig = Object.create webpackConfig
compiler = webpack myConfig
uptime
dmesg | tail
vmstat 1
mpstat -P ALL 1
pidstat 1
iostat -xz 1
free -m
sar -n DEV 1
sar -n TCP,ETCP 1
top
@cema-sp
cema-sp / httpd.conf
Created November 25, 2015 08:46
Apache config for Middleman (from tille)
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
@cema-sp
cema-sp / README.md
Created November 23, 2015 07:37
CoreOS configuration

Create config drive:

mkdir -p /tmp/new-drive/openstack/latest
cp user_data /tmp/new-drive/openstack/latest/user_data
mkisofs -R -V config-2 -o configdrive.iso /tmp/new-drive
rm -r /tmp/new-drive
@cema-sp
cema-sp / gist:97d2d4c824510b3dcddd
Created June 26, 2015 10:54
config/application.rb
# config/application.rb
config.generators do |g|
g.assets = false
g.helper = false
end
config.action_controller.include_all_helpers = false
config.active_record.schema_format = :sql
config.colorize_logging = false
favicon.ico, который кладем в корень сайта
В html
<link rel="apple-touch-icon" sizes="192x192" href="favicons/favicon-192x192.png">
<link rel="icon" type="image/png" sizes="192x192" href="favicons/favicon-192x192.png">
<meta name="msapplication-config" content="browserconfig.xml">
В browserconfig.xml
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
@cema-sp
cema-sp / sources.list
Created March 24, 2015 08:02
Ubuntu Trusty RU sources
deb http://ru.archive.ubuntu.com/ubuntu/ trusty main restricted universe
# deb-src http://archive.ubuntu.com/ubuntu/ trusty main restricted universe
deb http://ru.archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe
# deb-src http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe
# deb http://ru.archive.ubuntu.com/ubuntu/ trusty-backports main restricted
# deb-src http://ru.archive.ubuntu.com/ubuntu/ trusty-backports main restricted
deb http://ru.archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse