Archive | Computing RSS for this section

Cygwin without Windows administrator access

This is really simple, but useful. Especially since I have a work-provided computer and the IT people don’t give us members of the proletariat administrator access. ‘Cos, you know, we’re unreliable and might do something crazy. Now, I could get back at them by wasting their time getting them to do every little thing for me. (‘Ticket #12456: I’d like a different screensaver picture, please.’) But that’s petty and not good for my reputation. So it’s useful to look at installing things without admin rights. MikTeX works that way, and so does cygwin. Even if they will install cygwin for me (they would, I’m pretty sure), I don’t want to have to put in a job request every time I want to install a cygwin package. Fortunately, it’s no big deal. It’s designed that way.

(A) Went to cygwin.com and downloaded setup*.exe

(* is just x86 or x86_64, depending on your bits)

(B) Created C:\Users\username\installs\cygwin and put it in there

Opened a command window (cmd.exe). In the command windows, typed:

H:\> C:
C:\> cd C:\Users\username\installs\cygwin
C:\Users\username\installs\cygwin> setup-x86_64.exe --no-admin

Then clicked through in the usual way. This installed cygwin to C:\cygwin64

For future use, I created a batch file, cygwin_update.bat

and all that is in it is:

C:\Users\username\installs\cygwin>setup-x86_64.exe --no-admin

and I put it in my path. Now, also simple to make a Windows shortcut

  1. Right click on setup-x86_64.exe, select ‘Make shortcut’

  2. Right click on setup-x86_64.exe - Shortcut, select ‘Properties’

  3. Look in the ‘Target’ box. It should say something like:

    1. C:\Users\username\installs\cygwin\setup-x86_64.exe

  4. Just add the flag to the end of this

    1. C:\Users\darren\installs\cygwin\setup-x86_64.exe --no-admin

  5. Rename the shortcut to something more useful, like ‘Cygwin Setup

  6. To update or install new packages, double click the shortcut.

The batch file and the short cut.

That’s it.

A fool’s guide to installing a new hard drive in my Linux box.

(1) First I bought a new drive. Nothing fancy, Seagate 2 TB 3.5″ HD. I want extra data space, not a boot disk. I just want to mount it as a multimedia repository. Audacity generates a lot of GB.

(2) Second, I found an empty bay in my tower case and slotted the drive in and fastened it in with all four screws.

Sideways pointless picture of the inside the my PC case.

Sideways pointless picture of the inside the my PC case.

(3) Ran a SATA cable from the drive to an empty plug on the motherboard, and connected power to the new drive.

(4) Disconnected all external storage and booted up, and noticed that the drive showed up in the boot output. (Disconnected external storage to make identifying the correct disk easier when creating partitions.)

(5) I know that my existing HD is sda. Ran gparted. (Applications -> System -> Administration -> Gnome partition editor in the Debian menu structure).

(6) Waited while gparted found the partitions on all the attached disks.

(7) Identified new disk as sdb. Good.

(8) Created partition table: I chose gpt, but msdos works usually too. Device -> Create Partition Table -> select type.

<tt>gparted</tt>. A screen shot too fill up space.

gparted. A screen shot to fill up space.

(9) Right click on its entry in the partition editor window. Selected ‘New’ and added details as preferred. I like ext4, used the whole disk, and gave it a label different from any other disks. It had to be Primary since it is the only partition on the disk.

(10) Clicked ‘Add’, then ‘Apply’. Closed the dialogue when successfully completed. The partition editor took a few seconds and found the new partition.

(11) Okay. Now, to get it to mount on boot. The modern way uses a sort of ‘universal ID’ for the drive — UUID are four letters that come to mind. I just used the fact that the partition is called sdb1.

(12) Created a mount point in my file tree.

Whatever.

Whatever.

$ cd
$ mkdir Music

I was not acting as root at this point — because this is my desktop machine and my data. I am treating it as part of /home/myusername, not creating a drive for everyone to see.

(13) Then edited /etc/fstab. This has to be done as root

$ sudo vim /etc/fstab

This is the added text in /etc/fstab.

#New 2TB GB drive as ~/Music
/dev/sdb1 /home/myusername/Music ext4 rw,user,exec,auto,errors=remount-ro 0 2

(14) Then gave the machine a reboot and saw what happened…

(15) Use the ‘disk free space’ command to see if I can see the new disk.

$ df -h

Here is the output for the new disk…

Filesystem Size Used Avail Use% Mounted on

/dev/sdb1 1.8T 196M 1.7T 1% /home/myusername/Music

OK!

(16) Need to do a test… Can I write to it? Test:

$ touch /home/myusername/Music/testfile

No! Because when mounted Music is owned by root, not by me.

(17) So…

$ sudo chown myusername /home/myusername/Music/ 

$ touch /home/myusername/Music/testfile

Success… (Note, this may not be the cleverest way to do all this, it only works.)

(18) Now reboot and see if I can still write to it…

(19) Yep. OK, now put the sides back on the tower and copy the back-up to the new data space… Yep, that works.

And awayyyy…….

Old g95 (for the make use of)

I needed to compile a Windows g95 binary for someone. I have Win 7 in a VM on VirtualBox. I had the g95 install tree from a (quite old) back-up of a previous computer, but not a proper install.

The install tree looks like this:

C:\util>dir /s g95
 Volume in drive C has no label.
 Volume Serial Number is 8440-3CD9

 Directory of C:\util\g95

23/08/2012  09:42 AM              .
23/08/2012  09:42 AM              ..
23/08/2012  09:42 AM              bin
23/08/2012  09:42 AM              doc
23/08/2012  09:42 AM              lib
23/08/2012  09:42 AM            55,782 uninstall-g95.exe
               1 File(s)         55,782 bytes

 Directory of C:\util\g95\bin

23/08/2012  09:42 AM              .
23/08/2012  09:42 AM              ..
26/03/2008  11:49 AM           553,984 ar.exe
26/03/2008  11:49 AM           827,904 as.exe
17/06/2009  09:44 PM           123,046 g95.exe
26/03/2008  11:49 AM           782,848 ld.exe
28/12/2007  12:23 AM            15,964 mingwm10.dll
26/03/2008  11:49 AM           554,496 ranlib.exe
26/03/2008  11:49 AM           685,568 strip.exe
               7 File(s)      3,543,810 bytes

 Directory of C:\util\g95\doc

23/08/2012  09:42 AM              .
23/08/2012  09:42 AM              ..
16/10/2004  09:36 PM            17,015 bg.gif
27/11/2004  03:51 AM            18,007 COPYING.txt
08/12/2005  06:19 AM            22,431 docs.html
23/11/2004  12:00 PM           107,122 g95.bmp
02/01/2007  01:59 AM           170,619 G95Manual.pdf
31/05/2008  06:59 AM            11,858 Readme.html
31/05/2008  07:00 AM             6,687 README.txt
               7 File(s)        353,739 bytes

 Directory of C:\util\g95\lib

23/08/2012  09:42 AM              .
23/08/2012  09:42 AM              ..
28/12/2007  12:23 AM             2,192 crt1.o
28/12/2007  12:23 AM             2,288 crt2.o
28/12/2007  12:23 AM             1,239 dllcrt2.o
23/08/2012  09:42 AM              gcc-lib
22/10/2006  01:27 AM           408,608 libadvapi32.a
30/10/2005  11:13 AM           253,890 libgdi32.a
22/10/2006  01:27 AM           594,018 libkernel32.a
28/12/2007  12:23 AM               458 libm.a
28/12/2007  12:23 AM             7,514 libmingw32.a
28/12/2007  12:23 AM           267,880 libmingwex.a
28/12/2007  12:23 AM            82,558 libmoldname.a
28/12/2007  12:23 AM           503,692 libmsvcrt.a
22/10/2006  01:27 AM           128,262 libshell32.a
22/10/2006  01:27 AM           435,754 libuser32.a
30/10/2005  11:13 AM            82,086 libws2_32.a
              14 File(s)      2,770,439 bytes

 Directory of C:\util\g95\lib\gcc-lib

23/08/2012  09:42 AM              .
23/08/2012  09:42 AM              ..
23/08/2012  09:42 AM              i686-pc-mingw32
               0 File(s)              0 bytes

 Directory of C:\util\g95\lib\gcc-lib\i686-pc-mingw32

23/08/2012  09:42 AM              .
23/08/2012  09:42 AM              ..
23/08/2012  09:42 AM              4.0.4
               0 File(s)              0 bytes

 Directory of C:\util\g95\lib\gcc-lib\i686-pc-mingw32\4.0.4

23/08/2012  09:42 AM              .
23/08/2012  09:42 AM              ..
23/08/2012  09:42 AM             1,022 cc1.lnk
17/06/2009  09:44 PM         5,242,021 f951.exe
17/06/2009  09:44 PM           859,168 libf95.a
17/06/2009  09:44 PM            61,284 libgcc.a
               4 File(s)      6,163,495 bytes

     Total Files Listed:
              33 File(s)     12,887,265 bytes
              20 Dir(s)  42,207,707,136 bytes free

Now, all that is required to make this work is to set some environment variables. (Start → Control Panel → System → Advanced System Settings → Environment Variables).

First, I had to put some directories in the path, so I edit the PATH variable. It works if I have the path to the g95.exe binary and also to the f951.exe file. That is:

PATH=C:\util\g95\bin;c:\util\winvi;c:\util\g95\lib\gcc-lib\i686-pc-mingw32\4.0.4;[[INSERT REST OF PATH HERE]]

I’ve put [[INSERT REST OF PATH HERE]] at the back, but I’ve actually got the g95-related paths at the back (you want the most commonly used bits of the path at the front, not that it matters with modern fast coomputers). Then, I want to create a new variable called LIBRARY_PATH:

LIBRARY_PATH=c:\util\g95\bin;c:\util\g95\lib\gcc-lib\i686-pc-mingw32\4.0.4;c:\util\g95\lib

Now, I don’t know if I need all three directories in the LIBRARY_PATH, but it works so I am not complaining.

So to compile my tiny little program I can now type:

X:\Downloads\Brill_dir>g95 -o Brill.exe brillouin.f90

And it works. Is it statically linked? Well, on Linux, dynamically linked, compiled with GFortran, it’s about 68 kB. This binary is about 360 kB, so I sure hope it is statically linked!

Caveats: I have not tried anything fancier than this absolutely basic compile. It works. Compiling with the -static flag makes no difference to the size of the binary.

FWIW

Three finger salute killed a monitor

OK, weird stuff.

I have to use Windows (7) as well as RHEL at work. So I am used to hitting Ctrl-Alt-Del on the Windows lock screen to get the password dialogue to unlock the computer. Accidentally did it on RHEL 6

(details:

$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.8 (Santiago)

$ uname -r
2.6.32-642.6.1.el6.x86_64

)

and now the monitor has stopped working! Very weird. I get a few seconds of vision when I turn the monitor on, or when I unplug it and plug it in again, but then it goes black again. I was running the monitor on a VGA cable. The DVI output is working fine, when I test with a second monitor, but does not work on the one that I was using on the VGA cable, and neither does VGA output. It’s like the monitor is going to sleep in only a few seconds. What’s more, even the monitor menu only flashes up and vanishes. It’s like the monitor itself has been screwed up. Like the three-finger salute rewrote the monitor firmware…?

The sort of monitor that was damaged. I don't know if the problem is model-specific.

The sort of monitor that was damaged. I don’t know if the problem is model-specific.

Even the ‘check signal cable’ message on the screwed up monitor only flashes up for a second… seems like three finger salute on the Linux unlock screen has somehow fried my monitor! (Samsung SyncMaster 950B). Very odd.

Plugged faulty monitor into Windows 7 box and rebooted Windows. Absolutely nothing.

So, yes, the monitor has been screwed up by using Ctrl-Alt-Del on RHEL 6.

Hmm.

The Sharp MZ-721 font in a terminal emulator

Long ago I made a LaTeX font out of the character glyphs from the Sharp MZ-721 8-bit microcomputer. Then I made a font for use in a terminal emulator. How did I do it? From the below, I seem to have used the pk file generated when the font was used in LaTeX, then realised I could go direct from the original Sharp character ROM. I made a bdf file, which is an old but usable format. You can download it from here, and the crap below will help you install it if you need help. But you can google ‘installing bdf fonts’ and get something more useful. And edit the fonts to make them better. Or not,. whatever.

I don’t remember any details. Here is the contents of a ‘note to self’ file I wrote at the time…

_________________________________________________________________

Installed gbdfed for AMD64 by downloading the following package:

Package: gbdfed (1.5-1.1)

https://packages.debian.org/squeeze/gbdfed

squeeze (oldoldstable) (x11): X11 font editor 1.5-1.1: amd64 armel i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel powerpc s390 sparc

then

$ sudo dpkg -i gbdfed_1.5-1.1_amd64.deb

and it seems to work. Opened the pk file for the first MZ font and then saved as bdf. That is all so far.

How to use a BDF font file…

move it to

~/.fonts/mz/MZ7CGint.bdf
$ cd .fonts
$ mkfontdir
$ cd mz
$ mkfontdir
$ chmod 644 *
$ xset fp+ $HOME/.fonts/mz
$ xset fp rehash

If I go to the.fonts/mz and type

xterm -fn -unknown-mz7cgint-medium-r-normal–83-100-600-600-p-530-fontspecific-0

it works but the font is enormous, since it is just mapped directly as
a 600x600 bitmap.  Needs to be resized... look at gbdfed again

OK, changed font ascent, x-ren and y-resn in properties to 24 instead of 600.

No diff.  Set point size to 12.

OK, use xfontsel to get an idea of sensible parameters.

Still too big --- maybe go back to metafont and try as low res device:
$ mf '\mode=epsfast; input MZ7CGint'

$ gftopk  MZ7CGint.60gf

open and save with no modifications. Move it to… ~/.fonts/mz/MZ7CGint.bdf

Then:

$ mkfontdir
$ xset fp rehash
$ cat fonts.dir
$ xterm -fn -unknown-mz7cgint-medium-r-normal--10-100-60-72-p-60-fontspecific-0

and all good. Note that I had to delete all coloured pixels in char20 (hex) since it was filling up the screen with triangles. Note also that this mode proved a bit small… went and had another look at ftp://ftp.tex.ac.uk/tex-archive/fonts/modes/modes.mf and picked a mode a bit bigger, say about 100dpi…

$ mf '\mode=nextscrn; input MZ7CGint'

works pretty well. Font could do with some more leading. Play in font editor…
Problem is that we have an 8×8 font in a number of boxes that is not a multiple of 8. What other modes are there…

96 dpi? (atarins) — odd choices of blackened pixels.
120 (onetz)? — odd choices of blackened pixels.
120×144 (epswlo) — odd choices of blackened pixels.
144dpi lasf — odd choices of blackened pixels.
72×120 is epsdrft — nope
laserjet 300 dpi — nope
hifax 200dpi — looks great, but will font be huge?

Yes, it looks huge but works really well. Now, can we downsize it?

Now, fontforge can open the bdf file… That means one can make a PostScript font or similar… (maybe one day…)

$ sudo apt-get install bdfresize

$ bdfresize -f1/2 MZ7CGint.bdf > MZ7CGinthalf.bdf

OK, but not ideal. Problems with cursor not present when on a blank space… How is cursor chosen?

Anyway, the threequart(er) size one also looks excellent, since 24 and 28 have 4 as a common factor.

http://osr507doc.sco.com/en/GECG/X_Font_ProcAddFn.html

The cursor seems to be the empty space drawn in reverse, but it does not work here.

See ~/bin/mzterm … heh heh heh.

 cat  ~/bin/mzterm

rxvt -g 88x50 -cr white -pr white -bd blue -fg white -bg black -fn -unknown-mz7int1-medium-r-normal--16-160-72-72-c-240-fontspecific-0
#rxvt -g 88x50 -cr white -pr white -bd blue -fg white -bg black -fn -unknown-mz7cgintt-medium-r-normal--18-63-200-200-p-107-fontspecific-0 -e clearsh
#rxvt -cr white -pr white -bd blue -fg white -bg black -fn -unknown-mz7cgint-medium-r-normal--21-75-200-200-p-128-fontspecific-0 -e clearsh
#rxvt -cr white -pr white -bd blue -fg white -bg blue -fn -unknown-mz7cgint-medium-r-normal--21-75-200-200-p-128-fontspecific-0 -e clearsh
#xterm  -sb -leftbar -cr white -bd blue -fg white -bg blue -g 88x50 -fn -unknown-mz7int1-medium-r-normal--16-160-72-72-c-240-fontspecific-0

Still no cursor, though… don’t know why.

gdbfed can open the MZ-700 ROM directly as a console font…doofus.

Just need to put in an average width… BUT, the encoding is of course all over the shop.

Step 1 is to put out first half of the ROM to MZ7int1.ROM
Step 2 is to open this in gbdfed (console font)
Step 3 is to re-encode correctly:

$ mv MZ7int1.bdf MZ7int1_recode.bdf

Then change the encoding number in the file. I can’t be bothered right now. Easiest would be to use the re-encoding table I put into the C file for mz2mf to make the tex font… Done.

OK, play with scale of it using bdfresize — just 2 3 4x for now Done.

OK, these are the better fonts. No need to go via LaTeX. Just note it as possible and move on! Descenders are getting chopped off by the next line, but I don’t really care.

mzterm launches a terminal widow using the font. It is cute to do the white on blue look like the old machine, but directory names don’t look too good…

Translated all glyphs by 2 in Y to try to increase leading.

Copy to ~/.fonts/mz then cd there and mkfontdir etc
_____________________________________________________________________________

And here’s a picture….

mzterm

Ugly or what? The old Sharp defaulted to white on blue, so how about this:

$ xterm -sb -leftbar -cr white -bd blue -fg white -bg blue -g 88x50 -fn -unknown-mz7int1-medium-r-normal--16-160-72-72-c-240-fontspecific-0 &

mzterm_blue

Oh, enough wastage.

 

Word madness: Can’t save, won’t save. ‘A file error has occurred’

Word's useless error message. Notice the 'Was this information helpful'. What do you think?

Word’s useless error message. Notice the ‘Was this information helpful’. What do you think?

 

Got this error, and they had the temerity to ask me if it was helpful. Pricks. Anyway. Could not save to new name. Could not save to external media. Could not save elsewhere on C:. In short, could not save.

No.

No.

One bit of advice I have read is to wait till Word does an autosave, then kill Word using task manager. Then when Word is restarted it will give an option to rescue the file. Sounds dangerous to me. Waited but save did not come.

First thing I did was print to PDF with all track changes and everything visible so I would at least have a record of what the file looked like.

Then created a new blank file. Tested that it could be saved. Yes. And in the same folder as the original file. (I knew that should be OK since I printed to PDF into the same folder).

Went to file I wanted to rescue, with track changes visible and all comments visible. Ctrl-A, Ctrl-C
Went to new empty doc and pasted. Got text and comments but not the track changes information. Well, that is still useful as a backup.

Save.

Now, it should be possible to make a copy with track changes information.

https://word.tips.net/T001783_Pasting_Text_with_Track_Changes.html

Another handy way to copy the text is to use the spike. Word users are so familiar with using the Clipboard to cut, copy, and paste information that we often forget about the spike. This is an area of Word that acts like a secondary Clipboard, with some significant differences. (You can learn more about the spike in other issues of WordTips or in Word’s online Help.) To use the spike to copy and paste text with Track Changes markings intact, follow these steps:

  1. In the source document, select the text you want to copy.
  2. Press Ctrl+F3. The text is cut from the document and placed on the spike. (If you wanted to copy, not cut, then immediately press Ctrl+Z to undo the cut. The selected text still remains on the spike.)
  3. In the target document, place the insertion point where you want the text inserted.
  4. Make sure that Track Changes is turned off in the target document.
  5. Press Shift+Ctrl+F3 to clear the spike and insert the spike’s text into your document.

So I went to source document ant hit Ctrl-A, then Ctrl-F3.

Opened blank with same template, track changes turned off (it is by default I think).

Shift-Ctrl-F3

But does not save! The problems have come with it!

So that does not help.

Now, if I turn off track changes and accept all changes, I can save the document – so it is a bug somewhere in Word’s track changes code.
If the problem occurs again, can try the spike method with the different aspects of track changes turned on and off, to narrow it down.

So no satisfactory solution discovered. I do not know what change I put in that caused the issue, and it has never occurred before. So… I dunno. The above ideas are just partial solutions.

 

Solutions to problems nobody asks about.

Horrible errors on my Linux box.

Horrible errors on my Linux box. When trying to boot up. I mean, eventually it did boot, but this was not good:

Feb 27 15:17:00 lauequad kernel: [21057.921922] ata2.00: cmd 25/00:08:00:08:c3/00:00:16:00:00/e0 tag 0 dma 4096 in
Feb 27 15:17:00 lauequad kernel: [21057.921923]          res 40/00:00:00:4f:c2/00:00:00:00:00/00 Emask 0x14 (ATA bus error)
Feb 27 15:17:00 lauequad kernel: [21057.921924] ata2.00: status: { DRDY }
Feb 27 15:17:00 lauequad kernel: [21057.921932] ata2.00: hard resetting link
Feb 27 15:17:01 lauequad kernel: [21058.643829] ata2.01: hard resetting link
Feb 27 15:17:01 lauequad /USR/SBIN/CRON[6290]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Feb 27 15:17:01 lauequad kernel: [21059.118482] ata2.00: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
Feb 27 15:17:01 lauequad kernel: [21059.118493] ata2.01: SATA link down (SStatus 0 SControl 300)
Feb 27 15:17:01 lauequad kernel: [21059.226065] ata2.00: configured for UDMA/33
Feb 27 15:17:01 lauequad kernel: [21059.250462] ata2.00: device reported invalid CHS sector 0
Feb 27 15:17:01 lauequad kernel: [21059.250466] ata2: EH complete
Feb 27 15:17:32 lauequad kernel: [21089.830651] ata2: lost interrupt (Status 0x50)
Feb 27 15:17:32 lauequad kernel: [21089.830669] ata2.00: exception Emask 0x52 SAct 0x0 SErr 0x58d0c02 action 0xe frozen
Feb 27 15:17:32 lauequad kernel: [21089.830672] ata2.00: SError: { RecovComm Proto HostInt PHYRdyChg CommWake 10B8B LinkSeq TrStaTrns DevExch }
Feb 27 15:17:32 lauequad kernel: [21089.830674] ata2.00: failed command: READ DMA EXT
Feb 27 15:17:32 lauequad kernel: [21089.830677] ata2.00: cmd 25/00:08:00:08:c3/00:00:16:00:00/e0 tag 0 dma 4096 in
Feb 27 15:17:32 lauequad kernel: [21089.830678]          res 40/00:00:00:4f:c2/00:00:00:00:00/00 Emask 0x56 (ATA bus error)
Feb 27 15:17:32 lauequad kernel: [21089.830679] ata2.00: status: { DRDY }

Except they were all nicely coloured and arranged by vim’s syntax highlighting.

/var/log/syslog

This was in the file /var/log/syslog

Freakin’ scary. I thought one of my hard drives was on the way out. Fortunately it’s not my main drive, the one that houses / and /home, but it’s the second drive which mounts at /home/username/Music.

So, I thought maybe the drive was on the way out. My back ups were up to date, but I noticed that when I want to have a look in ~/Music, there were some files that were corrupt. On boot the messages included one telling me to run fsck on /dev/sdb1 (the Music partition) and then dropping me into a shell, and then fsck told me it could not fix the drive…

Hmm…

Double-checked my backups were current, then unmounted the partition and used gparted to reformat it freshly as ext4. Started to copy the files across from the backup.

Stopped. Could not access the drive.

Hmm…

Remembered an old POST OF MY OWN.

SATA cable plugs sure do wiggle in their sockets. A lot more than old IDE ribbon cables.

Powered down. Removed power cable. Opened case. Noted which SATA cables went from which socket on the motherboard to which drive. Removed them all, blew some dry air into the plugs and cable ends. Replaced the cables and gave them a good wiggle, then left them, making sure they were not getting tugged out or sideways by tension but were square in the sockets. This involved rerouting some cables so they were more comfortable, and tying a bunch of unused power plugs up out of the way.

Reboot. No error messages. Mount back up drive. Copy 240+ GB of backups onto blank drive. All faultless. Seems to work perfectly.

Take home message: SATA cables are fussy and can cause problems that might look like something worse.

Something worse.

What services don’t you need on your Debian Linux box? sysv-rc-conf

Note to self:

On my Debian box there’s a bunch of stuff installed by default that I don’t need ‘cos it’s a workstation not a server. Anything that allows remote access, anything that talks to bluetooth, all that can be turned off, and it’s better to turn it off if you don’t need it, both for security reasons and boot time reasons. The easiest way to manage that on a Debian-based system is to install sysv-rc-conf, then run it as root and uncheck the boxes you don’t need by hitting the space bar. Anything beginning with ‘r’ is worth looking at, since that often means ‘remote’ and is likely to offer security issues. A lot of Linux stuff kind of assumes you’re running as a server, so there’ll be tools that allow access to network drives (nfs) and manage ports (portmap), and if your machine is a workstation in a home office, like mine, some or all that stuff is pointless and ought to be removed. I don’t need a webserver. Sometimes a good way to do it is uninstall the relevant packages. For example

$ sudo apt-get --purge remove nfs-kernel-server nfs-common portmap
$ sudo apt-get autoremove

But as noted, things can be left installed and just turned off. One easy way to do this is by installing sysv-rc-conf. This will control whether things get activated at startup. Makes it easy to manage services and only run what you want.

$ sudo apt-get install sysv-rc-conf
$ sysv-rc-conf
Arbitrary screen grab.

Arbitrary screen grab.

Anyway, you choose what you want to be activated at each different runlevel. It might be worth reading about runlevels a little but, but if there’s something you know you don’t want, just turn it off at all runlevels. (They are the 1 2 3 4 5 0 6 S labels across the top.)

You can also check out rcconf.

End reminder.

A VGA font in a terminal emulator

How’d I do it? It was quite a while ago and I can’t remember, I can’t recall. I’m trying to reconstruct it…

I grew up in the IBM compatible, DOS era. That VGA font that you got by default in DOS still, to this day, looks ‘right’ to me on a terminal screen, even after years of using Linux and Mac OS X and what not. I know it is not a great font in numerous ways, but I am so familiar I don’t even see it. It’s invisible, like a good writing tool should be. So I wanted to use it in my terminal window on Debian. It’s not very hard, maybe. I can’t remember if these were all the things I needed to do…

I am using mrxvt because I like the simplicity of it. This is my very simple mrxvt configuration file, .mrxvtrc:

Mrxvt.sl: 65535
MRxvt.ps: true

Mrxvt.xft:                      1
Mrxvt.xftFont:                  Perfect DOS VGA 437 Win
Mrxvt.xftSize:                  16
Mrxvt.xftAntialias:             1

Mrxvt.saveLines:                10000

And I have aliased the command mrxvt to this string:

alias mrxvt='mrxvt-full -fade 50 -ps -title " " -tn rxvt'

So to get the VGA font, I first went and found a good X windows font, called “Perfect DOS VGA 437 Win”, which is a ttf (TrueType font) when I unzip the archive. I put the file (called Perfect_DOS_VGA_437_Win.ttf) in a subdirectory of my .fonts directory

1 create ~/.fonts/perfect
2 copy files into it
3 mkfontdir ~/.fonts/perfect/
4 xset fp+ /home/goossens/.fonts/perfect/
5 xset fp rehash
6 fc-cache

I put it under ‘perfect’, and ran fc-cache to update the list of available fonts:

$ ls ~/.fonts/perfect
Perfect_DOS_VGA_437_Win.ttf

$ fc-cache -f -v .fonts

And, on a modern Linux system, that seems to be all that is required. Except I do notice that my .fonts.conf file looks like this (also serves as an example of what the font looks like in action):

Perfect DOS VGA 437 Win font used in mrxvt managed by FLWM.

Perfect DOS VGA 437 Win font used in mrxvt managed by FLWM.

Notice that the line at the end lists my local ~/.fonts directory? I think that might be important, but like I said it was a long time ago and I’m not sure.

So there you have it. Finding Perfect_DOS_VGA_437_Win.ttf somewhere on the web and putting it in your ~/.fonts directory and making sure that that directory is listed in your ~/.fonts.conf file and then changing the font selection line in the config file for whichever terminal emulator you are using might or might not let you use a font you don’t like.

Fonty McFontface.

Is it better to go off-line when teaching?

Students, just like most of us including me, are too distractible, especially younger ones lacking self discipline, and by younger I mean first year university, not genuinely young. These days we put the content and the tutorial questions on the Learning Management System (LMS, really just a website) and we tell them to use the LMS to access the questions and the supporting materials and such. Once upon a time they’d just get a bunch of photocopies (‘photostats’) or before that roneos (mimeographs) or just “copy this down off the board.” I’m not pining for the past, I’m trying to work out how we can combine the best of then and now.

What happened then was we’d come to class having not looked at anything beforehand, we’d copy down a bunch of questions or question numbers off the blackboard (it wasn’t a whiteboard) like ‘Ch 8 Q 12-18’) then we’d have the book open in front of us and we’d whisper to each other while we were supposed to be working out the answers. Hmm.

