This is an old revision of the document!
lab46.offbyone.lan is the LAIR public access point / shell system for students and users.
hostname | RAM | disk | swap | OS | Kernel |
---|---|---|---|---|---|
lab46.offbyone.lan | 1536MB | 4GB (/) | 128MB | Debian 8.0 “Jessie” (AMD64) | 3.14-1-amd64 |
lab46.corning-cc.edu | 512MB (/tmp/) |
lab46.offbyone.lan created on sokraits on 07/10/2014.
Machine | Interface | IP Address | MAC Address | Other Names |
---|---|---|---|---|
lab46.offbyone.lan | eth0 | 10.80.2.38 | 00:16:3e:5d:88:d8 | lab46.corning-cc.edu, lab46.lair.lan |
The following packages have been installed on lab46:
lab46 is a Xen virtual machine. Pertinent configuration information follows:
The Xen config file for this VM is as follows:
###################################################################### ## ## LAIR Xen VM configuration file ## ## created by xen-tools 4.2 on Fri Apr 11 05:39:29 2014. ## ###################################################################### ###################################################################### ## ## PyGRUB ## bootloader = '/usr/lib/xen-default/bin/pygrub' ###################################################################### ## ## CPU(s) + memory size ## memory = '192' vcpus = '1' ###################################################################### ## ## Disk device(s). ## root = '/dev/xvda1 ro' disk = [ 'file:/xen/images/lab46new.disk,xvda1,w', 'file:/xen/images/lab46newtmp.disk,xvda2,w', 'file:/xen/images/lab46new.swap,xvda3,w' ] ###################################################################### ## ## Hostname ## name = 'lab46new' ###################################################################### ## ## Networking ## dhcp = 'dhcp' vif = [ 'mac=00:16:3E:07:CD:F1' ] ###################################################################### ## ## Behaviour ## on_poweroff = 'destroy' on_reboot = 'restart' on_crash = 'restart'
#!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # Try to fix NFS callback stupidity modprobe nfs sysctl fs.nfs.nfs_callback_tcpport=2049 /etc/init.d/nfs-common restart # Force motd cat /etc/motd.tail > /var/run/motd # Mount home directories from NFS mkdir -m 1755 -p /home mount -t nfs4 -o proto=tcp,intr nfs:/home /home # Enable IP Forwarding echo "1" >/proc/sys/net/ipv4/ip_forward # Redirect/Masquerade port 80 traffic to WWW iptables -t nat -A PREROUTING -p tcp -m tcp -d 10.80.2.38 --dport 80 -j DNAT --to 10.80.2.18:80 iptables -t nat -A POSTROUTING -p tcp -d 10.80.2.18 --dport 80 -j MASQUERADE
Students these days have very messy coding styles. I've always formatted my code to the ANSI/Allman coding style. So to enhance laziness, I installed GNU indent and figured out how to use it, so it can quickly attempt to convert non-compliant code into something far more readable in a short span of time.
I went and figured out the particular options to produce just what I want, and that turns out to be:
-linux -bl -bli0 -nce -saf -sai -saw -sob -bad -bap -cdw -l86
With the exception of -l86, of course, because not everyone's terminal may be 90 chars wide. So in /etc/indent.conf, the following was placed:
-linux -bl -bli0 -nce -saf -sai -saw -sob -bad -bap -cdw
And in /etc/profile, the following was added:
###################################################################### ## ## Configure GNU indent ## INDENT_PROFILE="/etc/indent.conf"
From the manual page, it would seem that if a user places their own ~/.indent.pro, it may override the system settings.. so if someone was really particular about a certain style, they'd have that flexibility.
In order to prevent abuses (both accidental and intentional), /etc/limits.conf has some resource limitations specified:
# /etc/security/limits.conf # @lab46 soft nproc 48 @lab46 hard nproc 64 @lab46 hard priority 18 @lab46 hard nice 16 @lab46 hard maxlogins 12 @lab46 hard nofile 128 @lab46 hard locks 128 @lab46 hard data 393216 @lab46 hard rss 393216 @lab46 hard as 393216 @lab46 hard memlock 393216 @lab46 hard fsize 65536 @lair hard fsize 524288 appelthp hard fsize 131072 root hard fsize 524288
Regular users will have a maximum size of 64MB for individual files (strictly enforced), which will help in those occasional “runaway” infinite loop programs/scripts.
Plan 9 from User Space has been installed on Lab46.
I installed it in: /usr/local/plan9
Users that wish to make use of it can add the follow to their login files:
export PLAN9=/usr/local/plan9 export PATH=${PATH}:${PLAN9}/bin