Updated: 2013-05-08 21:01 EDT
sort
:Your hard disk is very sensitive to shock. Don’t store it unpadded in the bottom of your backpack where it will hit the floor every time you drop your backpack. Keep it in a thick bubble wrap envelope or wrap it in your clothes. Store it in your locker when you aren’t using it and don’t carry it around all the time.
Your hard disk is sensitive to temperature changes. Keep it at room temperature. Don’t bring it into a warm room and power it on right after it has been stored outside in your freezing car overnight or in a cold backpack in winter. If you have a very cold hard drive, give it a few hours to warm up before turning it on.
Put your legible name on your caddy and power supply (and everything) so we can contact you if you leave it behind in a lab some day.
Treat every virtual machine as you would a real physical computer. You must power on and power off your real and virtual systems in the correct order to avoid file system damage and locked VMware images:
Reverse these steps, bottom-to-top, to power on your systems.
If you resume a virtual machine in a different room than where you Suspended it, the resumed networking will likely be wrong - it will be the networking used in the room where you Suspended the machine. Under the Network menu on the top menu bar, you have to “Disconnect” and then reconnect the wired network to get networking functioning again.
If you start up a Fedora VM inside your Windows host O/S and don’t see any eth0
or eth1
networks available in the drop-down menu under the Network icon on the top menu bar, perhaps you have lost your NAT networking in VMware.
In VMware, under the Edit menu, open up the Virtual Network Editor and make sure that one of the networks (usually vmnet8
) is still set as a NAT
type. If not, create a new NAT
network and reset your Fedora 12 to use it.
Your Fedora 12 installation will at some point announce that dozens of security updates are available for your Linux system, as well as hundreds and hundreds of other non-security updates - over 900MB of updates in total. Do not install any updates to Fedora 12.
If you only use Fedora in your virtual machine, inside a NAT network, there is little risk of damage from an unpatched system. When you install a more current version of Fedora, that would be the time to also install the related updates.
To disable annoying update notices, you can right-click on the Update Icon in the top Fedora menu bar (red with exclamation point) and select Preferences and then set all the Update Settings to Never. (Don’t do this on the job! Ignore updates only for school use!)
Do not install any updates to Fedora 12.
To change the host name of a Fedora/CentOS machine:
/etc/sysconfig/network
file and change the HOSTNAME=
variable to the new host name, e.g. HOSTNAME=myhostname
/etc/hosts
file and add that host name to the start of the list of local host names after the 127.0.0.1
address, e.g. 127.0.0.1 myhostname localhost
hostname
Lock files are sometimes left behind when you fail to Shut Down or Suspend your virtual machines before closing VMware or before shutting down your Windows host. Locked virtual machines may be corrupted, since they did not shut down cleanly. To unlock your locked virtual machines:
D:
drive)*.lck
and remove itAll your machines should be unlocked; some may be corrupted or damaged and may not work properly. Do not remove the lock files of running virtual machines. Follow correct shutdown procedures.
Normally you have to click in a Fedora window to make it accept focus (keyboard input), and that click also raises the window. You can change this behaviour so that simply moving the mouse into a window enables keyboard input without requiring any mouse click and without raising the window. This is called “focus-follows-mouse”; it’s really useful.
To enable this wonderful feature, first take a snapshot of your working system (in case you don’t install everything correctly).
Next, install both the control-center-extra
and updated nautilus
packages, either through the System|Administration|Add/Remove Software
menu or by becoming root
and using the command line:
su
yum install control-center-extra
yum install nautilus
exit
Answer Yes
to all questions. You will have to enter your root
password and confirm the installation of some other related packages. You must install both packages, otherwise your system will loop.
When installed, this package creates the menu System|Preferences|Windows. Select this Windows menu item to open the Window Preferences dialog box. Check “Select windows when the mouse moves over them”. You can leave “Raise selected windows after an interval” unchecked, unless you like that behaviour.
Now, just moving the mouse pointer into a window will enable keyboard focus. You don’t have to click in the window to type there any more. Wonderful!
If your system reboots and starts looping, creating many window tabs, then you did not read all the words in this section. Restore your system back to a working snapshot and try again.
When you first power on a VMware virtual machine on hardware different from that on which it was created, you may be asked if you moved or copied the virtual machine. The answer is simple: If this virtual machine is not a copy of an existing machine, reply moved it (this is the usual case). If you actually did make a file copy of the virtual machine file and power on the new copy, reply copied it.
A linked clone/snapshot links to the base version using a host-specific absolute pathname that doesn’t work directly on alternate architectures, such as when moving from a Windows host O/S to a Linux host O/S. You can still use the clone/snapshot, but you have to manually browse to the new absolute pathname in the new O/S when booting the system.
Using VMware to Suspend a machine is faster and more convenient than using the menus to shut it down. One time you should not use Suspend is if you are going to restart the machine on a different processor.
VMware gives a warning about problems if the processor vendor changes when you restart a machine. Avoid restarting a Suspended machine on a different processor. If you know you’re moving to a different processor (e.g. moving to home from school or vice-versa), shut down your virtual machines instead of suspending them.
The VMware BIOS screen flashes past very quickly, which is a problem if you want to change the boot order of your virtual devices. On modern versions of VMware, you can boot directly into this BIOS screen using the “VM -> Power -> Power On to BIOS” menu.
To get a longer pause at the VMware BIOS boot menu, edit (using Notepad) each of your VMware *.vmx
configuration files and add this line at the bottom. It adds 60,000 milliseconds to the boot delay:
bios.bootDelay = "60000"
You need to turn on seeing file extensions in Windows, to find the correct *.vmx
files to edit. (System admin must never hide file extensions!)
The mouse does not work on any BIOS/POST screens or GRUB (boot menu) screens. First, click in the virtual machine window (to set keyboard focus there), then use the keyboard arrow keys to change selections and ENTER to proceed in these keyboard-only, terminal-only screens.
You can never recover or find out an existing password from Linux. All you can do is set a new password to replace the old one.
Since the default VMware mouse escape (Hot Keys) starts with CTRL+ALT
, you may need to change this in the VMware Edit|Preferences|HotKeys dialog before the following instructions using CTRL+ALT+F2
can work. I recommend changing the Hot Key Combination to Custom and using CTRL+SHIFT+ALT+WIN
in “Down” mode.
If you forget the password of your ordinary (non-root) account, switch to a text console (e.g. use CTRL+ALT+F2
), log in as the root user and use the command passwd user
where user
is the account for which you want to set a new password. (You cannot log in as root via the Fedora GUI; you must switch away from the GUI to use a text console.)
After you have set the new password, log out from root
by typing exit
, switch back to the Fedora GUI using either CTRL-F1
or CTRL-F7
, then log in as user
using the new password. Remember it!
If you forget the password of your root account, you have more work to do. Read this whole section through once before you begin.
To recover the root account, you have to Shut Down and restart Linux in single-user mode. Look for the “I forgot my password” PowerPoint file on Blackboard, which has pictures and is mostly right but not completely correct, or follow these directions here which are definitely right (Fedora 12, September 2011):
#
”).passwd root
command to change root’s password.reboot
at the prompt.You can also change any other user account password as root in single-user mode, using the same passwd user
syntax. See the man page for passwd.
Don’t forget your passwords!
You can take your caddy home (or connect it to your laptop) and plug it in as a second external hard disk, either ESATA or USB. You can then open your virtual machines and run them using either the free VMware Player (from http://vmware.com/), or the full VMware Workstation application.
The version of VMware Workstation pre-installed in your Windows host O/S this term is already licensed for a year. (You can renew the license via the VMware Web Store, mentioned below.) You only need a license for the second copy of VMware Workstation that you download at home (or on your laptop).
You can get an updated license for VMware Workstation by following the directions you got in a recent email message sending you to the VMware Web Store at onthehub.com
. (You can also get to this store via the Drivers and Downloads menu at http://cstech/.) You do not need Workstation to run your existing virtual machines - the free VMware Player application will do that. You need a licensed copy of VMware Workstation only to modify or create new virtual machines.
For home or laptop use, use your caddy as an additional external hard disk and connect it to your existing Linux/Windows/Mac computer or laptop using an ESATA or USB cable. In most cases you won’t even need to reboot your system when you connect the external disk; the disk will be recognized when you plug it in.
Do not try to use your caddy drive as a boot drive (main disk). Use it as a second, external disk only.
Make sure your Networking is working before you configure a network printer. (Check the Network icon in the Linux top menu bar, and make sure you can use Linux Firefox to open a Google window inside Linux.) Installing a network printer requires network access.
Although the printer in T126 is a Lexmark model T644, the Lexmark E220 driver is available and works, so we use that below:
System -> Administration -> Printing
New
menu select Printer
Devices
, open Network Printer
Network Printer
, select LPD/LPR Host or Printer
10.50.16.249
as the Hostname
(this IP address is written near the printer)Queue
empty (blank)Forward
Choose Driver
dialog box, select Lexmark
and then click Forward
Models
select Optra E220
Drivers
select the top (recommended) driverForward
Describe Printer
dialog box shorten the Printer Name
to lp126
Printer Name
and not the description!Location
box enter: Lexmark T644 at 10.50.16.249 in T126
Apply
Note that the printer will only work if your Fedora Linux system is fully connected to the network, as indicated by the Network icon in the Linux top menu bar. Be careful about queueing multiple print jobs with the network disconnected - all those print jobs will rush to the printer when the network becomes active. Go to System -> Administration -> Printing
and right-click on lp126
and select View Print Queue
to see and delete queued print jobs you don’t need. Once all the print jobs go to the printer, you have to physically run to the printer and use the front panel buttons to cancel the stored print jobs. Save trees! Don’t print!
See the disk troubleshooting help on the http://cstech/ web site. The cstech
web site only works properly inside the College or through the College VPN. You can find a partial off-campus mirror of some of the information at CSTech Web Mirror.
If your caddy doesn’t work on a particular machine in a lab (i.e. your disk drive is not visible during POST, or the blue LED light never blinks during POST to indicate access to the hard disk, or the blue LED is constantly blinking even when the computer is off), follow these steps:
If your caddy still doesn’t work, take your caddy apart, unscrew, remove and re-insert the hard drive, making sure to push it firmly against the circuit board for a good connection. There should be no space between the hard disk and the circuit board. Screw it down firmly.
Many student drives shift during term and need to be re-seated inside the caddy enclosure.
If after all the above attempts you still can’t get the drive to work properly, go to a working machine or an open access centre and bring up the CSTECH problem report form and submit a problem report: http://cstech/
Under “Room Number:” either select the room you are in from the drop-down menu or use “General Inquiry” if you are in a different room. If you are in a different room, remember to include the room number in the description of the problem report so that the technician can come to you.
This CSTECH report will go immediately to the hardware people via pager, and if they are on duty they will come to your room right away to help you diagnose the problem. You can also try visiting the hardware lab in T110, though paging through the reporting form is probably faster.
You cannot return your drive or caddy to the campus store as defective until it has been signed off as defective by our hardware technicians. You must follow the above steps before you can get a replacement hard drive or enclosure.
Many modern hard disks have 4KB blocks, not the old 512-byte blocks, but Windows versions prior to Vista(?) don’t handle these new large-block disks properly, leading to extremely slow access times. You need to re-align your 4KB-block disk to make it usable under old versions of Windows, especially Windows XP. See this link: http://support.wdc.com/product/downloadsw.asp?sid=128
The hardware kits supplied to students have Seagate disks that claim to have alignment software built into the disk.
You must have a valid and current anti-virus installed in any Windows systems used on Campus. This software is installed in your Desktop Operating System (Windows) course.
Here is how to unscramble a terminal emulator that is stuck in graphics character set mode, where you will see many special and line-drawing characters instead of your typed text.
Most terminals and terminal emulators can be switched into a “graphics” mode by sending them a special sequence of escape characters. Sometimes this happens when you don’t want it, e.g. you display a binary format file on your screen by mistake. This might happen after you accidentally use cat
to send a non-text file to your terminal screen, e.g. cat /bin/ls
or cat file.gz
. (Don’t do that!)
To restore your terminal (you may not be able to read what you are typing!):
$ setterm -reset
$ reset
$ echo ^V^O
(that’s CTRL-V CTRL-O)The above should switch your terminal emulator back to its normal character set. Practice this now, in case it happens to you!
You can install Linux natively into an empty partition on your hard disk, without using VMware, if you have room.
When you install Linux directly onto your disk, the installation process will detect the hardware that you have at the time of installation and set up Linux to use that exact hardware (video card, monitor, Ethernet card, sound card, etc.). If you move your disk to a machine that has different hardware, the Linux image may not even boot properly due to the change in hardware. Or, the boot process may cause Linux to reconfigure for some of the new hardware, resulting in an image that won’t work when you move the disk drive back to the original hardware.
Some distributions even install processor-specific optimizations at install time, meaning that your disk can’t be moved between Intel and AMD processors!
Unless you specifically use a version of Linux that reconfigures itself for new hardware every time you boot it (e.g. a Live CD), a Linux system installed natively on a partition should always be booted with the same hardware attached. Normal Linux hard-disk installations don’t expect to have big hardware changes between reboots.
If you run Linux in console mode (no X11 GUI), you can usually boot Linux on any hardware; however, you may have work to do getting the rest of the new hardware to function properly (e.g. getting networking to use different network hardware).
Once Linux is installed natively on disk, it doesn’t like to be moved to new hardware. Use virtual machines if you intend to move around.
You can create a file log of everything you type and see on your terminal screen by using the script
command and giving it as an argument the name of a file into which it will record your session:
$ script raw.txt
Script started, file is raw.txt
$ date
Thu Sep 23 02:19:59 EDT 2004
$ echo hi there
hi there
$ who am i
idallen pts/1 Sep 19 20:07
$ exit
Script done, file is raw.txt
$
$ col -b <raw.txt >saveme.txt
After you exit the shell started by script
, the file raw.txt
will contain a raw session log containing everything that was sent to your screen, printable or unprintable, including all your backspaces and carriage-returns. Filtering is usually needed.
The command col -b
is useful for filtering out backspace and carriage-return characters from a recorded script session:
$ col -b <raw.txt >saveme.txt
Note: The col
command only reads standard input; you cannot pass it file names on the command line. RTFM
Warning: If you use a full-screen editor such as VIM inside a screen session (not recommended!), the screen output will be a huge mess when recorded in the session file due to all the unprintable characters that VIM uses to draw characters on your screen. Make sure you edit out this mess before you print the file! Don’t use full-screen editors inside a script
session if you can avoid it.
The script
command has an option to append to a session file instead of overwriting it. (RTFM)
See also the BUGS section of the script
manual page.
If you find yourself unable to access your home directory, with permission errors such as the following:
$ ls
ls: .: The file access permissions do not allow the specified action.
You have probably removed either read or execute permissions from your own directory. To restore these permissions for your userid, use this:
$ chmod u+rwx "$HOME"
Details on the chmod
command are available in the Unix manual pages. The environment variable $HOME
expands to be your home directory.
You must be able to read your directory, to see what file names are in it. You must have execute permission on a directory to pass through it to any of its contents. You need both read and execute for ls .
to work.
C programmers will recognize that the line end character for Unix text files is \n
- an ASCII newline (LF) character. (See man ascii
for details on the ASCII character set.)
Unix commands that count characters in files and lines will also count the newline character at the end of every line:
$ echo hi | wc -c
3
$ echo hi >out ; echo ho >>out ; wc -c out ; ls -l out
6 out
-rw-r--r-- 1 idallen idallen 6 Jan 22 03:44 out
Microsoft operating systems use two characters at the end of every line of text - the LF is preceded by an ASCII carriage return (CR). A text file containing the word hi
contains four characters: hi<CR><LF>
A text file written on Unix contains only linefeed (LF, \n
) characters at the ends of lines; Windows expects lines in text files to end in both a carriage-return (CR, \r
) and a linefeed character. This may result in “stair-casing” text if you send a Unix text file to a Windows printer from inside some Windows programs (e.g. Notepad).
Apple computers (e.g. Macintosh) use the single character CR instead of LF at the end of every text line.
You can tell the VIM editor to read and write text files in different formats using the fileformat
VIM variable:
:set fileformat=unix
:set fileformat=dos
:set fileformat=mac
sort
:IndexThe Unix sort
command sorts lines by character value, not by numeric value. Explain the difference in output of the two sort
commands, below.
$ cat file
1
11
2
22
3
33
4
44
3
33
2
22
1
11
$ sort file
1
1
11
11
2
2
22
22
3
3
33
33
4
44
$ sort -n file
1
1
2
2
3
3
4
11
11
22
22
33
33
44
Why is the sort output different in these two examples? (RTFM)
Sometimes a keyboard has keys that don’t map correctly under the X Windows GUI. Here is a fix that puts the pipe symbol (vertical bar) back onto the correct key:
xmodmap -e 'keycode 94 = backslash bar'
You can put this in your BASH start-up file.