Skip to content

Instantly share code, notes, and snippets.

View itsx's full-sized avatar

Tom Bartek itsx

  • Flat Zone
View GitHub Profile
@itsx
itsx / query.txt
Created January 4, 2023 16:02
FZ api query
query SearchByDistance($location: GpsInput!, $radius: Int!) {
searchByDistance(location: $location, radius: $radius) {
count
percentage
bbox {
topLeft {
lat
lon
}
bottomRight {
@itsx
itsx / aws-lambda-relative-import-no-known-parent-package.md
Created October 11, 2022 15:12 — forked from gene1wood/aws-lambda-relative-import-no-known-parent-package.md
Python relative imports in AWS Lambda fail with `attempted relative import with no known parent package`

Python relative imports in AWS Lambda fail with attempted relative import with no known parent package

The Problem

In AWS Lambda if I attempt an explicit relative import like this

.
├── lambda_file.py
└── example.py
@itsx
itsx / instance-name-tag.sh
Created May 5, 2022 12:59 — forked from swithrow/instance-name-tag.sh
EC2 Instance Name Tag in the bash prompt.
#!/bin/bash
#
# copy this into /etc/profile.d/instance-name-tag.sh
#
# you will need:
# - curl, jq, and aws cli installed
# - an IAM role that gives the EC2 instance access to describe tags
#
@itsx
itsx / susan_sontag.txt
Created February 25, 2022 01:57
Susan Sontag
"Označí-li někdo jisté místo jako peklo, nesděluje tím samozřejmě nic o tom, jak z něj vyvést lidi a jak plameny pekelné zmírnit. Přesto se zdá, že uvědomit si v plné míře, kolik utrpení způsobuje lidská špatnost ve světě, který sdílíme s druhými, je samo o sobě prospěšné. Pokud někoho neustále překvapuje existence nemravného jednání nebo trpí deziluzí (či dokonce nedůvěrou), má-li čelit svědectví o tom, jakých děsivých a samozřejmých krutostí jsou lidé schopni, nedosáhl mravní a psychologické dospělosti. Po dosažení určitého věku nemá na tento druh nevinnosti a povrchnosti, na podobnou nevšímavost a nevědomost právo nikdo."
Susan Sontag: S bolestí druhých před očima
@itsx
itsx / update-route53-dns.sh
Created October 6, 2021 11:44 — forked from davidyilee/update-route53-dns.sh
A script to update DNS on Route 53
#!/bin/sh
# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
# Load configuration
. /etc/route53/config
@itsx
itsx / checkopenssl.md
Created August 31, 2021 17:10 — forked from therealmarv/checkopenssl.md
Check OpenSSL version from Python

Open python

python

and type

>>> import ssl
>>> ssl.OPENSSL_VERSION
'OpenSSL 1.0.1g 7 Apr 2014'
@itsx
itsx / redis_cheatsheet.bash
Created May 25, 2021 11:11 — forked from Yogendra0Sharma/redis_cheatsheet.bash
Redis Cheatsheet - Basic Commands You Must Know
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
@itsx
itsx / ttfb.sh
Created May 13, 2021 12:15 — forked from sandeepraju/ttfb.sh
curl command to check the time to first byte
#!/bin/bash
# file: ttfb.sh
# curl command to check the time to first byte
# ** usage **
# 1. ./ttfb.sh "https://google.com"
# 2. seq 10 | xargs -Iz ./ttfb.sh "https://google.com"
curl -o /dev/null \
-H 'Cache-Control: no-cache' \
-s \
@itsx
itsx / gist:ab596ff53fbbd6c8693a60fff94d0757
Last active July 29, 2020 08:00
Filebeat install playbook (unfinished)
#################################################
# DO Community Playbooks: Filebeat
#################################################
---
- hosts: docker
become: true
vars_files:
#- vars/default.yml
tasks:
@itsx
itsx / etc_hosts_update.sh
Created June 22, 2020 07:54
Performes update of hostname ip address in /etc/hosts for all hostnames specified on a commandline. We cron this script and use /etc/hosts as a local dns cache
#!/usr/bin/env bash
#
# Performes update of hostname ip address in /etc/hosts for all hostnames specified on a commandline
# USAGE: etc_hostname_update hostname1 hostname2 ...
set -o errexit
set -o nounset
set -o pipefail
readonly HOSTS_FILE_PATH="/etc/hosts"