Skip to content

Instantly share code, notes, and snippets.

View morkot's full-sized avatar
🇺🇦

Andrii Melekhovskiy morkot

🇺🇦
View GitHub Profile

AWS CLI Examples with filters and queryies

Get latest Amazon Linux AMI

aws ec2 describe-images \
  --owners amazon \
  --filters 'Name=name,Values=amzn-ami-hvm-2018.??.?.*-x86_64-gp2' 'Name=state,Values=available' \
  | jq -r '.Images
 | sort_by(.CreationDate)
@morkot
morkot / docker-completion-for-zsh-with-prezto.md
Created August 16, 2017 14:26
Docker completion for zsh with prezto

How-to activate completion for docker client in zsh and prezto

  • get zsh completion
curl -fLo ~/.zprezto/modules/completion/external/src/_docker \
https://raw.githubusercontent.com/docker/cli/master/contrib/completion/zsh/_docker
  • activate completion plugin in .zpeztorc

Keybase proof

I hereby claim:

  • I am morkot on github.
  • I am melekhovskiy (https://keybase.io/melekhovskiy) on keybase.
  • I have a public key ASA6eSd3i3pcQ_mxoj4fJtHJbV8JgVo1g3r70z2-WH-Ecgo

To claim this, I am signing this object:

@morkot
morkot / aws-example-user-data-script.sh
Created February 28, 2017 02:49
Example of simple script to demonstrate User Data and Meta Data usage in AWS EC2
#! /bin/bash
META_DATA_URL="http://169.254.169.254/latest/meta-data/"
ATTRIBUTES="public-hostname instance-id"
INDEX=/var/www/html/index.html
yum install httpd -y
chkconfig httpd on
echo '<!DOCTYPE html>
@morkot
morkot / gist:5509a4f6a663e619ca08d3e09a5d9c7a
Created February 6, 2017 11:40 — forked from mimikadze/gist:d0cc268c8c1f307c604be08fca2084fd
Material Theme for Midnight Commander
# Start with export LC_ALL=C && mc on OSX
[skin]
description = Solarized (mostly) dark skin for Midnight Commander.
256colors = true
[Lines]
horiz = ─
vert = │
lefttop = ┌
righttop = ┐
@morkot
morkot / Material Theme.itermcolors
Created January 30, 2017 17:23 — forked from Revod/Material Theme.itermcolors
Material Theme For iTerm2
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Color Space</key>
<string>sRGB</string>
<key>Blue Component</key>
<real>0.25882352941176473</real>
@morkot
morkot / http-benchmark.md
Created October 11, 2016 10:33 — forked from denji/http-benchmark.md
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)

Tools

Located in alphabetical order (not prefer)

  • ab – slow and single threaded, written in C
  • apib – most of the features of ApacheBench (ab), also designed as a more modern replacement, written in C
  • baloo – Expressive end-to-end HTTP API testing made easy, written in Go (golang)
  • bombardier – Fast crossplatform HTTP benchmarking tool, written in Go (golang)
  • boom – HTTP(S) load generator, ApacheBench (ab) replacement, written in Go (golang)
  • curl-loader – performance loading of various application services and traffic generation, written in C
@morkot
morkot / ConEmu-MaterialColorTheme.xml
Last active November 1, 2016 12:05
Color themes for ConEmu
<key name="Palette1" modified="2016-09-26 04:32:25" build="160914">
<value name="Name" type="string" data="Material"/>
<value name="ExtendColors" type="hex" data="00"/>
<value name="ExtendColorIdx" type="hex" data="0e"/>
<value name="TextColorIdx" type="hex" data="00"/>
<value name="BackColorIdx" type="hex" data="10"/>
<value name="PopTextColorIdx" type="hex" data="10"/>
<value name="PopBackColorIdx" type="hex" data="10"/>
<value name="ColorTable00" type="dword" data="00383226"/>
<value name="ColorTable01" type="dword" data="00423607"/>
@morkot
morkot / ConEmu-MaterialTheme.xml
Created February 8, 2016 11:43 — forked from rajadain/ConEmu-MaterialTheme.xml
ConEmu Material Theme
<key name="Colors" modified="2015-12-10 22:46:43" build="151210">
<value name="Count" type="dword" data="00000001"/>
<key name="Palette1" modified="2015-12-10 22:46:43" build="151210">
<value name="Name" type="string" data="Material Theme"/>
<value name="ColorTable00" type="dword" data="004d4335"/>
<value name="ColorTable01" type="dword" data="006b60eb"/>
<value name="ColorTable02" type="dword" data="008de8c3"/>
<value name="ColorTable03" type="dword" data="0095ebf7"/>
<value name="ColorTable04" type="dword" data="00c4cb80"/>
<value name="ColorTable05" type="dword" data="009024ff"/>
@morkot
morkot / gist:72db3fabcbba36f755df
Last active August 29, 2015 14:12
Calculate number of rows in all MySQL databases with total sum (rough)
SELECT IFNULL(TABLE_SCHEMA, 'total') as table_schema, SUM(TABLE_ROWS) as element_count
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA IN (SELECT schema_name FROM information_schema.schemata)
GROUP BY TABLE_SCHEMA WITH ROLLUP;