Skip to content

Instantly share code, notes, and snippets.

View omartrigui's full-sized avatar
🚀
Auf Wiedersehen

Omar Trigui omartrigui

🚀
Auf Wiedersehen
View GitHub Profile
@omartrigui
omartrigui / settings.json
Created March 15, 2024 16:13
VSCode settings
{
"[clojure]": {
"editor.autoClosingBrackets": "always",
"editor.autoClosingOvertype": "always",
"editor.formatOnPaste": true,
"editor.defaultFormatter": "betterthantomorrow.calva"
},
"calva.prettyPrintingOptions": {
"enabled": true,
"width": 120,
@omartrigui
omartrigui / umschreibung-fahrerlaubnis-termin.py
Last active March 7, 2024 12:18
Script: Fahrerlaubnis - Umschreibung einer ausländischen Fahrerlaubnis aus einem Nicht-EU/EWR-Land
from selenium import webdriver
from selenium.webdriver.common.by import By
import time
import notify2
import os
driver = webdriver.Chrome()
notify2.init("Python Notification")
while True:
@omartrigui
omartrigui / nlimit.plist
Created August 10, 2023 16:13
macOS Service: Increased File Limit with launchctl
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>nlimit</string>
<key>ProgramArguments</key>
<array>
<string>launchctl</string>
<string>limit</string>
@omartrigui
omartrigui / markdown-details-collapsible.md
Created July 28, 2023 12:57
Add a collapsible section in markdown

How to add a collapsible section in markdown.

Example

Click me

Some Code

package main
@omartrigui
omartrigui / poor-man-vpn.sh
Created June 4, 2020 18:45
A Poor man’s VPN Over SSH
#!/bin/bash
sshuttle -r root@X.X.X.X -x X.X.X.X 0/0 -vv --ssh-cmd 'ssh -i id_rsa'
@omartrigui
omartrigui / Traefik.md
Last active June 5, 2019 23:49
Multi http sub-domains with Traefik
$ tree
.
├── docker-compose.web1.yml
├── docker-compose.web2.yml
├── docker-compose.yml
└── traefik.toml
@omartrigui
omartrigui / .bashrc
Created April 26, 2019 21:09
Docker aliases
alias dockercleancontainers="docker ps -aq | xargs docker rm"
alias dockercleanimages="docker images -aq -f dangling=true | xargs docker rmi"
alias dockerclean="dockercleancontainers && dockercleanimages"
alias docker-killall="docker ps -q | xargs docker kill"
# runs docker exec in the latest container
function docker-exec-last {
docker exec -ti $( docker ps -a -q -l) /bin/bash
}
@omartrigui
omartrigui / solution.py
Created November 5, 2018 10:03
CP python solution template
import atexit
import io
import sys
_INPUT_LINES = sys.stdin.read().splitlines()
input = iter(_INPUT_LINES).__next__
_OUTPUT_BUFFER = io.StringIO()
sys.stdout = _OUTPUT_BUFFER
@omartrigui
omartrigui / compress.sh
Created July 29, 2018 17:41
Smaller PDF
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=mydocsmaller.pdf mydoc.pdf