Skip to content

Instantly share code, notes, and snippets.

View ikrauchanka's full-sized avatar
🏠
Working from home

ilja K. ikrauchanka

🏠
Working from home
View GitHub Profile
# . THANKS Gary Phillip
<VirtualHost *:80>
ServerName jenkins-ci.mydomain.org
ServerAdmin admin@mydomain.vm
Redirect / https://jenkins-ci.mydomain.org/
</VirtualHost>
<Virtualhost *:443>
@ikrauchanka
ikrauchanka / resources.md
Created March 21, 2019 20:02 — forked from lamont-granquist/resources.md
Three Ways to Write Correct Chef Resources

This has been moved into the official Chef docs:

https://docs.chef.io/custom_resources_notes.html

12.5 style custom resources

This is by far the most recommended way of writing resources for all users. There are two gotchas which we're working through:

  1. For helper functions that you used to write in your provider code or used to mixin to your provider code, you have to use an action_class do ... end block.
@ikrauchanka
ikrauchanka / latency.txt
Created February 21, 2019 00:26 — forked from jboner/latency.txt
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
@ikrauchanka
ikrauchanka / golang_books_sites.md
Created February 1, 2019 20:37 — forked from region23/golang_books_sites.md
Полезные ресурсы для изучающих Go

На русском языке

Русскоязычные сайты и сообщества

English resources

@ikrauchanka
ikrauchanka / last_run_report.yaml
Created November 6, 2018 13:11
/opt/puppetlabs/puppet/cache/state/last_run_report.yaml
--- !ruby/object:Puppet::Transaction::Report
host: xxxxxxxxxx.xxx.xxxx.xxxxxx.zone.bc9d1c0ecc244e7cac142dbebeb4f804899f7f41
time: '2018-11-06T14:06:51.920176837+01:00'
configuration_version: 'efe7389 - Xxxxx Xxxxxxxxxxx, Tue Nov 6 10:45:26 2018 +0300 :
GP_4668_bidlos LAAS'
transaction_uuid: 89a80372-3c4a-4345-85f8-a8db3cf88cba
report_format: 8
puppet_version: 5.4.0
status: unchanged
transaction_completed: true
@ikrauchanka
ikrauchanka / read-aws-flowlogs.go
Created March 24, 2017 22:26
read AWS FlowLogs
/*
Program require access to S3 objects.
It will download gz file, gunzip it, read flat file and convert output into json.
You can use output as a data in HTTP and stream into elastic search(or ELK).
INFO: https://aws.amazon.com/blogs/aws/vpc-flow-logs-log-and-view-network-traffic-flows/
*/
package main
import (
"bufio"
@ikrauchanka
ikrauchanka / list_outdated_cookbooks.py
Last active January 28, 2017 16:37
list_outdated_cookbooks
#!/usr/bin/env python
import os
import urllib2
import json
from packaging import version
import sys
from prettytable import PrettyTable
repo = "/path/to/repo/folder"
exclude_cookbooks = "xxx-"
@ikrauchanka
ikrauchanka / ec2_events.go
Last active August 17, 2016 08:16
golang show scedulled events for EC2 instances
// thanks to https://github.com/rhartkopf/check_ec2_events/blob/master/check_ec2_events.go
// This program will query Amazon API
// and show scedulled events for EC2 instances
// When you have a slack, you would like to see messages in the room:
// 0 6 * * * root /usr/local/bin/instances_event | /usr/local/bin/slacktee.sh --title "upcoming instances events" > /dev/null
package main
import (
"fmt"
@ikrauchanka
ikrauchanka / gist:ddc076308f1297e5a5e8c969a4df1c8e
Created May 29, 2016 18:38
golang return function in function
package main
import (
"fmt"
)
func makeFunction(name string) func() {
return func() {
fmt.Printf("Hello %s", name)
}