Skip to content

Instantly share code, notes, and snippets.

Avatar
🔥
fintech

Michal Landsman landsman

🔥
fintech
View GitHub Profile
@landsman
landsman / domains.txt
Last active Oct 25, 2020
email domains fixer
View domains.txt
# 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 Jul 20, 2020
golden cage for user
View .bash_aliases
# 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 Jan 19, 2020
drupal 8 deployment backup - 2y ago
View gist:e229888c7cb8a400851976dd59f029ca
# 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 Sep 2, 2019
AWS: Install docker and docker-compose on Amazon Linux 2
View aws_linux_docker_install.sh
#!/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
@landsman
landsman / mojave.sh
Created Jun 5, 2019
virtualbox mojave setup
View mojave.sh
#!/bin/bash
readonly VM_RES="1366x768"
readonly NAME="Hackintosh"
VBoxManage modifyvm "$NAME" --usbxhci on --firmware efi --chipset ich9 --mouse usbtablet --keyboard usb
VBoxManage setextradata "$NAME" "CustomVideoMode1" "${VM_RES}x32"
VBoxManage setextradata "$NAME" VBoxInternal2/EfiGraphicsResolution "$VM_RES"
VBoxManage modifyvm "$NAME" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
VBoxManage setextradata "$NAME" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"
VBoxManage setextradata "$NAME" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
@landsman
landsman / DevTools.java
Last active Mar 26, 2019
dump whatever object type you want to console output, inspired by https://dzone.com/articles/introduction-to-json-with-java
View DevTools.java
package helper;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
public final class DevTools
{
public static String dump(Object stuff) throws JsonProcessingException {
System.out.println(convertObject(stuff));
return null;
View RouterFactory.php
<?php
namespace App;
use Nette;
use Nette\Application\Routers\RouteList;
use Nette\Application\Routers\Route;
use Kdyby\Doctrine\EntityManager;
use App\Model\CatalogModel;
use App\Model\PageModel;
@landsman
landsman / fix_airbank_ib.js
Created Feb 4, 2019
Dear Airbank, this is tutorial how to fix your Internet Banking. Leave me there email where can I send invoice. Thanks.
View fix_airbank_ib.js
let popHandler = () => {
document.getElementById("id22a").click(); // click on your stupid fake go back button
}
window.addEventListener('popstate', popHandler, {once: true})
window.history.pushState(null,null,null)
@landsman
landsman / docker_dev.sh
Last active Apr 6, 2020
Pass variables for each docker-compose file - two environments
View docker_dev.sh
#!/bin/bash
echo "Starting fresh containers for DEVELOPMENT"
docker/variables.sh dev.env
docker-compose -f docker/dev/docker-compose.yml up --build --remove-orphans
@landsman
landsman / UTF8Control.java
Created Jan 2, 2019 — forked from DemkaAge/UTF8Control.java
ResourceBundle UTF-8 Control class
View UTF8Control.java
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.util.Locale;
import java.util.PropertyResourceBundle;
import java.util.ResourceBundle;