Skip to content

Instantly share code, notes, and snippets.

View iul1an's full-sized avatar

Iulian Mandache iul1an

View GitHub Profile
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 29, 2024 08:12
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@L422Y
L422Y / multisync.sh
Last active February 21, 2021 23:57
lftp script to mirror remote ftp site to local folder using multiple connections per file and parallel file downloads (for reference/cron jobs)
#!/bin/bash
do_multisync() {
remote_dir="private/files"
local_dir="/root/i_drive/files"
# remote host
host="ftp.myremotehost.com"
# username / password
user="larry"
@ctechols
ctechols / compinit.zsh
Last active June 29, 2024 16:18
Speed up zsh compinit by only checking cache once a day.
# On slow systems, checking the cached .zcompdump file to see if it must be
# regenerated adds a noticable delay to zsh startup. This little hack restricts
# it to once a day. It should be pasted into your own completion file.
#
# The globbing is a little complicated here:
# - '#q' is an explicit glob qualifier that makes globbing work within zsh's [[ ]] construct.
# - 'N' makes the glob pattern evaluate to nothing when it doesn't match (rather than throw a globbing error)
# - '.' matches "regular files"
# - 'mh+24' matches files (or directories or whatever) that are older than 24 hours.
autoload -Uz compinit
@wavezhang
wavezhang / java_download.sh
Last active June 28, 2024 15:42
download java from oracle without login
wget -c --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/12.0.2+10/e482c34c86bd4bf8b56c0b35558996b9/jdk-12.0.2_linux-x64_bin.tar.gz
@samuelcolvin
samuelcolvin / dns_server.py
Last active May 30, 2024 18:34
requires python 3.5+ and dnslib, see https://github.com/samuelcolvin/dnserver for full/better implementation
from datetime import datetime
from time import sleep
from dnslib import DNSLabel, QTYPE, RD, RR
from dnslib import A, AAAA, CNAME, MX, NS, SOA, TXT
from dnslib.server import DNSServer
EPOCH = datetime(1970, 1, 1)
SERIAL = int((datetime.utcnow() - EPOCH).total_seconds())
@bobrik
bobrik / README.md
Last active May 7, 2024 12:19
CFS hiccups
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active June 29, 2024 04:08
set -e, -u, -o, -x pipefail explanation
@chrisswanda
chrisswanda / WireGuard_Setup.txt
Last active June 29, 2024 07:53
Stupid simple setting up WireGuard - Server and multiple peers
Install WireGuard via whatever package manager you use. For me, I use apt.
$ sudo add-apt-repository ppa:wireguard/wireguard
$ sudo apt-get update
$ sudo apt-get install wireguard
MacOS
$ brew install wireguard-tools
Generate key your key pairs. The key pairs are just that, key pairs. They can be
@huntrar
huntrar / full-disk-encryption-arch-uefi.md
Last active June 28, 2024 20:21
Arch Linux Full-Disk Encryption Installation Guide [Encrypted Boot, UEFI, NVMe, Evil Maid]

Arch Linux Full-Disk Encryption Installation Guide

This guide provides instructions for an Arch Linux installation featuring full-disk encryption via LVM on LUKS and an encrypted boot partition (GRUB) for UEFI systems.

Following the main installation are further instructions to harden against Evil Maid attacks via UEFI Secure Boot custom key enrollment and self-signed kernel and bootloader.

Preface

You will find most of this information pulled from the Arch Wiki and other resources linked thereof.

Note: The system was installed on an NVMe SSD, substitute /dev/nvme0nX with /dev/sdX or your device as needed.

@fjpalacios
fjpalacios / arch-i3gaps-install.md
Last active June 22, 2024 21:11
Arch + i3-gaps Install Guide

Arch + i3-gaps Install Guide

First set up your keyboard layout. For example, in Spanish:

   # loadkeys es

For a list of all acceptable keymaps:

   # localectl list-keymaps