Cheat Sheet

From Hack Manhattan Wiki

A "cheat sheet" of commands and documentation procedures for the Open Source System Administration Group.

File:Cheat Sheet.pdf

git Clone a shared repository via ssh: git clone user@raphael:sysadminrepo

Clone a shared repository via https:

git clone https://github.com/openai/whisper.git

Get other people’s changes to the shared repository to your computer’s copy of the

repository: git pull

Send your commits to the shared repository: git push

Add the file to git's list of files to be tracked: git add file censored-cow.cow

Commit the change: git commit -m "Created a cowfile for an udderless cow."

Command line essentials

Change directory: cd sysadminrepo

Make a new directory mkdir censored-cowsay-donatello

Run a command as root: sudo

Get help for a command line program: cowsay --help

Read the manual page on a command: man cowsay

Run a command with an option and parameter: cowsay -f fox Hello!

Copy one file to new file or overwrite an existing file:

cp default.cow censored-cow.cow

Edit a file on the server with the nano editor: nano censored-cow.cow

ssh

Open a remote secure shel on leonardo: ssh user@leonardo

Close a ssh session: exit

Copy the file from a server to your computer (note the period at the end):

scp user@donatello:/usr/share/cowsay/cows/censored-cow.cow .

Copy the file from your computer to a server:

scp file.dat user@donatello:/destination/path/

apt

Search for cow-related packages: apt search cow

Install the package sudo apt install cowsay

Documentation How-to

Overview

● Submit a Change Request on Discord

● Install the software

● Copy the unchanged inital versions of configuration files and scripts to your local copy of

the git repository, into a new directory for a new piece of software if necessary. git add

and git commit the files with an appropriate message

● Configure, test, etc. Commit files into the repository at milestones.

● Update the wiki

Submitting a change request on the Discord channel

On the HM Discord's sysadmin-group channel submit a message with following:

● Why you’re making the change

● What are the primary packages/software you’re installing, reconfiguring, or

removing.

● Where you’re getting the packages/software from (Debian repository, other

repositories, GitHub, a website).

● What server(s) you’re going to make the change on.

● The location in the file system your going to install to, if not installing using apt

● Where any data will be stored, if any, and volumes you’ll create.

● Note if use of disk space, RAM, CPU, or network bandwidth may be high.

● If the app has a network interface, what protocol (TCP,UDP) and ports it uses,

and what IP address or interface it uses if not the primary one on the server. If

the app is using another to serve its data, (for example a web app using an

already installed web server) noting that is good enough unless you’re

reconfiguring it to use non-standard ports.

● (future: your backup strategy for your data)

Example: "To provide a platform for future web based-apps, I intend to install

package nginx on donatello from the Debian repositories, It will use a trivial

amount of RAM, processing power, and disk space on the OS root drive. I will

create a LVM volume on /dev/sdb and point the web root there. Eventually the web

apps could use a considerable amount of disk space and network bandwidth.

nginx listens on TCP ports 80 and 443.“

Documenting your change on the wiki

Open the HM wiki wiki.hackmanhattan.com, and log onto the wiki using your wiki

username and password.

Edit the wiki page. In the Applications section, Add an internal link to a new

page, like [nginx]. Save the page with an appropriate comment.

Click on the link you just created, creating the new page.

Type in a description of what you did, how you did it, issues you had, and

unresolved problems or future plans.

Enter an appropriate comment and save the page.