From 1e89f9776d3b453aa33c4455bc61f2cd9bbb26f3 Mon Sep 17 00:00:00 2001 From: Malin Freeborn Date: Sun, 5 Jan 2020 13:33:53 +0100 Subject: [PATCH] cleanup --- README.md | 7 ++-- fundamentals/archives.md | 2 ++ fundamentals/bash.md | 2 -- fundamentals/conditionals.md | 1 - fundamentals/cron.md | 2 -- fundamentals/defaults.md | 21 ------------ fundamentals/hardware.md | 24 -------------- fundamentals/locating.md | 32 ++++++++----------- fundamentals/users.md | 18 ----------- fundamentals/wifi.md | 19 ++++++----- hardware/basics.md | 16 ++++++++++ .../character-encoding.md | 0 12 files changed, 48 insertions(+), 96 deletions(-) delete mode 100644 fundamentals/defaults.md delete mode 100644 fundamentals/hardware.md create mode 100644 hardware/basics.md rename {fundamentals => system}/character-encoding.md (100%) diff --git a/README.md b/README.md index 6221942..7db6e71 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,10 @@ This is a list of quickstart guides for Linux programs. 2. The statements should go in order of how likely they are to be used: if `git add` has to be used by everyone, then it should go first. 3. The scripts should get someone up and running in the shortest possible time. 4. No explanations for the program. This isn't an introduction or advert, it's a guide for someone who already wants to use a program but doesn't know how. -5. Easy reference. +5. No presumed knowledge. +6. Easy reference. + +As little knowledge as possible should be presumed, with required knowledge being internally linked. If general knowledge is presumed, it should be placed into a file named 'basics'. # What's wrong with everything else? @@ -17,7 +20,7 @@ This is a list of quickstart guides for Linux programs. - Often written in the 80's, and it shows. - Zero respect for your time. -## tl;dr +## curl cheat.sh/ - Doesn't have the programs I like. - Too short to get you started on many programs. diff --git a/fundamentals/archives.md b/fundamentals/archives.md index bc35b0a..c794541 100644 --- a/fundamentals/archives.md +++ b/fundamentals/archives.md @@ -48,6 +48,8 @@ Back up an unmounted partition with ssh: # img.xz +Install `xz`. + Unzip the image with: > unxz void.img.xz diff --git a/fundamentals/bash.md b/fundamentals/bash.md index 189839f..da87549 100644 --- a/fundamentals/bash.md +++ b/fundamentals/bash.md @@ -25,8 +25,6 @@ As a result, grep cannot read these characters as literal characters unless they ... will search the string 'wtf?' in the file log.txt. Another version is egrep (now used with 'grep -e') which uses more characters as special characters, or fgrep, which treats all characters as literal strings. - - # Environmental Variables PWD, USER, PATH diff --git a/fundamentals/conditionals.md b/fundamentals/conditionals.md index 65d3da6..73600ce 100644 --- a/fundamentals/conditionals.md +++ b/fundamentals/conditionals.md @@ -57,7 +57,6 @@ This prints from 10 until 2. ``` - There's also 'until', which stops when something is true, rather than keeping going when something is true. # For diff --git a/fundamentals/cron.md b/fundamentals/cron.md index 6fd964b..fcd7ba3 100644 --- a/fundamentals/cron.md +++ b/fundamentals/cron.md @@ -8,7 +8,6 @@ For example: This would run crontab every 7 days, and wait 15 minutes until after boot to run. - Various services from cron exist, e.g. > sudo apt -y install cronie @@ -35,7 +34,6 @@ For example, you can update the database, meaning searches with 'locate' command > */30 * * * * /usr/bin/updatedb - # Testing with runparts Run-parts runs all executable scripts in a directory. diff --git a/fundamentals/defaults.md b/fundamentals/defaults.md deleted file mode 100644 index b4cf299..0000000 --- a/fundamentals/defaults.md +++ /dev/null @@ -1,21 +0,0 @@ - -Change defaults with the `update-alternatives` command. - -> sudo update-alternatives --config x-www-browser - -Other defaults include: - -* x-cursor-theme - -* x-session-manager - -* x-terminal-emulator - -* x-window-manager - -* x-www-browser - -# Config Location - -The appropriate files are located in /etc/alternatives/x-* - diff --git a/fundamentals/hardware.md b/fundamentals/hardware.md deleted file mode 100644 index 8154444..0000000 --- a/fundamentals/hardware.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Motherboard information - -> sudo dmidecode - -Motherboard info, upgrading BIOS, memory capacity, LAN connections. - -# Disk Format information - -> df - -> df -h - -# CPU - -> cat /proc/cpuinfo - -# Displays - -xrandr, probably. - -List displays ... - -> xrandr --query diff --git a/fundamentals/locating.md b/fundamentals/locating.md index 01d210c..5301422 100644 --- a/fundamentals/locating.md +++ b/fundamentals/locating.md @@ -1,3 +1,17 @@ +# Whereis the Program + +Ask where the `angband` program is, along with all its configuration files: + +`whereis angband` + +Also `which` shows where a binary file (the program) is, + +> which cmus + +`type` shows what kind of thing you're running, be it an alias, or binary program. + +> type cmus + # Quick Search for Files You'll need to set up `locate` for this by installing `mlocate`. `mlocate` needs a list of all files on the machine, so run: @@ -8,21 +22,3 @@ Then to find a file called 'my-cats.jpg', run: > locate cats -# Whereis - -`whereis angband` - -... shows where the angband program is, along with configuration files, and binaries. - -Also `which` shows where a binary file (the program) is, - -> which cmus - -That's a lot of files for `cmus`, but you can find out exactly *which* is the program with: - -> which cmus - -`type` shows aliases: - -> type cmus - diff --git a/fundamentals/users.md b/fundamentals/users.md index c067efa..d254515 100644 --- a/fundamentals/users.md +++ b/fundamentals/users.md @@ -18,15 +18,12 @@ will require sudo. add user 'maestro' - This depends upon the settings in the /etc/default/useradd file and /etc/login.defs - > sudo useradd -m pinkie add user 'pinkie' with a home directory - > sudo adduser -m -e 2017-04-25 temp add expiry date to user @@ -67,49 +64,36 @@ add user maestro to group sudo list users' passwords (and therefore users) - - > groupadd awesome create the group 'awesome' - - passwords are stored in /etc/shadow. - there are user accounts for processes such as 'bin' and 'nobody' which are locked, so they're unusable. - - > passwd -l bin lock the user 'bin' - - > more /etc/passwd | grep games we find the name, password and user id of the user 'games'. I.e. the password is 'x', and the user id is '5'. The password is an impossible hash, so no input password could match. - > groupdel learners | delete the group 'learners' > gpasswd -d pi games | remove user 'pi' from the group 'games' - > id games find the id number of group 'games' (60) - > usermod -aG sudo maestro add user to group 'maestro' user info is stored in /etc's passwd, shadow, group and gshadow - # Defaults The default new user profiles are under /etc/skel. @@ -146,7 +130,6 @@ usermod -L henry -u let's you manually specifiy a UID. - # Groups In /etc/group, a group file may look like this: @@ -219,4 +202,3 @@ Then have a look at resource usage per user. This will modify process.sh to that instead of being simply executable, anyone executing it will have the permissions as if owner while executing it. - diff --git a/fundamentals/wifi.md b/fundamentals/wifi.md index 26a96e9..f28e7bb 100644 --- a/fundamentals/wifi.md +++ b/fundamentals/wifi.md @@ -1,23 +1,25 @@ # Netstat Stuff -iftop -p -n Stats on local net usage within domain. +> iftop -p -n -whois domain.com +> whois domain.com -dig domain.com -info on domain, whether it's taken, et c. +Info on domain, whether it's taken, et c.: + +> dig domain.com > ifconfig - Like ipconfig. + +Versatile wifi tool: > nmcli - Versatile wifi tool. # Examples - You want to connect to the internet. ->sudo iwconfig +You want to connect to the internet. + +> sudo iwconfig Get knowledge of wireless state. The output might be: @@ -56,5 +58,6 @@ This tells you that your ESSID is 'Gandalf WajFaj', and the access point name is Alternatively, you can use > nmcli -ask device wifi connect [SSID] + And it'll ask for your password, so you're not typing it in in full view. diff --git a/hardware/basics.md b/hardware/basics.md new file mode 100644 index 0000000..32ed47c --- /dev/null +++ b/hardware/basics.md @@ -0,0 +1,16 @@ +# Motherboard Information + +> sudo dmidecode + +Motherboard info, upgrading BIOS, memory capacity, LAN connections. + +# Disks + +View currently inserted disks: + +lsblk + +# CPU + +> cat /proc/cpuinfo + diff --git a/fundamentals/character-encoding.md b/system/character-encoding.md similarity index 100% rename from fundamentals/character-encoding.md rename to system/character-encoding.md