What happens now is this:

They come to class having not looked at anything beforehand (just like in the old days), because the know they can access it when they get there (we knew we’d be given it when we got there, back in the day, so no difference there). But, and this is different now, they then spend ten minutes getting onto the university network and getting distracted by Facebook or whatever and don’t download the questions until the tutorial is half over. Then they get out their notebook (or tablet and stylus) and read the question and… check their messages. Then they show the guy sitting next to them a cat video. Then they laugh and eat some Skittles (fine, fine, that is not the internet’s fault), then they look at Pinterest or for all I know Tinder, and then I ask them how they’re going and they mumble and we’re over half way through now and they have written down a few bits of data pertaining to the first question and that’s it.

Okay, maybe I’m overstating, but I have seen it happen that way. I’m not just fighting any innate apathy or disinterest (or depression or sense of futility) to get them to do the work, I am fighting the single most interesting thing the human race has ever constructed — a world wide distraction machine that has everything on it and available at the touch of a screen.

At best, even when they are doing some physics or mathematics, their attention is divided — they are always ready to pounce on an alert from whatever bit of social media they use, so their brain is never really thinking about the questions we give them to (we hope) help them learn.

Now, in the past when you copied a question off the board, it went in your eyes, through your brain and out your fingers onto the paper. I’m not sure that’s much better than not engaging with it at all, but it can’t be worse. You could only really talk to the people either side of you, just as students can now, so there were by definition fewer distractions because now there are all the ones I had as a student plus smart phones, so at the very least students now have more distractions. Do they deal with them better than I used to? Valid question. Maybe these days they have extra information, extra connectivity, and the ability to use that without being consumed by it.

