Skip to content

Instantly share code, notes, and snippets.

View crh0831's full-sized avatar

Charles Hawley crh0831

  • Cleveland, Ohio
View GitHub Profile
@crh0831
crh0831 / mempigs.md
Created April 25, 2023 01:02
Find top memory users on Linux

top memory users (mempigs)

ps aux  | awk '{print $6/1024 " MB\t\t" $11 " " $12}'  | sort -n | tail -10

Alias it with:

alias mempigs="ps aux | awk '{print \$6/1024 \" MB\t\t\" \$11 \" \" \$12}'  | sort -n | tail -10"
@crh0831
crh0831 / generic-directory-backup.md
Created April 25, 2023 00:57
Generic Directory Backup Shell Script

Generic Directory Backup Script

I regularly have directories of files I want to back up in case of disaster. Usually these are files that change often, and I only want to keep recent versions in case I want to revert or recover changes. (Git? git, who?)

I have used this script over and over as a simple way to archive a directory to a location with a date-stamped filename. It also cleans up after itself by deleting files older than X days. I stick it in CRON and let it run on a schedule and I always have an archive of the last X days of the files in my directory.

#!/usr/bin/env bash
#===============================================================================
#
@crh0831
crh0831 / zandronum-ubuntu.md
Created April 25, 2023 00:53
Zandronum on Ubuntu

Zandronum

Summary

Zandronum brings classic Doom into the 21st century, maintaining the essence of what has made Doom great for so many years and, at the same time, adding new features to modernize it, creating a fresh, fun new experience.

Install

wget -O - http://debian.drdteam.org/drdteam.gpg | sudo apt-key add -
@crh0831
crh0831 / bash-challenges.md
Last active April 7, 2021 20:14
BASH Challenges

BASH Challenges


  1. Check for the presence of a directory and create it if it doesn't exist

    Example Solution

    devdir="/mnt/sqlback1/LSQLSHARE01DEV"
    if [[ ! -d "${devdir}" ]]; then
@crh0831
crh0831 / Problem with home, end and del keys under zsh.md
Created May 2, 2019 13:58
zshrc keybindings for <HOME> <END> cluster

from Problem with home, end and del keys under zsh

bindkey "\e[1~" beginning-of-line
bindkey "\e[4~" end-of-line
bindkey "\e[5~" beginning-of-history
bindkey "\e[6~" end-of-history
bindkey "\e[3~" delete-char
bindkey "\e[2~" quoted-insert
bindkey "\e[5C" forward-word

bindkey "\eOc" emacs-forward-word

@crh0831
crh0831 / config.yaml
Created July 21, 2018 14:34
Beets config
directory: /mnt/chawley/Music
library: /home/chawley/musiclibrary.blb
import:
# write metadata to music files
write: yes
# move imported files from source to the music directory
move: yes
copy: no