Skip to content

Instantly share code, notes, and snippets.

View miry's full-sized avatar

Michael Nikitochkin miry

View GitHub Profile
def method_one(&block)
puts "method_one"
block.call
end
def method_two(&block)
puts "method_two"
block.call
end
@DrPsychick
DrPsychick / git-funcs.sh
Last active April 19, 2021 20:02
Simple bash functions to automate GitHub branches and pull requests
#!/bin/bash
# Workflow: create branch -> create pull request
# git-create-branch-push "issue X"
# -> make changes, commit and push
# github-branch-pr "fix: issue solved" "closes #x"
# -> creates new PR with title and body
#
# Workflow: create branch for issue -> create pull request
# github-issue-branch-push 10
@miry
miry / MOVIE COMPRESSION.md
Last active December 19, 2022 18:04
Automate compressing of video files from GoPro
@miry
miry / nginx-tuning.md
Created June 26, 2019 08:23 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@zero-master
zero-master / GDPR.md
Last active February 14, 2022 20:07
Show visitors from EU countries a page with GDPR message using Cloudflare and .htaccess
@miry
miry / Brewfile
Last active October 28, 2023 11:52
MacOS Brewfile to install default applications. https://github.com/Homebrew/homebrew-bundle
#cask_args appdir: "~/Applications", require_sha: true
cask 'spotify'
cask 'homebrew/cask-versions/firefox-developer-edition'
cask 'signal'
cask 'keybase'
cask 'slack'
cask 'telegram-desktop'
@miry
miry / ssh-github-authorized-keys.sh
Last active June 1, 2018 14:27
Import Github public keys.
# Updated 2017.07.05 Thanks to https://www.reddit.com/user/xeoomd for the url
# from comment https://www.reddit.com/r/devops/comments/6l6uhm/ubuntu_server_1606_on_raspberry_pi_3_via_terraform/djsf1ai/
# Replace GTIHUB_USER with your username in Github
curl -s https://github.com/GTIHUB_USER.keys >> ~/.ssh/authorized_keys
# First version
# curl -s https://api.github.com/users/GTIHUB_USER/keys | grep key | sed 's/.*"key":\s*"\([^\"]*\)"/\1/g' >> ~/.ssh/authorized_keys
@xueshanf
xueshanf / extract_kubecfg_cert.sh
Last active February 13, 2023 13:45
Extract kubernetes cluster credentials from kubecfg
#!/bin/bash
# Input: ./extract_kubecfg_cert.sh my-cluster-name username
# Output: ./my-cluster-name-ca.crt ./username.crt ./username.key
# Exit on error
abort(){
echo $1 && exit 1
}
# Prerequistes
@miry
miry / 01_extract_crt.rb
Last active September 3, 2023 06:32
Extract certificate from the kubernetes config.
require 'optparse'
require 'yaml'
require 'base64'
options = {
config_path: File.join(ENV['HOME'], '.kube', 'config'),
write_dir: File.join(ENV['HOME'], '.kube')
}
OptionParser.new do |opts|