Skip to content

Instantly share code, notes, and snippets.

View aorfanos's full-sized avatar
:shipit:

Alexandros Orfanos aorfanos

:shipit:
View GitHub Profile
#A small gist to upload files from CLI, using the file.io API
#Usage: fupload.sh <file> <expiry>
#more info: https://www.file.io/
curl -sF "file=@$1" https://file.io/?expires=$2 | jq -r '.link'
#block an IP range
iptables -I INPUT -m iprange --src-range <from>-<to> -j DROP
@aorfanos
aorfanos / gcs-bucket-make-public.sh
Created November 3, 2020 20:55
make GCS bucket objects public
# folder (specify -r to apply recursively)
gsutil acl -r ch -u AllUsers:R gs://<bucket-name>/<folder-object>
# single object
gsutil acl ch -u AllUsers:R gs://<bucket-name>/<object>
@aorfanos
aorfanos / promql-cheatsheet.md
Last active December 19, 2020 06:19
(WIP) promql-cheatsheet

Aggregation

By metric name

sum({__name__=~"elasticsearch_index_.*"}) by (__name__)
@aorfanos
aorfanos / exp_not_calculator.py
Last active January 19, 2022 00:46
Prometheus alert unit testing expanding notation calculator
'''
Provide a Prometheus series value expanding notation expression such as:
- 10+0x10
- 1+10x5
- 100-10*10
- 5+5x5 40+10x5
And get a reply:
- 10 10 10 10 10 10 10 10 10 10 10
- 1 11 21 31 41 51
@aorfanos
aorfanos / greek-ads
Last active April 14, 2023 22:23
greek-blocklist-domains
0.0.0.0 adman.gr
0.0.0.0 ad2.linkwise.gr
0.0.0.0 adfarm.mediaplex.com
0.0.0.0 adman.antena.gr
0.0.0.0 adman.forthnet.gr
0.0.0.0 adman.in.gr
0.0.0.0 adman.otenet.gr
0.0.0.0 ads.24media.gr
0.0.0.0 ads.e-go.gr
0.0.0.0 ads.meridianbet.gr
0.0.0.0 www.googletagservices.com
0.0.0.0 www-googletagmanager.l.google.com
0.0.0.0 www-google-analytics.l.google.com
0.0.0.0 www.googleadservices.com
0.0.0.0 www.analytic-google.com
0.0.0.0 tpc.googlesyndication.com
0.0.0.0 stats.g.doubleclick.net
0.0.0.0 static.doubleclick.net
0.0.0.0 ssl.google-analytics.com
0.0.0.0 s.innovid.com