From 9332ec97aeb9d482b5af4e0ebda6a3bbace627e6 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Wed, 9 Jan 2019 04:17:35 -0700 Subject: [PATCH] updated readme --- README.md | 115 ++++++++++++++++++++++++------------------------------ 1 file changed, 51 insertions(+), 64 deletions(-) diff --git a/README.md b/README.md index 84e6766..fc9deef 100644 --- a/README.md +++ b/README.md @@ -6,85 +6,72 @@ something else like a webserver, git-server, cloud platform, programming workstation, etc. Therefore, only a few core files applicable to nearly every conceivable installation are included here. +This archive and included script are meant to supplement my article on setting +up a Debian base-system found at https://mytechiethoughts.com/ + ## Included files -### bash template files +Please refer to the readme.md in each subdirectory for a list and description of +each included file. -#### bash.rc +## The script file (customize.sh) -Included are *.bashrc* files for both new users (in the */etc/skel/* directory) -and the root user. These files are the Debian default files. They are included -and copied so that user profiles start out at baseline settings and pull all -initial customizations from */etc/bash.bashrc*. Users are free to alter their -*.bashrc* as they see fit and those settings will override or add to the ones -I've included in */etc/bash.bashrc* +The included script file copies all the files in this archive to the proper +locations on a default Debian system. It makes backups of your existing files +in-place with the extension *.original*. This simply saves you time and +possible errors copying the files manually. The structure of this archive +exactly mirrors a default Debian installation, so you can use that as a guide if +you choose not to use the script. -#### profile +### Running the script -This is the Debian default *profile* and is copied to */etc/profile* to return -the system to a baseline configuration. Again, this is done to ensure that only -*/etc/bash.bashrc* is providing initial customizations to users. +Please note you must either make the script executable or call it explicitly via +BASH. In the latter case, you'd run the script as follows: -#### bash.bashrc +```bash +/bin/bash ./customize.sh +``` -Of the bash customization files, this is the only one that is NOT in a default -configuration. I have added the following customizations I find useful -especially for new users and system admins: +If you want to make the script executable: -- colourized directory listings with built-in automatic colour settings -- changed prompt to include 24-hour clock, username, hostname and current - directory display - - username changes to RED when working as ROOT (uid=0) -- added the following command aliases - - alias|full command|explanation - ---|---|--- - ll|ls -l|default 'ls' output - l|ls -lAsh --group-directories-first|far more useful and robust file display including sizes, permissions and owners - rm|rm -i|confirmation prompt when deleting file - mv|mv -i|confirmation prompt when moving file would result in overwriting existing file - cp|cp -i|confirmation prompt when copying file would result in overwriting existing file +```bash +chmod +x customize.sh +./customize.sh +``` -### nano defaults (nanorc) +Due to location of the files being replaced, **you MUST run this script as ROOT** +(the script will exit if you run as a different user) or run it via sudo like +this (assuming you made it executable): -The following options have been enabled/set in nano to provide what I feel is an -easier editing experience especially for people coming from a Windows background -and new users/admins. +```bash +sudo ./customize.sh +``` -- 'rebind' numeric keypad to fix problems with using keypad with some SSH clients -- set 'smart home' some home key is useful -- allow opening multiple files at once -- always display line numbers -- constantly display cursor position at the bottom of the screen -- set vim lock-files -- autoindent ON, tab-size of 4 spaces -- convert tabs to spaces -- turn off hard line wrapping -- turn ON soft line wrapping for ease of readability -- closing 'brackets' (for alignment purposes) set as: "')>]} -- cut to end of line by default -- set proper bracket matching (ie. "<" matches ">", etc.) -- turned on default colours so nano doesn't look so drab -- added the following key-bindings +### Passing a custom path to the script -binding|fuction ----|--- -alt-c/alt-C|copy selected text -alt-x/alt-X|cut selected text -alt-v/alt-V|paste text on clipboard +If you want to test out the script before having it update your actual system +configuration, you can supply an alternate destination path. This is referred +to as a 'Base Path' by the script and it will show a warning if this option is +used. Please note, your 'Base Path' MUST have the same directory structure as +an actual system, so the expected directories must already exist or the script +will just throw errors and not actually copy files. -### time syncronization settings (timesyncd.conf) +Let's assume you wanted to test the script and copy files to */testdir*. You +would do the following prepare the directory with the expected structure: -This file configures *systemd-timesyncd.service* and allows for very simple -NTP-sync setup. Simply edit the **NTP=* to list your desired timeservers, -each separated by a single space. In the event those timeservers are not -available, you can configure back servers by listing them on the -**FallbackNTP=** line, again space delimited. +```bash +mkdir -p /testdir/root +mkdir -p /testdir/etc/{skel,ssh,systemd} +``` -I've set the default in this file to be the worldwide NTP.org servers. This -should work for pretty much anyone that uses this file, but you really should -customize the list to use geographically closer timeservers or the timeserver on -your LAN, etc. +Then you could invoke the script as follows: -### SSH server configuration (sshd_config) +```bash +customize.sh /testdir +``` +The script would then copy all files into */testdir* while mirroring the +structure of a live system beneath that. Again, this is useful only for testing +and will NOT update your actual system! + +## Final thoughts \ No newline at end of file