Skip to content

Instantly share code, notes, and snippets.

View landsman's full-sized avatar

Michal Landsman landsman

View GitHub Profile
@landsman
landsman / uao.md
Created May 3, 2024 14:15 — forked from sgyyz/uao.md
uao command - unzip your project and import to intellij automatically
  1. import project into idea command
$ curl -L "https://gist.githubusercontent.com/chrisdarroch/7018927/raw/9a6d663fd7a52aa76a943fe8a9bc6091ad06b18d/idea" -o /usr/local/bin/idea
$ chmod +x /usr/local/bin/idea
  1. unzip and open project command
$ curl -L "https://gist.githubusercontent.com/sgyyz/adfa4f05af3d81cf0e17e19cf7044c85/raw/b6b9e871d5a4f5435a09d00b0a52e3db0b90699a/uao.sh" -o /usr/local/bin/uao.sh
$ chmod +x /usr/local/bin/uao.sh
$ ln -sf /usr/local/bin/uao.sh /usr/local/bin/uao
@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