Skip to content

Instantly share code, notes, and snippets.

View landsman's full-sized avatar

Michal Landsman landsman

View GitHub Profile
@landsman
landsman / facebook_crawler.sh
Last active February 19, 2024 01:10
Cloudflare IP address whitelist for Google Crawlers, Google Ads: https://developers.google.com/search/docs/crawling-indexing/verifying-googlebot
#!/bin/bash
#
# see: https://developers.facebook.com/docs/sharing/webmasters/crawler/
#
# Run the whois command and store the output in a variable
whois_output=$(whois -h whois.radb.net -- '-i origin AS32934')
# Use grep to extract lines starting with "route"
@landsman
landsman / aws_iam_sso_billing.md
Created July 4, 2023 12:40
AWS tutorials that works for me
@landsman
landsman / postgres_app_mac_os.md
Last active June 26, 2023 15:38
How to work with postgresapp.com on macOS 👏

PostgreSQL on macOS

Remember: Terminal app is your friend, not enemy.

Start

  1. install the app
  2. click on plus icon in the bottom left corner
  3. create a new server: name, version, other form fields left with default values
  4. click to Initialize
@landsman
landsman / gcp-storage-assets.sh
Created August 13, 2021 06:05
test script to send next.js assets to google storage
#!/bin/sh
export ASSETS_FOLDER="../.next/static"
export GCP_BUCKET="eu.apps.trisbee.com/pay"
export VERSION="test-gzip-3"
TIME_START=$(date +%s)
gsutil -m -q \
cp -r -z "js,css,html,json" \
@landsman
landsman / myFAQ.js
Last active April 23, 2021 10:59
draft how to handle faq data for multiple countries on company site
//
// this is my wanna be database
//
// a) I can turn off/on every faq item for each individual country
// b) all locales are by default handled via lingui, and there are no duplicates
// c) it can be easily refactored to API response in future :)
//
export const faqItems = [
{
id: 'whenMoney',
@landsman
landsman / .bash_aliases
Created April 18, 2021 11:02
compress file with progress bar
function compress () {
if [ -z "$1" ]; then
# display usage if no parameters given
echo "Usage: compress <path/folder-or-file> <new-file.tar.gz>"
return 1
fi
tar cf - $1 -P | pv -s $(du -sb $1 | awk '{print $1}') | gzip > $2
}
@landsman
landsman / domains.txt
Last active October 25, 2020 20:24
email domains fixer
# gmail typos
gmall.com,gmail.com
gmeil.com,gmail.com
gmaol.com,gmail.com
gnail.com,gmail.com
gmaii.com,gmail.com
gmail.comm,gmail.com
gmail.con,gmail.com
gmaiiil.com,gmail.com
gmil.com,gmail.com
@landsman
landsman / .bash_aliases
Last active July 20, 2020 20:20
golden cage for user
# system
alias apt='echo "apt"'
alias sudo='echo "sudo"'
alias apt-get='echo "apt-get"'
alias uname='echo "uname"'
alias service='echo "service"'
alias du='echo "du"'
alias df='echo "df"'
alias btrfs='echo "btrfs"'
alias shred='echo "shred"'
@landsman
landsman / gist:e229888c7cb8a400851976dd59f029ca
Created January 19, 2020 18:44
drupal 8 deployment backup - 2y ago
# Deployment
*Build action* process:
```
# copy database parameters
cp "$DPSETTINGSPATH" docroot/sites/default/settings.production.php
# fix chmods
chmod 644 docroot/sites/default/settings.production.php
@landsman
landsman / aws_linux_docker_install.sh
Last active September 2, 2019 16:12
AWS: Install docker and docker-compose on Amazon Linux 2
#!/usr/bin/env bash
sudo amazon-linux-extras install docker -y
sudo systemctl enable docker
sudo systemctl start docker
sudo service docker start
DOCKER_COMPOSE_VERSION=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | sed -n 's/.*tag_name":\s"\(.*\)".*/\1/p' | head -1)
sudo curl -L https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose