Skip to content
/ shcripts Public

Shell scripts that make my life easier

Notifications You must be signed in to change notification settings

kdave/shcripts

Repository files navigation

Shell scripts

Random collection of scripts and snippets.

asm

disas: Prettyfier of objdump assembly (AT&T)

btrfs

bsdel: Delete given btrfs subvolumes (as root).
bstime: Create btrfs snapshot with a timestamp in name.
gen-dump-image: Template to generate textual dump of image of filesystem.

build

jj: Shortcut for unlimited make with icecream.
jjc: Shortcut for unlimited make with ccache and icecream.
makev: Run the given make command but open the results in vim (same as saving make output and running vi -q output).

ccache

cc:
cc++:
g++:
gcc:

crypt

device-create-cmd: Set up a block device with dm-crypt (aes-xts-plain64/sha512)

data

histogram: Print histogram from data set (numbers).
lines-between: Print lines between two markers, start included, end excluded.

dosbox

rundos: Run DOS executable in current directory, fullscreen

fstests

fstests-log: Quick scan of dmesg or given log file for fstests and warning/bug messages.

gcc

inst-gcc-links: Create symlinks for a given gcc & related tools version

git

bgrep: Grep in local git branches.
brandom: Show first 4 random local branches
bsel: Visual git branch selector (bgrep, dialog), then print the branch name.
bsel-co: Visual git branch selector (bgrep, dialog), then check out the branch.
bsel-tig: Visual git branch selector (bgrep, dialog), then run it in tig.
gd: Git diff shortcut.
ge: Edit changelog of HEAD.
gid: Git diff shortcut.
gis: Git show shortcut.
git-auto-rebase: Auto rebase topic branch on another one, look up a specific commit with marker
git-br: Print current branch name.
git-fixesline: Print line from given commit for the Fixes: tag.
git-refresh-commit: Apply any uncommitted changes to HEAD.
git-reword: Edit a commit message of a given commit (rebase and --amend).
git-stableline: Format line for stable patch dependencies (see Documentation/process/stable-kernel-rules.rst)
mt: Run the preferred git conflict resolution tool (vimdiff).

kernel

add-rev: Add reviewed-by tag from known people to the right location to the top commit.
add-rev-to: Edit given commit, run 'add-rev name' and edit to fixup things then go back.

log

gluelog.pl: Glue together lines from dmesg that got wrapped due to text width.
lastlog.pl: Chop the messages since last boot from a continuous serial console log, identified by the timestamp change.
lsslab: Print slab info with aligned columns, also can filter by slab name.
revfile.pl: Reverse input, line by line and on each line (rev + tac).
tscat: 'timestamped cat', prepend a timestamp to each line.

misc

drop-caches: Drop caches.
every: Run the given command every time-spec, command error will not stop the loop, will use 'sleepy' if available
pchown: Preserve permissions on chown on a file.
set-kbdrate: In X, set delay and repeat rate for maximum productivity.
setperm: Fix write permission on all files and directories.
setro: Set "mostly read-only" mask on all files and directories.
sleepy: Interactive sleep:
slowcat: Print input lines with a small delay (0.1s).
tdelta: Time delta between two timestamps.
waitpid: Wait until a given pid exits (poll).

net

waitping: Wait until the given host responds to pings.
waitssh: Wait until the given host is up and ready for ssh.
wgetcz: Set preferred language to CZ and run wget.

ollama

ollama-ls: List ollama models, sort by size, grep pattern
ollama-pull-all: Pull all ollama models

osc

osc-request-ack: Accept given SR

packaging

kernpurge: Print kdialog with list of installed kernel packages and allow selection to remove them, current kernel is not in the list
update-python: Convenient way to update python packages that exist on lower version, and install them on current one (3.11)

pkg

zypper-add-testing-repo: Add my testing repo and kernel.
zypper-install-packages: Install a few testing packages.

tig

tigh: Open arg in tig.
tigs: Shortcut for tig status.

tmux

foursquares: Create layout with four 50% squares.
newp: Split panel, 2 lines at the bottom just to see the command but not the output, exit afterwards
owntmux: Capture the named session.

vim

vicg: Open vim with coccigrep search, save temporary output for repeated calls NOTE: upstream coccigrep stopped working for some reason, this is a simpler version that does not find all occurrences.
vicint: Interactive C in vim (edit, compile, run)
vigrep: vim grep all *.[ch] files in current directory and open (:cNext/:cnext).
vigrub: Edit grub1 config as root.
vihead: In a git tree, list files from the last commit (HEAD), offer a selection and open in vim with the diff against HEAD^ (i.e. the last changes to the file).
vihead-all: Like vihead, but go through all files.
vii: Translate "file:line:col" format to "vim +line file", to open files from e.g. make output.
vimsyn: Generate syntax highlighted .xhtml of the given file.

x

xclip-clear: Clear all X clipboards

About

Shell scripts that make my life easier

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published