Skip to content

Instantly share code, notes, and snippets.

@valyakuttan
valyakuttan / git: gitignore.md
Created July 16, 2025 17:04 — forked from jstnlvns/git: gitignore.md
a gitignore cheatsheet

Git sees every file in your working copy as one of three things:

  1. tracked - a file which has been previously staged or committed;
  2. untracked - a file which has not been staged or committed; or
  3. ignored - a file which Git has been explicitly told to ignore.

Ignored files are usually build artifacts and machine generated files that can be derived from your repository source or should otherwise not be committed. Some common examples are:

  • dependency caches, such as the contents of /node_modules or /packages
  • compiled code, such as .o, .pyc, and .class files

See what's the block device

[yabbes@x220 ~]$ lsblk
NAME           MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda              8:0    0 298,1G  0 disk
├─sda1           8:1    0   500M  0 part  /boot
└─sda2           8:2    0 297,6G  0 part
  └─lvm        254:0    0 297,6G  0 crypt
    ├─vg0-swap 254:1    0     4G  0 lvm   [SWAP]
    ├─vg0-root 254:2    0    46G  0 lvm   /
@valyakuttan
valyakuttan / goldbach47.c
Created July 25, 2023 12:15 — forked from jms137/goldbach47.c
Goldbach Turing machine with 47 states
/*
Goldbach's conjecture tested by a 47-state Turing machine
Author: Jared Showalter
If "a" and "i" were unbounded, this program would halt iff Goldbach's
conjecture is false. Furthermore, the program structurally
corresponds to a Turing machine with two symbols, one tape, and a
small number of states. The array "a" corresponds to the tape (each

Run a local HTTP server with Docker 🐳

Serve your static website from localhost using Docker and Nginx.

By @arrested-developer

Why Docker?

Do you know the famous phrase "it works on my machine"?

@valyakuttan
valyakuttan / git-commit-title-first-word.md
Created May 8, 2023 12:02 — forked from scmx/git-commit-title-first-word.md
Example list of verbs / first word to use in git commit title #git #commit #title

Example list of first words to use in a git commit title

I like writing well-formed git commits that explain the intention behind why a code change was made.

Check out Chris Beams excellent How to Write a Git Commit Message if you haven't read it.

Anyway, for a project I've been working on I've gathered up 900+ commits that hold up a pretty high quality (except for one 😁). Let's look at some trends about these commits!

Most common first words in commit titles of a project

@valyakuttan
valyakuttan / GnuPG_Cheat_Sheet.md
Last active August 19, 2023 08:32 — forked from colematt/Backup-and-Restore-GPG-and-SSH-keys.md
[Backup and Restore GPG and SSH keys] #git #gpg #ssh

GnuPG Cheat sheet

Import and Backup secret keys

  1. Import secret keys from a backup

    $ gpg --decrypt backup_file.pgp | gpg --import
    
@valyakuttan
valyakuttan / gpg-ssh-setup.md
Created October 11, 2021 17:28 — forked from mcattarinussi/gpg-ssh-setup.md
A setup guide to use a personal gpg key for ssh authentication

GPG - SSH setup

Generating the master key

Here we create the master key. We want only Certify capability: we use the master key only to create the subkeys, Sign - Encrypt - Authenticate capabilities will be assigned to the subkeys.

Run the following command to start the master key generation process. Select the set your own capabilities creation process (type 8)

  ▶ gpg --full-generate-key --expert

gpg (GnuPG) 2.2.9; Copyright (C) 2018 Free Software Foundation, Inc.

@valyakuttan
valyakuttan / full-disk-encryption-arch-uefi.md
Last active September 9, 2021 04:01 — forked from huntrar/full-disk-encryption-arch-uefi.md
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.

@valyakuttan
valyakuttan / gitcheatsheet.md
Last active November 10, 2023 17:36 — forked from RalucaNicola/github-commands.md
Common ly used git commands

Reverting a File to a Previous Commit

  • see all commits made to App.js.
    $ git log -- oneline src/App.js
  • Use the SHA value to to revert to the desired version
    $ git checkout 55a1dff -- src/App.js