Skip to content

Instantly share code, notes, and snippets.

View mjnaderi's full-sized avatar
📖
Always Learning...

Mohammad Javad Naderi mjnaderi

📖
Always Learning...
View GitHub Profile
@mjnaderi
mjnaderi / install-arch.md
Last active April 18, 2024 19:00 — forked from mattiaslundberg/arch-linux-install
Installing Arch Linux with Full Disk Encryption (LVM on LUKS)

Installing Arch Linux with Full Disk Encryption

If you're aiming for a seamless Arch Linux installation in UEFI mode, follow along as this guide will walk you through the process step by step. We'll be using LUKS (Linux Unified Key Setup) and LVM (Logical Volume Manager) partitions on LUKS to achieve full disk encryption.

Note: I have updated this doc for UEFI mode. For those with BIOS/MBR systems, you can refer to the previous version, but keep in mind that it might be outdated and no longer accurate.

If you're only interested in installing Linux and not setting up dual boot with Windows, feel free to skip the Windows-related sections.

@mjnaderi
mjnaderi / disk-partitions.drawio
Last active March 28, 2024 13:19
install-arch images
<mxfile host="app.diagrams.net" modified="2023-07-04T12:36:48.192Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.51" etag="U4EHGn_sUU4WP-Eq_T0W" version="21.5.2" type="device">
<diagram name="Page-1" id="_bH2DKaN5ft4xbLNmIXA">
<mxGraphModel dx="989" dy="580" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="KdqZW1nxa3IcIuYSCLVA-135" parent="0" />
<mxCell id="KdqZW1nxa3IcIuYSCLVA-362" value="" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#E8E8E8;strokeColor=#828282;container=1;imageAspect=1;recursiveResize=0;fontFamily=sans-serif;" parent="KdqZW1nxa3IcIuYSCLVA-135" vertex="1">
<mxGeometry x="700" y="800" width="140" height="130" as="geometry" />
</mxCell>
<mxCell id="KdqZW1nxa3IcIuYSCLVA-357" value="Logical Volume" style="rou
@mjnaderi
mjnaderi / android_storage_ssh.md
Last active March 15, 2024 07:28
Access Android Storage Remotely using Termux and SSH
@mjnaderi
mjnaderi / django-syslog.md
Created May 29, 2018 07:09
Logging to Syslog in Django
@mjnaderi
mjnaderi / upvpn.sh
Last active March 25, 2023 14:21
UpVPN (reconnect vpn when disconnected)
#!/bin/bash
# Usage:
# ./upvpn.sh "VPN Connection Name"
VPN="$1"
trap "exit 0" SIGINT SIGTERM
while true; do
@mjnaderi
mjnaderi / mnemonic-words.md
Last active March 23, 2023 17:29 — forked from fogleman/words.md
Mnemonic Encoding Word List
from django.contrib.auth.models import Permission
from django.db.models.deletion import ProtectedError
from django.contrib.contenttypes.models import ContentType
from django.db.models.deletion import Collector
def get_dependencies(obj):
collector = Collector(using="default")
collector.collect([obj])
return collector.data
@mjnaderi
mjnaderi / README.md
Created January 10, 2022 08:36
Compressed model field for Django

Please note that storing compressed binary values inside database has its own disadvantage. According to my experience using PostgreSQL, it increased the size of custom-format dump (pg_dump -Fc) by 60%.

@mjnaderi
mjnaderi / gitlab_migrate.py
Last active August 9, 2022 17:50
Migrate from gitlab.com to self-hosted gitlab
"""
We used this script to migrate from gitlab.com to our self-hosted gitlab.
Author: Mohammad Javad Naderi
Before running the script, install `python-gitlab` package.
Important Note:
In order to keep the authors of merge requests and comments, before running this script make
sure all users have enabled "Public Email" in their gitlab.com profile and create account for
all users in self-hosted Gitlab (with the same e-mail address as their gitlab.com public email).