Skip to content

Instantly share code, notes, and snippets.

View radeksimko's full-sized avatar

Radek Simko radeksimko

View GitHub Profile
@radeksimko
radeksimko / how-to.md
Last active June 22, 2022 11:44
VPC endpoint Terraform example setup

How to

ssh ec2-user@IP
aws configure set region us-west-2
aws s3 ls # listing s3 buckets over VPC endpoint privately
package main
import (
"bufio"
"fmt"
"io"
"net/http"
"os"
"sync"
)
@radeksimko
radeksimko / github_contributions.go
Created June 26, 2015 09:21
Get number of contributions & followers for all members of a GH organization. Run as `go run github_contributions.go ORG_NAME`
package main
import (
"bytes"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"strconv"
@radeksimko
radeksimko / show-invalid-csv-lines.py
Created February 17, 2015 08:05
Usage: ./show-invalid-csv-lines.py <filename.csv>
#!/usr/bin/env python
import sys
DELIMITER = '|'
line_number = 0
with open(sys.argv[1], 'r') as fh:
header = fh.readline()
delim_in_header = header.count(DELIMITER)
@radeksimko
radeksimko / ami-search.sh
Last active August 29, 2015 14:15
Search same AMI in different regions, output in Terraform format
AMI_ID=$1
REGION=$2
output=$(aws --region $REGION ec2 describe-images \
--filter "Name=image-id,Values=$AMI_ID" --output=text | head -1)
ORIGINAL_AMI_NAME=$(echo "$output" | awk -F\t '{print $11}')
ORIGINAL_AMI_OWNER=$(echo "$output" | awk -F\t '{print $12}')
if [[ ! $ORIGINAL_AMI_OWNER =~ ^[0-9]{10,}$ ]]; then
#!/usr/local/bin/bash
RESULTS=`grep ' version ' ./Casks/*.rb`
for RESULT in $RESULTS; do
FILE=$(echo $RESULT | cut -d: -f 1)
VERSION=$(echo $RESULT | cut -d\' -f 2)
OCCURENCE=$(grep -c '$VERSION' $FILE)
if [[ $OCCURENCE -ge 2 ]]; then
@radeksimko
radeksimko / .bash_profile
Last active December 5, 2019 21:51
New MacOS bootstrap
export GOPATH=$HOME/gopath
# Path
export PATH=/opt/local/bin:/usr/local/bin:/opt/local/sbin:/usr/local/sbin:$PATH
export PATH=/usr/local/share/npm/bin:$PATH # NPM
export PATH=/usr/local/mysql/bin:$PATH # MySQL
export PATH=/usr/local/pear/bin:$PATH # Pear
export PATH=/usr/local/opt/gnu-sed/libexec/gnubin:$PATH # sed
export PATH=$GOPATH/bin:$PATH # Go

Keybase proof

I hereby claim:

  • I am radeksimko on github.
  • I am radeksimko (https://keybase.io/radeksimko) on keybase.
  • I have a public key whose fingerprint is A301 4A24 C699 8F16 7D31 FD77 1079 D611 5CFD 80AD

To claim this, I am signing this object:

@radeksimko
radeksimko / gist:9260956
Last active February 25, 2022 10:28
Remove icons from OSX Dock
idsToRemove=(
"com.apple.Notes"
)
plistBuddy='/usr/libexec/PlistBuddy'
dockPlistPath="$HOME/Library/Preferences/com.apple.dock.plist"
for appIDToRemove in $idsToRemove; do
iconsIndexes=`defaults read com.apple.dock persistent-apps | grep tile-type | awk '/file-tile/ {print NR}'`
cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/
git clone git://github.com/wbond/sublime_package_control.git Package\ Control
cd Package\ Control
git checkout python3
# restart Sublime Text 3 and you should have Package Control working