Skip to content

Instantly share code, notes, and snippets.

View memoryleak's full-sized avatar

Haydar Ciftci memoryleak

View GitHub Profile
import re
_HASH_RE = re.compile(r'[^a-zA-Z0-9./=]')
fields = "$6$7XhBc13.5MtmI1MQ$l4hdVQnszutOZxKYU/Ih5i9w9eFAIwMK4Nu9nDLrSTaD.p6eHhMgD.2C2s/PZhqTdqv8mk1/MDhHyWSW/HFly0".split("$")
maybe_invalid = False
if len(fields) >= 3:
# contains character outside the crypto constraint
if bool(_HASH_RE.search(fields[-1])):
maybe_invalid = True
# md5
youtube-dl \
--yes-playlist \
--skip-unavailable-fragments \
--restrict-filenames \
-f best \
-o "%(uploader)s - %(playlist)s - %(upload_date)s - %(title)s" \
--match-filter "!is_live"
--match-filter "duration < 1800"
dns:/data /mnt/nfs nfs vers=4,sync,noatime,nodiratime,users,rw 0 0
#!/usr/bin/env bash
FILTER="$1-*"
aws ec2 --output table describe-instances \
--filters "Name=tag:Name,Values=$FILTER" \
--query 'Reservations[].Instances[].{Name:Tags[?Key==`Name`]|[0].Value,Address:PrivateIpAddress}'
@memoryleak
memoryleak / docker-clean.sh
Last active September 26, 2022 10:35
docker-full-reset
docker stop $(docker ps -a -q); docker rm $(docker ps -aq); docker network prune -f; docker volume prune -f
interface=enp4s0
listen-address=192.168.200.1
dhcp-range=192.168.200.50,192.168.200.150,12h
dhcp-host=0c:9d:92:85:e4:ab,192.168.200.1
dhcp-boot=pxelinux,192.168.200.1
dhcp-host=b8:27:eb:13:c1:e4,192.168.200.50
enable-tftp
tftp-root=/home/memoryleak/Documents/Projects/FFHS/GTI.RaspberryPI3+/dist
log-queries
log-dhcp
ldr r2,[r0,#4] ;# Get current register contents
ldr r1,#7 ;# bit mask
lsl r1,#21 ;# shift it to the right gpio bits
bic r2,r2 ;# clear the bits
mov r1,#1 ;# write mode
lsl r1,#21 ;# shift it to the right bits
orr r1,r2 ;# combine with the state of the other gpios
str r1,[r0,#28] ;# Update the register contents
#!/usr/bin/env bash
php -d opcache.enable=0 -d display_errors=1 -d set_time_limit=0 -d memory_limit=-1 bin/magento setup:upgrade
php -d opcache.enable=0 -d display_errors=1 -d set_time_limit=0 -d memory_limit=-1 bin/magento setup:di:compile
php -d opcache.enable=0 -d display_errors=1 -d set_time_limit=0 -d memory_limit=-1 bin/magento cache:flush
#!/usr/bin/env bash
set -x
HOTFIX_BRANCH=$1
cd /var/www/magento2/
sudo chown -R php-fpm:php-fpm /var/www/magento2/generated /var/www/magento2/pub/static/
sudo chmod -R 755 /var/www/magento2/generated /var/www/magento2/pub/static/
sudo -uphp-fpm php -d opcache.enable=0 -d display_errors=1 -d set_time_limit=0 -d memory_limit=-1 bin/magento cache:flush
#!/bin/bash
REGEXP=$1
LOOKUP_BRANCH=$2
if [[ -z "$REGEXP" ]]; then
echo "Usage: `basename "$0"` <ticket-regexp> [<branch>]"
echo ""
echo "Omit [<branch>] if you want to see all branches this ticket is deployed to."
exit 1
fi