This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import argparse | |
import os | |
parser = argparse.ArgumentParser(description='Process input icon and output a set of icons with given sizes') | |
parser.add_argument('file', metavar = 'F', type=str, default="icon.png", help='file to look for') | |
parser.add_argument('--sizes', type=float, nargs='+', default=[20, 29, 40, 60, 76, 83.5], help='sizes for processing') | |
#pass me as parameter to parse_args if any :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% curl -sS https://browser.geekbench.com/mac-benchmarks/ | grep -i "MacBook Air.*2020" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DISCLAMER: straightforward, might break any time xD | |
# this will strip html and will sort strings, so, you will see same model data next to each other | |
search_year=`date +%Y` | |
search_model="" #any model | |
search_model_message="any model" | |
if [ -n "$1" ]; then | |
echo "YEAR supplied: $1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# setup local gems path [yeah, fucking 2020 and it's still a problem] | |
if which ruby >/dev/null && which gem >/dev/null; then | |
PATH="$(ruby -r rubygems -e 'puts Gem.user_dir')/bin:$PATH" | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grep -lr "text to search" . | |
# this is PATH ⤴️ | |
grep -ilr "text to search ignoring case" . | |
mdfind text to search | |
# the system tool, quite powerful - searching for file names & contents (aka Spotlight) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this can be useful to monitor directories which are updated at some interval | |
# or you just curious :) | |
while; do; clear; tree mygitrepo/.git; du -sh mygitrepo; sleep 1; done; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pathlib | |
import argparse | |
import re | |
import datetime | |
parser = argparse.ArgumentParser(description="Looking for gaps in syslogs") | |
parser.add_argument("log", type=pathlib.Path, help="Path to syslog dump") | |
parser.add_argument("-m", "--min-interval", type=int, default=7200, help="Minimal Interval in seconds to print out (default is 2h / 7200 seconds)") | |
parser.add_argument("-r", "--regexp", type=str, help="also look for strings expressed by Regular Expression (python's re syntax)") | |
parser.add_argument("--debug", type=int, help="Stop After X Lines parsed (debug option)") |