Skip to content

Instantly share code, notes, and snippets.

View smith3v's full-sized avatar

Slava Kuznetsov smith3v

View GitHub Profile
@niquola
niquola / list.md
Last active May 20, 2018 04:52
Must Read from Ravil Bayramgalin (https://github.com/brainopia) + my small adds :)

Books

Concepts-Techniques-Models-Computer-Programming CMT это известная книжка CMT, за которой слава закрепилась не хуже чем у SICP

это из этой книжки классификация различных парадигм Если присмотришься, то увидишь, что Oz поддерживает большинство вариаций (с этой целью его и конструировали, чтобы можно было наглядно продемонстрировать различные подходы в одном языке)

@mikhailov
mikhailov / Vagrantless
Last active October 15, 2017 09:37
Vagrantless (draft), tested on OS X only.
# This the bash script to handle up-and-runnig VM created through Vagrant
#!/usr/bin/env bash
# PRIVATE: error level message
error_message () {
echo "$(tput setaf 1)ERROR: $1$(tput sgr0)"
}
@qetzal
qetzal / gist:6299086
Last active December 21, 2015 11:29
#ulsk Twitter search without spam
#ulsk -UlyanovskCity -#uln -#ulpolit -ulpravda -_media73_ -#m1tv -gerontolog73 -voronin_wi -Upravdom73 -platonova1991 -pysinata -ulsez -spravedlivo_ul -Timofeev -Denc2421 -Simbirsk_RF -mintrud73 -polad_fs
@kirikaza
kirikaza / aws-ec2-find.sh
Last active December 19, 2015 21:59
Finds AWS EC2 instances by name mask.
#!/bin/bash
if ! aws --version 2> /dev/null ; then
echo >&2 "command \`aws' is not found; maybe awscli is not installed"
exit 1
fi
if ! jq --version 2> /dev/null ; then
echo >&2 "command \`jq' is not found; maybe jq is not installed"
exit 1
@babysnakes
babysnakes / README.md
Created June 10, 2012 05:11
Modifying knife bootstrap (from chef) to exit with the exit code from the bootstrap command.

Modifying 'knife bootstrap' to exit with error upon failure.

Here is a description of the steps I took to cause knife bootstrap to exit with error when the remote bootstrap process fails. I was already calling the bootstrap programmatically (because I was adding a lot of business logic to it) so I didn't patch the bootstrap class but pulled out the pieces I needed.

The template.

@jboner
jboner / latency.txt
Last active May 4, 2024 21:16
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@fennb
fennb / gist:1283573
Created October 13, 2011 06:35
nginx microcaching config example
# Set cache dir
proxy_cache_path /var/cache/nginx levels=1:2
keys_zone=microcache:5m max_size=1000m;
# Virtualhost/server configuration
server {
listen 80;
server_name yourhost.domain.com;
# Define cached location (may not be whole site)
@someara
someara / gist:673693
Created November 12, 2010 03:40
chef hostname
bash -c '
echo <%= @config[:chef_node_name] %> > /tmp/chef_node_name
cat /tmp/chef_node_name | cut -d. -f1 > /tmp/proper_hostname
cat /tmp/chef_node_name | cut -d. -f2 | tr -d "\n" > /tmp/proper_dnsdomainname
echo -n "." >> /tmp/proper_dnsdomainname
cat /tmp/chef_node_name | cut -d. -f3 >> /tmp/proper_dnsdomainname
IPV4ADDR=`ip addr | grep eth0 | grep "inet " | cut -d " " -f 6 | cut -d \/ -f 1`
@peplin
peplin / recipe.rb
Created July 10, 2010 01:30
S3 File Resource for Chef
# Source accepts the protocol s3:// with the host as the bucket
# access_key_id and secret_access_key are just that
s3_file "/var/bulk/the_file.tar.gz" do
source "s3://your.bucket/the_file.tar.gz"
access_key_id your_key
secret_access_key your_secret
owner "root"
group "root"
mode 0644
end