Skip to content

Instantly share code, notes, and snippets.

Working from home

Avner Cohen AvnerCohen

Working from home
View GitHub Profile
AvnerCohen / osx_volume_balance_fix.script
Created Sep 20, 2022
OSX Apple Script - Jabra mute fix (input volume) and Balance fix (just a wtf)
View osx_volume_balance_fix.script
set volume 100
tell application "System Preferences"
set current pane to pane ""
delay .6
reveal (first anchor of current pane whose name is "output")
end tell
tell application "System Events"
AvnerCohen /
Created Jun 23, 2022
boto3 based script to find ELB (AWS Load balancers) without targets (very näive, use with cautios)
import boto3
def main():
client = boto3.client('elbv2')
load_balancers = client.describe_load_balancers()
for lb in load_balancers['LoadBalancers']:
lb_arn = lb['LoadBalancerArn']
attr_for_lb = client.describe_listeners(LoadBalancerArn=lb_arn)
AvnerCohen /
Created Apr 25, 2022
Find and Install On Mac, Latest Iterm2
#!/bin/bash -e
URL_TO_DOWNLOAD=$(curl -s "" | grep "" | head -1 | awk '/http/{ print $4 }' | sed -e 's/"/\n/g' | sed -n '2p')
curl -L -s -o $URL_TO_DOWNLOAD
mv /Applications
echo "Done - Installed - ${URL_TO_DOWNLOAD}"
AvnerCohen /
Created May 20, 2021
Automatic Git Tagging for Shared Libraries
# When executing in circleci, make sure a user is defined in git config
CURRENT_NAME=$(git config
if [[ -z $CUR_NAME ]]; then
git config "CI USER"
git config
echo "Git names init done."
AvnerCohen / example.ts
Created May 31, 2020
Deno standard library MD5 example.
View example.ts
import { Md5 } from ""
const md5 = new Md5();
// Other hash functions -
AvnerCohen /
Last active May 24, 2020
SOX Examples - Various Audio manipulations

Use to cut 5 seconds from end of the file.

sox input output reverse trim 5 reverse

Converts the samplerate to 48kHz:

sox infile.wav -r 48k outfile.wav

AvnerCohen /
Created Nov 27, 2019
Show List of files changed since last commit - allow to feed that into CI operations that needs some optimization, say linting on YAMLs
#!/bin/bash -e
LATEST_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
git diff --name-only --diff-filter=ACM $LATEST_TAG HEAD
AvnerCohen /
Created Jul 26, 2018
Install popller and pdfparser on Centos 6 / Amazon AMI
#!/bin/bash -e
set -x
# Poppler is used by resume parser for a faster PDF data extraction.
# Deploy is a bit man ual and complicated because of the C libs involved
# the fact no pip is used (anaconda and not virtualenev) and that the
# Cmake version eeds to be be udpated as part of it.
View random.rb
Random gist with no data.
Testing the alers
View gist:663597c3423f13ad0cb6527573eb24c5
aws_access_key_id = AKIHONEYPOTHONEYPPKA
aws_secret_access_key = juBYW/RHTE1ki+DyDFG/uPIhtwO9hm9+8+ErzMo9
honeypot = True