Skip to content

Instantly share code, notes, and snippets.

View eramax's full-sized avatar
🎯
Focusing

Ahmed Morsi eramax

🎯
Focusing
View GitHub Profile
@denji
denji / aml-upgrade-package-extract.c
Last active January 19, 2025 19:30
Utility to extract AMLogic "USB Burning Tool" .IMG firmware for Linux
// gcc aml-upgrade-package-extract.c -o aml-upgrade-package-extract
// ./aml-upgrade-package-extract update-usb-burning-mode.img
// /dev/sdX - fat32 sdcard
// Make bootable Android update:
// dd if=aml_sdc_burn.UBOOT bs=1 count=442 of=/dev/sdX
// dd if=aml_sdc_burn.UBOOT seek=1 skip=1 bs=512 of=/dev/sdX
// sync
@nichtich
nichtich / jupyter-hosting.md
Last active September 7, 2022 19:10
Jupyter notebook hosting
@nzec
nzec / README.MD
Last active May 21, 2025 04:43
DeezLoader Offical Page

Thanks to /u/zpoo32 for reporting several issues in this list!

Deemix

  • deemix: just the cli and the library
  • deemix-pyweb: the app with a GUI
  • deemix-server: just the server part of deemix-pyweb
@Daniel-Abrecht
Daniel-Abrecht / my_hello_world_distro.sh
Created January 28, 2018 21:56
Shellscript to build the most minimalistic linux live CD which just starts /sbin/init from the CD root directory and outputs "Hello World!"
#!/bin/bash
# Vorhandensein der Programme prüfen
MKISOFS=( $(which genisoimage mkisofs) )
if ! [ -x "$MKISOFS" ]; then echo "genisoimage aka mkisofs is missing"; exit 1; fi
if ! [ -x "$(which gcc)" ]; then echo "gcc is missing"; exit 1; fi
if ! [ -x "$(which nasm)" ]; then echo "nasm is missing"; exit 1; fi
if ! [ -x "$(which cpio)" ]; then echo "cpio is missing"; exit 1; fi
if ! [ -x "$(which tar)" ]; then echo "tar is missing"; exit 1; fi
@chrisdone
chrisdone / gist:02e165a0004be33734ac2334f215380e
Last active June 30, 2025 19:41
Build and run minimal Linux / Busybox systems in Qemu

Common

export OPT=/opt
export BUILDS=/some/where/mini_linux
mkdir -p $BUILDS

Linux kernel

@mrw34
mrw34 / postgres.sh
Last active June 9, 2025 05:14
Enabling SSL for PostgreSQL in Docker
#!/bin/bash
set -euo pipefail
openssl req -new -text -passout pass:abcd -subj /CN=localhost -out server.req -keyout privkey.pem
openssl rsa -in privkey.pem -passin pass:abcd -out server.key
openssl req -x509 -in server.req -text -key server.key -out server.crt
chmod 600 server.key
test $(uname -s) = Linux && chown 70 server.key
docker run -d --name postgres -e POSTGRES_HOST_AUTH_METHOD=trust -v "$(pwd)/server.crt:/var/lib/postgresql/server.crt:ro" -v "$(pwd)/server.key:/var/lib/postgresql/server.key:ro" postgres:12-alpine -c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key
@devcfgc
devcfgc / ThreadSafeList.cs
Created August 4, 2017 04:41
Thread Safe List in C#
##https://stackoverflow.com/questions/5874317/thread-safe-listt-property
public class ThreadSafeList<T> : IList<T>
{
protected List<T> _interalList = new List<T>();
// Other Elements of IList implementation
public IEnumerator<T> GetEnumerator()
{
return Clone().GetEnumerator();
@e23z
e23z / hardening.sh
Created July 25, 2017 15:08
[Ubuntu 16.04 Server Hardener] A script to make it easy to harden an Ubuntu 16.04 server. Its purpose is to setup simple security measures out-of-the-box, not to apply advanced security measures. #scripts #security #configuration #utils
#!/bin/bash
cd ~
read -s -p 'Sudo password: ' PASSWORD
echo ""
echo "Configuring server..."
read -p "What's the hostname of this machine? " NEW_HOSTNAME
echo $PASSWORD | sudo -Sk hostnamectl set-hostname $NEW_HOSTNAME
sudo sed -i -e "s/^127.0.0.1.*$/127.0.0.1 localhost $NEW_HOSTNAME/g" /etc/hosts
sudo dpkg-reconfigure tzdata
sudo service cron restart
@jesperorb
jesperorb / cors.md
Last active February 21, 2024 14:17
Handle CORS Client-side

Handle CORS Client-side

Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources (e.g. fonts) on a web page to be requested from another domain outside the domain from which the first resource was served. This is set on the server-side and there is nothing you can do from the client-side to change that setting, that is up to the server/API. There are some ways to get around it tho.

Sources : MDN - HTTP Access Control | Wiki - CORS

CORS is set server-side by supplying each request with additional headers which allow requests to be requested outside of the own domain, for example to your localhost. This is primarily set by the header:

Access-Control-Allow-Origin
@leonardo-m
leonardo-m / gist:6e9315a57fe9caa893472c2935e9d589
Last active October 13, 2024 14:40
A selection of 101 LINQ Samples converted to Rust
// Port of the C# 101 LINQ Samples rewritten into Apple's Swift 3.
#![feature(ordering_chaining, step_by)]
fn main() {
// linq5: Where - Indexed
/*
//c#
public void Linq5()
{