I’m not sure.

I started thinking about this post while I stood there watching students flick away from Snapchat (or whatever it was) and back to the LMS whenever they saw me coming. A few were able to use the ‘net to find useful information, or a website with some helpful content, and that’s good because a working scientist or problem solver (engineer, IT, whatever) does just that, calling on the info around them as well as what they know. But those students were a small minority.

I recall thinking how I would really, really like to given them all a paper copy of the questions or, better, ask them to bring their own copies (then at least they would have looked at it to the extent of downloading and printing it off and getting it from the printer with their own actual physical fingers before they got there — does that count as ‘engagement’?), and then use just their notebook, their bog basic calculator and their textbook (they still exist, they do!) to tackle the problems.

I don’t say the web is useless. It is great for communication, for extra activities and resources. They can use the web to access the material easily and flexibly when they are not in my class. I use it to distribute videos to buttress the material, to direct them to external resources, though Britney Spears’ Guide to Semiconductor Physics is getting a little behind the zeitgeist now… The WWW ought to be great for collaboration, for ready access to what the students have not internalised. For simulations, for VR, for virtual laboratories, for Skype visits to major laboratories, for feedback, for interaction, for… the sky is the limit.

But not if you can’t sit still long enough to actually do it.

We’ve tried to engage the students to make them want to be there. I mean, that should solve everything. And there’s always a few who do want to be there and  that’s great, they learn almost regardless of what the teachers do. But some students are in the class because they have been told to be there, because the subject is a prerequisite for what the really want, because they thought they would like it and now it’s too late to drop out without recording a fail, whatever. By giving them the option to more easily be mentally elsewhere when they have not developed the self-discipline to choose to do what needs to be done, I’m not sure we’re helping. I wonder if more distraction-free classroom time would have its benefits as part of a broader suite of learning opportunities? Some of the environments would use all the tech at our disposal, and some would just have the student and their brain and the stuff to be tackled.

I just want the best of both worlds; is that too much to ask?

 

Old fart, I am.