Skip to content

Instantly share code, notes, and snippets.

serkan haytac serkanh

View GitHub Profile
serkanh / gist:382bbf454a123214d02681294a1348ad
Last active Feb 27, 2019
search user owned repos excluding forks.
View gist:382bbf454a123214d02681294a1348ad
curl\?per_page\=1000 | jq '.[] | select(.fork==false) | .html_url'
curl\?per_page\=1000 | jq '.[] | select(.fork==false and .language=="JavaScript") | .html_url'
View gist:7493538801411503c2c79e3a6cf1523c
#set -ox
#either pass slack token as a param or env var SLACK_TOKEN=${1:SLACK_TOKEN}
# Get the list of channels
View gist:754dba0d1e8d2e8021085ecfd2f54dc2
aws --profile=HA sns list-subscriptions \
--query 'Subscriptions[*]|[?contains(Protocol,`lambda`)==`false`]|[?contains(Endpoint,`bark`)==`true`]|[?contains(Endpoint,`stg`)==`true`]|[?contains(TopicArn,`d6cbe`)==`false`].{TopicArn:TopicArn}' --output text
View gist:e007fb7550492c5c1eff3a3bfdcf9416
amazon_ips=( $(curl -s | jq -r '.prefixes[] | select(.service=="AMAZON") | .ip_prefix') )
ec2_ips=( $(curl -s | jq -r '.prefixes[] | select(.service=="EC2") | .ip_prefix') )
containsElement () {
local element match="$1"
for element
do [[ "$element" == "$match" ]] && return 0; done
View gist:ba00aca868cc61cc2964754cfed1e2b8
const axios = require('axios');
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
async function fetch_retry(url,n){
serkanh / gist:3d61feded47b975da5f061c90591d0b9
Created Feb 27, 2018
sort ecr images by push date and get the latest
View gist:3d61feded47b975da5f061c90591d0b9
aws --profile=jumpstart ecr describe-images --repository-name lead-front-door \
--query 'sort_by(imageDetails,& imagePushedAt)[-1].imageTags[0]' --output text
View gist:a7b41f4c7625d821d02d477556890ff6
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1
yum install -y aws-cli
yum install epel-release
sed -i 's/enabled=0/enabled=1/' /etc/yum.repos.d/epel.repo
yum update -y
yum install -y gcc libstdc++-devel gcc-c++ fuse fuse-devel curl-devel libxml2-devel mailcap automake openssl-devel git
git clone
cd s3fs-fuse/

Keybase proof

I hereby claim:

  • I am serkanh on github.
  • I am serkanh ( on keybase.
  • I have a public key ASAp7DwjZ8IGntWVJpj59AHS8q3F0W91Z9t7x__65HSocwo

To claim this, I am signing this object:

serkanh / combin
Created Aug 28, 2017
combine multiple log files to single file.
View combin
find . -name "*.log" -print0 | xargs -0 -I file cat file > ~/combined.log
View Delete bucket versions on us-west-2 region
set -e
echo "Removing all versions from $bucket"
versions=`aws --region=us-west-2 s3api list-object-versions --bucket $bucket |jq '.Versions'`
markers=`aws --region=us-west-2 s3api list-object-versions --bucket $bucket |jq '.DeleteMarkers'`
You can’t perform that action at this time.