Skip to content

Instantly share code, notes, and snippets.

View ksemele's full-sized avatar
🐒
devops

Aleksei Krugliak ksemele

🐒
devops
View GitHub Profile
@okkez
okkez / README.md
Created November 27, 2018 03:25
Fluentd Mutual authentication sample

Prepare files and directories

mkdir -p fluentdCA/{private,newcerts,certs,crl}
touch fluentdCA/index.txt
echo 00 > fluentdCA/serial

Setup private CA

Два Git аккаунта

В папке ~/%userprofile%/.ssh/ должен быть config, ключи (публичные *.pub и не публичные без расширения) а так же known_hosts

Config :

# Personal Github
Host github.com
User __________
IdentityFile ~/.ssh/id_rsa
@SheldonWangRJT
SheldonWangRJT / Convert .mov or .MP4 to .gif.md
Last active April 24, 2024 19:11
Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal

This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

Need

Convert .mov/.MP4 to .gif

Reason

As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.

This is not limited to developer, anyone has this need can use this method to convert the files.

@pedroxs
pedroxs / jq-filters.sh
Last active January 22, 2024 13:02
jq - recursive search for keys containing "string" stripping empty results
# recursive search for keys containing "string" stripping empty results
jq '.. | objects | with_entries(select(.key | contains("ftp"))) | select(. != {})'
# same, but output propper array
jq '[ .. | objects | with_entries(select(.key | contains("ftp"))) | select(. != {}) ]'
# or
jq 'map( .. | objects | with_entries(select(.key | contains("ftp"))) | select(. != {}) )'
# transform input from {type: a, amount: 1} to {a: 1} and sum all values by type
jq '[ .[] | {(.type): .amount} ] | map(to_entries) | add | group_by(.key) | map({key: .[0].key, value: map(.value) | add}) | from_entries'
@olih
olih / jq-cheetsheet.md
Last active April 20, 2024 06:34
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq