1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
# Mitch's scripts, utilities, and configuration
I copy this down to my personal machines.
Things of interest:
* shell configuration ( See more information below )
* tmux configuration ( see more info below )
* tmux helper script ( For load average, uptime and memory in the status bar )
* basic configuration ( For if you don't want the custom status bar )
* [`scripts/key-check.sh`](../tree/scripts/key-check.sh) Quick little script /
one liner to dump a SSH key to the terminal in red. Nice for people who are
new to SSH Keys
* Snapshot scripts. Snapshots your entire OS see below for more details.
* A basic vim configuration ( also see [`vim-cfg`](https://git.riedstra.dev/mitch/vim-cfg/about) )
* A handful of build scripts with my options for some open source projects such as Vim
## Snapshot Scripts
These alter the fstab in the snapshot so you can boot to it just by changing kernel boot parameters
[`scripts/snap-btrfs.sh`](`../tree/scripts/snap-btrfs.sh`)
Automatically snapshot a btrfs root filesystem assuming you're using a
subvolume and the base FS is mounted in `/ROOT`
[`scripts/snap-lvm.sh`](`../tree/scripts/snap-lvm.sh`)
Same as above, except it doesn't keep RO snapshots around, and doesn't remove
old ones. Requires LVM but the underlying FS doesn't matter ( `ext4`, `xfs`,
etc )
## `bin` directory / desktop utilities
* `snipmenu`, a small [dmenu](https://dmenu.suckless.org) script for pasting
snippets from the `snips` directory.
* `status-bar` a *very* messy script for a `dwm` status
* `vol` small script to adjust pulseaudio volume on linux
* `day`/`night` scripts for turning off/on `redshift`
* `wallpaper` small script to continuously adjust the wallpaper, useful
for when your screen resolution changes
* `backlight` directly adjust the backlight on Linux systems
* `ddmenu` dmenu for demenus. Dmenu script that launches other dmenu scripts.
## Shell Configuration
`kshrc`
Specifically targets ksh which has been my default shell for quite a long time
now. Though I do test it against `bash` and `ash` occasionally as well.
Some useful features are:
* Aliases
* `ll`, `lt`, `g` for `grep`, `j` for `jobs`, `p` for `pwd`, etc.
* `ls -F` by default
* Aliases for `apt`, `yum`, `pacman`, etc to use `sudo` by default.
* Utilize `doas` as `sudo` if installed, for instance on OpenBSD.
* Utils
* `set_go` can be called in `~/.kshrc.local` or similar to add the
`GOROOT` and `GOPATH` `bin`'s to your `PATH`.
* Aggressively set the editor based off of a list in order of ascending preference. ( `set_editor` )
* `set_pager` same thing, except for your pager.
* `debugstarttls` Useful to debug starttls.
* `randmacgen` generate a random mac address.
* `ipv6_local_hosts <interface>` Returns the IPs of local nodes by using the IPv6 all nodes multicast ping.
* `set_nocaps` Eliminates capslock, makes it another control key. Makes the
numberpad act like it does on Windows. `alt+space` switches between US
and DE layouts.
* `setperms <directory_octal>:<file_octal> <paths>...` Sets file and
directory modes separately and recursively across the paths
* `set_title <title>` Sets the title of the terminal to the first argument
* `timestamp`: `date +%m.%d.%y_%H.%M.%S`
* `checkSSHAgent` Checks to see if there's a running SSH agent, if not it
starts one and writes a configuration file.
* `passenv` runs `pass` and sources the output into the shell
* `_tmux_servers`, `_tmux_servers_split_commands`, `_tmux_dev`,
`_tmux_session` Utilities for building tmux development environments.
* Colors
* Automatically assume that anything `xterm*` or `screen*` is a 256 color terminal
* Colored `ls` by default.
* Colored man pages
* Update<br />
This provides utilities that allow for easy updating of configuration files.
The most useful ones are as follows
* `updatevimrc` Installs [my full vim configuration](https://git.riedstra.dev/mitch/vim-cfg/about)
* `updatevimrc_basic` Installs the `.vimrc` file which is a basic but useful vim configuration.
* `updatetmuxconf` Pulls in the tmux configuration from this repository.
* `updateshell` Pulls the latest version of `kshrc` from this repository.
* `pullkeys_github <github_username>` Creates the `~/.ssh/authorized_keys`
file with the SSH keys for a given github username
* `updategitconf <name>` Creates `~/.gitconfig` with the file from
`gitconfig/<name>`
|