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
|
# 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 )
* [`keyCheck.sh`](keyCheck.sh) Automatically generate a 4096bit RSA SSH key or display the one you have
* 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
### [`snap/btrfs.sh`](`snap/btrfs.sh`)
Automatically snapshot a btrfs root filesystem assuming you're using a
subvolume and the base FS is mounted in `/ROOT`
[`snap/lvm.sh`](`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 )
## Shell Configuration
`mkshrc`, generated using `build.sh` inside of the `shell/` directory.
Specifically targets mksh which has been my default shell for quite a long time
now. Though I do test it against `bash` and `ash` as well.
Some useful features are:
* Aliases
* `ll`, `lt`, `g` for `grep`, `j` for `jobs`, `p` for `pwd`, etc.
* [Full list here](https://git.riedstra.dev/mitch/dotfiles/tree/shell/aliases#n1)
* `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 `~/.mkshrc.local` or similar to add the
`GOROOT` and `GOPATH` `bin`'s to your `PATH`. [Example and
code.](https://git.riedstra.dev/mitch/dotfiles/tree/shell/utils#n1)
* 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 `mkshrc` from this repository.
* `pullkeys_github <github_username>` Creates the `~/.ssh/authorized_keys` file with the SSH keys for a given github username
* Conf<br /><br />
All of the pieces above don't actually do anything automatically, they just
add shell functions that can be called. This file ties it all together.
<br />
It:
* sets the URLs for the update functions,
* the configuration file location
* sources the pre and post configuration files
* sets the color aliases and environment variables if necessary
* adjusts PATH to include `~/bin`
* It also handles the different supported shells, history, etc
* Sets up a basic PS1 for most shells
|