Skip to content

Instantly share code, notes, and snippets.

View memoryleak's full-sized avatar

Haydar Ciftci memoryleak

View GitHub Profile
@memoryleak
memoryleak / create-monterey-iso.sh
Last active November 12, 2024 11:41
Create a Mac OS Monterey ISO file from the official installation DMG file
#!/usr/bin/env bash
sudo hdiutil create -o /tmp/Monterey -size 16g -volname Monterey -layout SPUD -fs HFS+J
sudo hdiutil attach /tmp/Monterey.dmg -noverify -mountpoint /Volumes/Monterey
sudo /Applications/Install\ macOS\ Monterey.app/Contents/Resources/createinstallmedia --volume /Volumes/Monterey --nointeraction
hdiutil eject -force /Volumes/Install\ macOS\ Monterey
hdiutil convert /tmp/Monterey.dmg -format UDTO -o ~/Downloads/Monterey
mv -v ~/Downloads/Monterey.cdr ~/Downloads/Monterey.iso
sudo rm -fv /tmp/Monterey.dmg
@memoryleak
memoryleak / fio.sh
Created October 29, 2021 11:12
Disk benchmark
fio \
--name=random-write-4k \
--ioengine=posixaio \
--rw=randwrite \
--bs=4k \
--size=4g \
--numjobs=1 \
--iodepth=1 \
--runtime=60 \
--time_based \
import concurrent.futures
import threading
from concurrent.futures import ALL_COMPLETED
from queue import Queue
from time import sleep
from timeit import default_timer as timer
import networkx as nx
from networking import Crawler, NetworkDisabledException
<head>
<script type="text/javascript">
document.onreadystatechange = function(){
if(document.readyState=='loaded' || document.readyState=='complete')
alert('XSS');
}
</script>
</head>
@memoryleak
memoryleak / install-all.sh
Last active August 13, 2021 09:57
Ubuntu 18.04 with PHP 7.3, 7.4 and Docker
#!/usr/bin/env bash
./install-docker.sh
./install-php.sh
./install-nginx.sh
./install-cleanup.sh
#!/usr/bin/env bash
sudo chown -R $USER:$USER $HOME/.ssh
# Base line permission
sudo chmod -R 0600 $HOME/.ssh
# Not sensible
sudo chmod -R 0600 $HOME/.ssh/config
sudo chmod -R 0600 $HOME/.ssh/authorized_keys
@memoryleak
memoryleak / .gitignore
Last active May 3, 2021 14:46
Compile PHP on Fedora (7.3, 7.4, 8.0)
src
SELECT * FROM booking
left join booking_room on booking.id = booking_room.booking_id
left join room on booking_room.room_id=room.id
where checkout < "2021-04-24";
select * from room
left join booking_room on room.id = booking_room.room_id
LEFT join booking on booking_room.booking_id = booking.id
where (booking.checkout < "2021-04-24" or booking.checkout is null) or booking.checkin > "2021-04-24" order by booking.id asc;
@memoryleak
memoryleak / moodle.js
Created January 15, 2021 14:40
Moodle Print
$('body').html($('ul.ctopics.topics.bsnewgrid.row').first().html()).removeClass();
#!/usr/bin/env python3
# Simple Python script to lookup EC2 instance ip addresses based on the name tag.
import os
import argparse
import boto3
from appdirs import user_cache_dir
from tabulate import tabulate