Skip to content

Instantly share code, notes, and snippets.

@osolmaz
osolmaz / poetry_export_requirements.sh
Created September 26, 2022 15:38
Export dependencies with Poetry, only package versions without hashes and platform details, in one line
poetry export --without-hashes --format=requirements.txt | grep -E '^[^# ]' | cut -d ';' -f1 > requirements.txt
@osolmaz
osolmaz / zoom_set_normal_volume.sh
Created March 24, 2020 14:50
Bash script to adjust Zoom meeting microphone and speaker volume to normal levels
#!/bin/sh
LANGUAGE="en_US"
app_name="ZOOM VoiceEngine"
current_sink_num=''
sink_num_check=''
app_name_check=''
@osolmaz
osolmaz / get_tezos_bakers.sh
Created February 23, 2020 12:35
Curl command to get the list of Tezos bakers
curl 'https://tezos-mainnet-conseil-1.kubernetes.papers.tech/v2/data/tezos/mainnet/delegates' -H 'Connection: keep-alive' -H 'Accept: application/json, text/plain, */*' -H 'Origin: https://tezblock.io' -H 'apikey: airgap123' -H 'Content-Type: application/json' -H 'Referer: https://tezos-mainnet-conseil-1.kubernetes.papers.tech/' --data-binary '{"fields":[],"predicates":[{"field":"staking_balance","operation":"gt","set":["8000000000"],"inverse":false}],"orderBy":[{"field":"staking_balance","direction":"desc"}],"limit":1000}' --compressed
@osolmaz
osolmaz / change_mate_font_dpi.sh
Created February 23, 2020 12:32
Change MATE font rendering DPI setting in the terminal
gsettings set org.mate.font-rendering dpi <the_value_you_want>
@osolmaz
osolmaz / compress_gopro.sh
Created June 17, 2019 14:25
Compress MP4's from GoPro w/ Metadata
for i in *.MP4; do ffmpeg -i $i -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 128k -movflags +faststart -vf scale=-2:720,format=yuv420p -map_metadata 0 out/$i; done

Keybase proof

I hereby claim:

  • I am osolmaz on github.
  • I am osolmaz (https://keybase.io/osolmaz) on keybase.
  • I have a public key ASC8HWS7t9oqqF_chSrKxXCC4x2Xd_GGs-fGYsxdq2sQ1Ao

To claim this, I am signing this object:

@osolmaz
osolmaz / lastDays.sh
Created November 24, 2015 21:47 — forked from juanpabloaj/lastDays.sh
git: latest changes grouped by day
#!/bin/bash
a=""
b=""
for i in $(seq 0 10)
do
b=$(git diff --shortstat "@{ $i day ago }")
if [[ "$b" != "$a" ]]; then
echo $(date --date="$i days ago" +%F) $b
fi
a=$b
\ProvidesClass{mydiss}[2013/08/21 v1.4 mydiss class (Michael Ummels)]
\NeedsTeXFormat{LaTeX2e}[1996/06/01]
% Options
\newif\if@iso
\@isofalse
\newif\if@crop
\@cropfalse
class FullPaths(argparse.Action):
"""Expand user- and relative-paths"""
def __call__(self, parser, namespace, values, option_string=None):
setattr(namespace, self.dest, os.path.abspath(os.path.expanduser(values)))
def is_dir(dirname):
"""Checks if a path is an actual directory"""
if not os.path.isdir(dirname):
msg = "{0} is not a directory".format(dirname)
raise argparse.ArgumentTypeError(msg)
@osolmaz
osolmaz / gist:cc5a868f0636c18396e0
Created May 10, 2014 16:41
Unix command to list top 20 directories you cd into
history | grep cd | cut -d' ' -f5 | sort | uniq -c | sort -k1 -n -r | head -n 20