Jim's
Tutorials

Fall 2019
course
site

Alex - Oct 10

Just finished moving yesterday and the internet is finally running.

Decided to write an essay on the article you sent due to internet connection being an issue. Uploaded as a word document and a PDF, whichever is easier.

Read chapter 5 and 6 while going through with my own computer following along.

Chapter 5:

There's a lot more than just files in the filesystem especially on UNIX/Linux based systems. Process, audio devices, kernal data structures, interprocess communication channels can all be included.

The filesystem is broken into four sections: A Namespace, API, Security models, Implementation.

Namespace: How you name and organize things in a hierarchy.

API: A set of system calls (a way for programs to interact with the OS. A program makes a 'system call' when it makes a request to the OS's kernal) for navigating and manipulating objects.

Security Models: schemes for protecting hiding and sharing things.

Implementation: Software to tie the logical model to the hardware.

mount maps a directory within the existing file tree, called the mount point, to the root of the newly attached filesystem. An example:

$ sudo mount /dev/sda4 /users

installs the filesystem stored on the disk partition represented by /dev/sda4 under the path /users. You would then see this shown with ls /users.

If you run the mount command without any arguments you can see all of the filesystems currently mounted.

If you want to then unmount a filesystem you use the command unmount. Be sure not to have the filesystem in use when doing so.

unmount -f forces the unmount but can be unreliable.

You can run fuser command to find out which processes are holding up the unmount process. You want the PID.

fuser -c mountpoint prints the PID of every process that's using a file or directory on that filesystem, along with some more info that usually isn't all that important.

then run ps with the list of PIDs returned previously by fuser.

This can be done a bit more cleanly with Linux simply by using fuser -cv /usr . This will give a much more readable display.

ln rm has similar syntax to cp. Example:

cp oldfile newfile creates a copy of oldfile named newfile. ln oldfile newfile makes the name newfile an additional reference to oldfile.

The filesystem maintains about forty separate pieces of information for each file. However, as a sysadmin, you mostly need to know link count, owner, group, mode, size, last access, last modification, and type. All can of these can be viewed with ls -l (or ls-ld for a directory).

Chapter 6:

Common tasks for admins include: automating mass installations of OS, maintaining custom OS configurations, keeping systems and applications patched and up to date, tracking software licenses, managing add on software packages.

Localization = Configuring an off-the-shelf distro to fit your needs.

Network deployments of OS can be useful for 10+ deployments. They receive the OS installation info from the network.

PXE = preeboot execution environment. Intel software. Works very well for this kind of setup.

PXELINUX is the most popular boot system for setting up PXE.

iPXE is another option that supports wireless networks.

Debian and Ubuntu can also have automated installs using debian-installer.

Modify settings in sudo debconf-get-selections --installer > preseed.cfg sudo debconf-get-selections >> preseed.cfg

APT automation can be setup with cron.

Try to setup updates in a test environment.

Have an easy way for users to report bugs.

Found something to try for next time:

https://www.djangoproject.com/start/

https://docs.djangoproject.com/en/2.2/intro/install/

https://docs.djangoproject.com/en/2.2/topics/install/

https://docs.djangoproject.com/en/2.2/topics/install/#database-installation

https://docs.djangoproject.com/en/2.2/intro/tutorial01/

Started working through:

https://www.linode.com/docs/web-servers/nginx/deploy-django-applications-using-uwsgi-and-nginx-on-ubuntu-14-04/

Ran sudo apt-get install build-essential nginx python-dev python-pip

Did not run apt-get for sql-lite as I plan on trying to use postgres for this project.

Ran sudo pip install virtualenv virtualenvwrapper . This installs virtualenv and virtualenvwrapper, tools to create isolated Python environments. They help better manage application dependencies, versions and permissions.

and received an error:

The directory '/home/noms/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permission s and owner of that directory. If executing pip with sudo, you may want sudo's - H flag. The directory '/home/noms/.cache/pip' or its parent directory is not owned by th e current user and caching wheels has been disabled. check the permissions and o wner of that directory. If executing pip with sudo, you may want sudo's -H flag.

Continued on as it seemed to install both. Then configured them using:

echo "export WORKON_HOME=https://cs.marlboro.college/cours/fall2019/jims_tutorials/Env" >> https://cs.marlboro.college/cours/fall2019/jims_tutorials/.bashrc

echo "source /usr/local/bin/virtualenvwrapper.sh" >> https://cs.marlboro.college/cours/fall2019/jims_tutorials/.bashrc

Activated Virtualenvwrapper in the current session using: source https://cs.marlboro.college/cours/fall2019/jims_tutorials/.bashrc

Installed uWSGI using: sudo pip install uwsgi

Created user django with password django to use for this. This user has sudo permissions.

Unrelated: Edited crontab -e to include an automatic update and restart Sundays at 4:30.

aside

Jim says: an article and discussion I saw this week that seemed related to your interests.

Jim says : for comparison, I've uploaded my install_notes.txt for my umber project, which includes how I set up a python virtual environment with its needed packages. This is also on the umber github repo .

https://cs.marlboro.college /cours /fall2019 /jims_tutorials /arome /oct10
last modified Fri April 26 2024 1:34 pm

attachments [paper clip]

  last modified size
TXT Tutorial_Writeup.docx Fri Apr 26 2024 01:34 pm 14K
TXT Tutorial_Writeup.pdf Fri Apr 26 2024 01:34 pm 114K
TXT install_notes.txt Fri Apr 26 2024 01:34 pm 5.8K