Skip to content

Instantly share code, notes, and snippets.

View avdotion's full-sized avatar
🚩
Available in t.me/avdotion

Danila Avdoshin avdotion

🚩
Available in t.me/avdotion
  • Moscow, Russia
View GitHub Profile
@joseluisq
joseluisq / stash_dropped.md
Last active May 12, 2024 16:23
How to recover a dropped stash in Git?

How to recover a dropped stash in Git?

1. Find the stash commits

git log --graph --oneline --decorate ( git fsck --no-reflog | awk '/dangling commit/ {print $3}' )

This will show you all the commits at the tips of your commit graph which are no longer referenced from any branch or tag – every lost commit, including every stash commit you’ve ever created, will be somewhere in that graph.

@FlyingJester
FlyingJester / randomize_background.py
Last active January 15, 2022 05:13
A script that uses `feh` to randomly set the desktop background, changing it every 5 minutes, and not repeating any image twice.
# Calls Feh, puts a randomized image on the background, and changes
# the image every 5 minutes.
import os
import glob
import subprocess
import time
import random
images = glob.glob('images/*')
@mattiaslundberg
mattiaslundberg / arch-linux-install
Last active March 29, 2024 08:38
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap
@pablete
pablete / .bash_profile
Last active March 28, 2022 14:03 — forked from porras/.bash_profile
Change iTerm2 profile (ie: background color) when SSHing into another machine
# Changing iTerm2 color in MacOSX when SSHing (so you know at a glance that you're no longer in Kansas)
# Adapted from https://gist.github.com/porras/5856906
# 1. Create a theme in your terminal setting with the name "SSH" and the desired colors, background, etc.
# 2. Add this to your .bash_profile (or .bashrc, I always forget the difference ;))
# 3. Optional but useful: in the terminal, go to Settings > Startup and set "New tabs open with" to
# "default settings" (otherwise, if you open a new tab from the changed one, you get a local tab with
# the SSH colors)
function tabc() {
NAME=$1; if [ -z "$NAME" ]; then NAME="Default"; fi # if you have trouble with this, change