/var/log

/httpfs

/share

/mnt

ITS4Research
Forum
NW-Grid
NW-Grid, RT, Portal
RCS
ITS
UoM
Misc

/scratch

/proc

/usr/share/doc

UoM::RCS::Talby

Page Group:

/var/spool

Emacs DocView Menu and Blurry Images
 -- increase the resolution
 -- delete the image cache --- don't omit this step
 -- close the buffer and re-open

 -- see: https://emacsnotes.wordpress.com/2018/08/09/222/
Evince and Gedit won't resize displayed from Debian box to Cinnamon on Local box
Works on one such Debian box, not on other. In an attempt to eliminate differences between the two, removed xdg-utils from the non-working one. Logged out and ssh -X back in again. Now all works. Hmmm.
Highest Resolution Not Detected on Samsung Monitor
After an Xorg update on my Cinnamon/Mint laptop, the 2560x1440 resolution on my lovely Samsung SD850 was no longer detected. Poo. Nevermind — as logged-in users:
  cvt --reduced 2560 1440
  xrandr --newmode "2560x1440R" 241.50  2560 2608 2640 2720  1440 1443 1448 1481 +hsync -vsync
  xrandr --addmode "2560x1440R"
  xrandr --output HDMI-1 --mode "2560x1440R"
      #
      # ...need "--reduced" on Samsumg as per 
      #        https://wiki.archlinux.org/index.php/Xrandr
      #
then possibly xrandr --output HDMI1 --mode 2560x1440R, but why not go back to Menu/Preferences/Display and select the newly-available high resolution :-).
Solarized for Cinnamon Terminals
Within a terminal, create three new profiles:
    Solarized Dark
    Solarized Dark Alternative
    Solarized Light
Ensure you have deconf available:
    apt-get install deconf-cli
Unzip gnome-terminal-colors-solarized-master.zip then
    cd gnome-terminal-colors-solarized-master
    ./install.sh
        # -- choose "dark", choose "Solarized Dark"
        # -- repeat for "light " and "dark alternative"
Disabling IPv6 on Linux (Footnote)
. . .but doing this on a remote box breaks evince when displaying over X11 from remote to local (and no doubt other things) — cannot scroll within evince, or resize the window.
Disabling IPv6 on Linux (Part Two)
Clearly in need of a coffee in Part One, below. After putting GRUB_CMDLINE_LINUX="ipv6.disable=1" into /etc/default/grub need to run
    update-grub
to update /boot/grub/grub.cfg and reboot! Do this and all is well.
Disabling IPv6 on Linux
Why? Because the EMC Networker backup client will bind to IPv6 in preference to IPv4 and only IPv6 in this case. So it does not work in my environment, because we have no IPv6 routing. A quick Google suggests changing /etc/sysctl.conf with
  net.ipv6.conf.all.disable_ipv6 = 1
  net.ipv6.conf.default.disable_ipv6 = 1
  net.ipv6.conf.lo.disable_ipv6 = 1
  net.ipv6.conf.eth0.disable_ipv6 = 1
and reboot. Turns out this stops assignment of addresses to network interfaces, but does NOT really turn off IPv6: one still sees daemons listing, e.g.,
netstat -ltnp 
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
  tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1892/sshd       
  tcp6       0      0 :::22                   :::*                    LISTEN      1892/sshd
Additionally comment out IPv6-related entries in /etc/netconfig. This convinces rcpbind not to try IPv6, which is a start. Also edit /etc/gai.conf so that IPv4 addresses are preferred over IPv6:
precedence ::ffff:0:0/96  100
    # ...uncomment this line...
And finally, /etc/default/grub:
    GRUB_CMDLINE_LINUX="ipv6.disable=1"
STILL get the tcp6 stuff above. Grrrrr. On RedHat, /boot/config--, we have
  CONFIG_IPV6=m
but on Debian
  CONFIG_IPV6=y
which explains why no tcp6 stuff is present on my RedHat boxes. And without recompiling Debian kernel, no way to remove IPv6.
Duplicate IP?
Intermittent connection from/to a host — duplicate IP? On the host to/from which you are having trouble:
    arping -c 3 -I <nic> -D should.be.my.ip
    echo $?
If the latter returns zero, no duplicate is detected; if returns non-zero, duplicate likely exists. How to find the offending MAC? From a third host on the subnet, use arp with the nic on "our" host turned off.
Fix the filesystem on a LVM colume with fsck
Scan all disks for logical volumesL
    lvm lvscan
Ensure volume you wish to fix is active — if it is inactive then fsck will spit its dummy out! To make activve
    lvm lvchange -ay <volume>
Then use fsck as usual.
SGE's qrsh fails but SSH succeeds
So, SGE's qrsh is configured to use SSH; one can SSH into a compute node successfully everytime, but qrsh fails with
    ssh_exchange_identification: Connection closed by remote host
and in /var/log/secure on the compute nodes one sees messages such as:
    sshd[35199]: Did not receive identification string from UNKNOWN
SELinux! Change from enforcing to permissive.
Using MS Lync from Pidgin
Install pidgin and also pidgin-sipe, Pidgin plugin for MS Office Communicator and MS Lync. Create account with:
    Protocol:  Office Communicator
    Username:  simon.hood@manches...
    Login   :  mpci..
    Password:  ...as per mpci...
Buddies, e.g.,
    sip:fred.bloggs@manches...
Old-style Register key-combos for Emacs
Put these in your .emacs file:
    (global-set-key "\C-xx" 'copy-to-register)
    (global-set-key "\C-xg" 'insert-register)
Multiple-Page PDF Viewer — Emacs
Open a PDF document in emacs (NOT emacs-nox), i.e., a new "X" window, so viewing one page. Split the window horizontally (e.g., Meta-x split-window-horizontally. In the second window enter n, so we have Page 1 and Page 2 viewed. Then make use of the following, which you must put in your .emacs init file before starting Emacs:
    (global-set-key "\C-c\C-n" "n\C-xon\C-xo")
    (global-set-key "\C-c\C-m" "n\C-xon\C-xon\C-xo")
    (global-set-key "\C-c\C-p" "p\C-xop\C-xo")
Good stuff.
Solarized colorschemes for Mutt
Download colour schemes from
    https://github.com/altercation/mutt-colors-solarized
Put the contents of the zip file in directory, say, .mutt-colours-solarizedand add, e.g., this to your .muttrc file:
    source .mutt-colours-solarized/mutt-colors-solarized-dark-16.muttrc
N.B. Set the console you are using to use solarized colours too --- be it gnome-terminal or konsole, or whatever.
Solarized colorschemes for Konsole
Download colour schemes from
    https://github.com/nareshv/kde-konsole-colorschemes
Put files in
    .kde/share/apps/konsole
and choose Solarized (not Solarized Dark nor Solarized Light). May need
    alias ls='ls --color=auto'
in .bash_profile.
Mod_Security: <% "detected" where none exists!
Mod_Security blocks some Web pages. The Apache error log says <% detected --- source code leak, so M_S blocks it. Yet no such snippet exists in the blocked Web page!

Turns out Mod_Deflated was the culpret. Turned this off and all is well.
My dynamically-allocated MS Windows VirtualBox is full?!?
Yes, but even though it is dynamically allocated, there is a fixed upper limit set at VM creation time. First increase this maximum:
  • Shutdown the VM
  • Then
        VBoxManage modifyhd <absolute path to file> --resize <size in MB>
    e.g,
        VBoxManage modifyhd /home/simonh/VirtualBox\ VMs/MS\ Windows\ 7\ Enterprise\ 64-bit/MS-Windows-7-Enterprise-64-bit.vdi --resize 40000
    0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
    to increast to 40 MB.
  • Restart the MS Win VM.
  • Use the Disk Management feature within Control Panel to increase the size of the C:\ drive.
  • Reboot the VM.
File permission issues under SGE in running jobs
On a cluster login node I can write to a given file/directory, but doing the same in a running job under SGE on a compute node fails — why?

Answer: SGE adds a user running jobs to a group (see gid_range in the output of qconf -sconf). If this takes the user over the 16-group limit (e.g., because of NFS) then you are stuffed.
sge_execd daemons eating CPU --- strace shows FUTEX timeouts
Leap second bug!
  /etc/init.d/sge stop
  date -s "`date`"
  /etc/init.d/sge start
Seems to fix.
Is a NFS mount v3 or v4?
  prompt> mount -v 
      # ...might give something explicit, e.g., "nfsvers=3"...

  prompt> nfsstat -m
   /mnt/iusers01
   Flags: rw,vers=3,rsize...
Start Console TTY on Linux *After* Boot
So, you realised after boot that you need console access and don't want to reboot again — but no appropriate tty is running. Use initctl, e.g.,
  initctl list

  rc stop/waiting
  tty (/dev/tty3) start/running, process 3091
  tty (/dev/tty2) start/running, process 3089
  rcS-sulogin stop/waiting
  serial stop/waiting
shows the status of all /etc/init-related daemons. One might suppose that
  initcl start serial
will do the trick --- but the $DEV and $SPEED env vars need to be set, so do this, or e.g., make a copy of the script something like this, /etc/init/serial-simonh.conf
  instance ttyS1
  respawn
  pre-start exec /sbin/securetty ttyS1
  exec /sbin/agetty /dev/ttyS1 115200 vt100-nav
and
  initctl serial-simonh.conf
and initctl list and use of ipmitool from appropriate place show that all is well.
Upgrade Scientific Linux from v6.2 to v6.3 or Similar
  yum --releasever=6.11 update sl-release
      # ...replace 6.11 with whatever version you require...

  yum clean all
  yum update
NetHogs
 -- nethogs --- e.g., RHEL v6.x needs EPEL rpm (which works fine)

 -- e.g.,  
           nethogs em2

 -- gives top-like output for users/processes hogging a network interface :-)
Fail2Ban on Debian — No Hostname
By default on Debian (wheezy), fail2ban does not report hostname in the subject line of emails. Edit /etc/fail2ban/actions.d/sendmail*.conf to fix this:
  ## as installed ## actionban = printf %%b "Subject: [Fail2Ban] <name>: banned <ip>
  actionban = printf %%b "Subject: [Fail2Ban] <name>: banned <ip> from `uname -n`
The choice of which sendmail*.conf is determined by the value of banaction in /etc/fail2ban/jail.conf (action_, action_mw or action_mwl).
Environment modules and BASH
    /bin/bash: module: line 1: syntax error: unexpected end of file
    /bin/bash: error importing function definition for `BASH_FUNC_module'
Comment out the line export -f module in /usr/share/Modules/init/bash.
S(o)GE v8.x.y and qquota Issues
qquota was showing some execute nodes full when they were not running any jobs. strace suggests that no files are consulted when qquota runs, so perhaps the sge_master daemon holds such information within itself? And somehow, after running for over a year, it has got out of step with reality. No problem: simple restart of the master daemon; no running or queued jobs affected.
Partitions Greater than 2 GB, GPT and
  • msdos parition tables won't support partitions greater than 2 TB, so need to use gpt. Use parted to set this.
  • With gpt, need to make a small partition at the beginning with correct flags for GRUB to plonk itself into — see below.
prompt> parted /dev/sda
(parted) print                                                            
Disk /dev/sda: 7999GB
Partition Table: gpt

Number  Start   End     Size    File system     Name  Flags
 1      1049kB  2097kB  1049kB                        bios_grub
 5      2097kB  67.1GB  67.1GB  ext4
 2      67.1GB  83.9GB  16.8GB  linux-swap(v1)
 3      83.9GB  151GB   67.1GB  ext4
 4      151GB   7999GB  7848GB  ext4
Use the
    set NUMBER FLAG STATE
command to set the bios_grub flag.
/etc/init.d/rpcidmapd restart not enough. . .
Ok, you started an NFSv4 mount without configuring /etc/idmapd.conf. Now you have the correct domain set in idmapd.conf, you have restarted everything and it still mounts as nobody — grrrrr!

Clear the cache on the client:
    nfsidmap -c
x2go: SQLite issue --- can't create new sessions
In full
  Connection failed DBD::SQLite::db prepare failed: no such table: sessions 
  at /usr/libexec/x2go/x2gosqlitewrapper.pl line 467. Can't call method 
  "execute" on an undefined value at /usr/libexec/x2go/x2gosqlitewrapper.pl line 475
Turns out the session DB, /var/lib/x2go/x2go_sessions got messed up — group write permission had gone and file size was zero. Putting back group write and running
  x2godbadmin --createdb
fixed the issue — and appeared to leave running/in use sessions ok.
Improving Fonts on Debian --- Especially in Chromium
After a Chrome' update, some fonts looked really bad on my (very basic, Windowmaker) Debian desktop. Added
 <match target="font">
  <edit name="autohint" mode="assign">
   <bool>true</bool>
  </edit>
 </match>
</fontconfig>
to /etc/fonts/local.conf and restarted X11. Much better.
NFS/RPC Woes: RHEL v5 --> v6
Just can't get an NFS mount to work on a RHEL v6 client from a RHEL v6 server:
  mount.nfs: requested NFS version or transport protocol is not supported
no matter what (UDP, TCP, v3, v4. . .).

Turns out that the box which is ostensibly v6 still had some v5 packages lying around, including portmap, so we end up with both portmap and rpcbind running — bad.

Eliminate the portmap stuff and all is well.
Root password-free SSHD (in a cluster) won't work, why, why, why?
SSHD configured via sshd_config and .shosts to be password free from management node in a cluster. Works with /usr/sbin/sshd -p 222 but not with "system SSHD", i.e., with /etc/init.d/sshd restart. Why, why, why? /etc/init.d/sshd stop and /usr/sbin/sshd works fine.

Change SELinux from enforcing to permissive and all is fine.
2014 Feb: Issues with NIC running at 100 Mb rather than 1000 Mb
Nothing in OS logs, or on switch logs. Both set to autonegotiate. But
    ethtool eth5    # ...filesystem interface...
showed running at 100 Mb only! Attempting to force this to 1000 Mb (with ethtool).

Amazingly reseating the cat5 cable and then trying to force to 1000 Mb using ethtool worked.

SGE: Jobs randomly killed, why, why, why?
Some users of an SGE-based HPC cluster found some of their jobs randomly dying for no apparent reason. Some users from the same group — that's the clue.
  qconf -sconf

  .    .
  execd_params                 ENABLE_ADDGRP_KILL=true
  .    .
  gid_range                    16000-16100
  .    .
and
  ypcat group | grep jw01-

  .    .
  w01-pain_gwas:!:16009:motmjnn4
  jw01-jia_gwas:!:16006:mdehsjcj,mdeaszam
  jw01-psgwas:!:16016:mdehsjms
  jw01-exome_ae:!:16014:motmgam6
  .    .
Aaaagh! SGE is happily picking on jobs it thinks should be killed and getting the wrong ones. . .
NFS lockups not immediately, but after a bit...
With some older compute nodes in a cluster all NFS (over UDP) was well. With newer, faster(?) nodes, NFS mounted ok, worked ok until worked hard. Then locked up. All the time.

tcpdump showed ip reassembly time exceeded, likely dropped packets. Ok, the switch was an old, slow thing. . .

Solution: reconfig NFS over TCP. (Or replace the switch.)
Java and Batch Systems — Play Fair!
Basically it does a Matlab and tries to grab all the cores.  These
seem to do the trick (seems to work for dt7 and dm2):

 -XX:ParallelGCThreads=1
 -XX:ParallelCMSThreads=1

Add both flags to the call to the java vm thing.

Example:

    /mnt/iusers01/ct01/mbcx6dm2/camino/bin/datasynth

contains

    exec java -XX:ParallelGCThreads=1 -XX:ParallelCMSThreads=1 -Xmx${MAXHEAPSIZE}M -Djava.ut
Arrow keys and page up/down don't work under x2go
Server is RHEL v6.2. And use of setxkbmap fails with Couldn't interpret _XKB_RULES_NAMES type errors. Interestingly
   xprop -root | grep XKB
  _XKB_RULES_NAMES_BACKUP(STRING) = "xorg", "pc101", "us", "", ""
      #  
      # ** missing: _XKB_RULES_NAMES(STRING) = "xorg", "pc105", "gb", "", ""
      #   
Installed xkeyboard-config.noarch and all was well. So, question to RedHat, why the missing basic config?
Get R and SGE Arrays Talking
Here. . .
Treat the inverted-T up/down/left/right manually
 -- use xev to get the key-codes

then, e.g.,

  xmodmap -e 'keycode 104 = Down NoSymbol Down'
  xmodmap -e 'keycode 98 = Up NoSymbol Up'
  xmodmap -e 'keycode 100 = Left NoSymbol Left'
  xmodmap -e 'keycode 102 = Right NoSymbol Right'

  xmodmap -e 'keycode 105 = Next NoSymbol Next'
  xmodmap -e 'keycode 99 = Prior NoSymbol Prior'
      #
      # ...Page Up and Page Down...
      #

  xmodmap -e 'keycode 103 = End NoSymbol End'
  xmodmap -e 'keycode 97 = Home NoSymbol Home'
      #
      # ...end and home...
      #

setxkbmap
  Section "InputClass"
  Identifier"system-setup-keyboard"
  MatchIsKeyboard"on"
  Option"XkbModel""pc105"
  Option"XkbLayout""gb"
  Option"XkbVariant""(null)"
  Option"XkbOptions""terminate:ctrl_alt_bksp,"
  EndSection
  setxkbmap -layout "gb"
Qlogic Infiniband: Can't open /dev/ipath, network down
The hardware all checks out, so what gives? Answer: by default, only one job can use the Qlogic IB stack, with PSM, at a time, so if an old job does not clean up properly, leaves some old processes hanging around which are using /dev/ipath, a new job cannot open it. Solution: kill off the old processes seems to be enough?
Apache mod_evasive logging issues
Mod Evasive blocks DOS attacks just fine, but why no logs?

Turns out that while Apache logs go via Syslog, so /var/log/apache2 is owned by root, Mod Evasive's own logs are written directly, by www-data, or whoever, so don't have the Mod Evasive log dir within /var/log/apache2, have it as /var/log/mod_evasive, owned by www-data, e.g.,
  ls -ld /var/log/apache2-mod-evasive/
  drwxrwx--- 2 www-data www-data 4096 May 21 09:51 /var/log/apache2-mod-evasive/
Key-binding issues on SGEs qrsh
Solved. . .
LVS Latency Issues
Here. . .
NFSv3 and NFSv4 and RHEL and HP ProLiant Weirdness
Here. . .
Bash/SGE/Environment Modules Issue
Harmless error messages:
  "/bin/bash: module: line 1: syntax error: unexpected end of file
   /bin/bash: error importing function definition for `module'"
Eliminate by commenting out a line in /usr/share/Modules/init/bash:
    ##simonh##export -f module
A known bug with SGE and when defining funtions with ENV variables.
RHEL 6.2 and QLogic Infiniband
QLogic IB under SL5.5 (RHEL 5.5) works fine; upgrade to SL6.2 and
R3-Atmos-09.2902Driver initialization failure on /dev/ipath (err=23)
--------------------------------------------------------------------------
PSM was unable to open an endpoint. Please make sure that the network link is
active on the node and the hardware is functioning.
and the equally helpful
R3-Atmos-09.2891ipath_userinit: mmap of rcvhdrq failed: Resource temporarily unavailable
R3-Atmos-09.2895ipath_userinit: mmap of rcvhdrq failed: Resource temporarily unavailable
QLogic's CLI tools, such as fabric_info, show all is well hardware-wise, so what gives?
RHEL 6.2 and HP Proliant Servers
Some HP Proliant servers don't get on at all well with the kernels in RHEL 6.2. But there is a simple solution.
Why don't my cron jobs run?? Where are my cron emails??
On my RedHat boxen, cron emails always turn up. On my Debian boxes, they sometimes don't? Why, why, why?

The answer it turns out is due to a feature/bug in run-parts which Debian and crontab use to run the scripts in /etc/cron.daily, etc. It does not run scripts with a "." in the name!!! This is easy to see by using run-parts with the --test or --verbose option (rather than the --report option). So, for example, do-my-stuff.bash will not run!
GNUPlot cannot find Arial
You have arial.ttf under /usr/share/fonts, but GNUPlot still don't find it! Use
    strace -f gnuplot
and once it starts, enter
    set term png
(you will see all the system calls, etc) to see in what locations GNUPlot is looking. In my case, it looked for /usr/share/fonts/truetype/arial.ttf and variations there of. A s-link was all that was required.
Underpopulating with SGE and OpenMPI
An example:
  #!/bin/bash

  #$ -S /bin/bash
  #$ -cwd
  #$ -pe orte-64bd-ib.pe 1024

  source /etc/profile.d/modules.sh
  module load mpi/open64-4.5.2/openmpi/1.6-ib-amd-bd

  mpirun -np 512 -npernode 32 ./mynameis
SGE daemons and utils
Give commlib errors? (Client resolves to "".) Or the daemons/utils simply hang and do nowt? Look at name/address resolution and firewalls. . .
NX session won't start
Client apparently authenticates ok, downloads session info, desktop/splash screen starts for a fraction of a second and then disappears! Diagnostics:
  • ssh to server with -X
  • start xterm and/or gnome-session manually. . .
. . .except no need: /usr/bin/xauth: error in locking authority file /home/simonh/.Xauthority. So remove .Xauthority and try again. Fine.
2012 Oct 08 — Why can't some compute nodes talk to lfarm*.its.manchester.ac.uk?
 -- turns out lfarm*.its are 10.99 boxen

 -- and Qlogic's install script adds this to the routing tables:
        10.0.0.0      0.0.0.0         255.0.0.0   U         0 0          0 ib0
    Duh!

 -- corrected via

        route add -net 10.22.22.0 netmask 255.255.255.0 dev ib0
        route add -net 10.22.22.0 netmask 255.255.255.0 dev ib0
        route del -net 10.0.0.0 netmask 255.0.0.0 dev ib0

    and

        sed -i  s/NETMASK=255.0.0.0/NETMASK=255.255.255.0/ /etc/sysconfig/network-scripts/ifcfg-ib0
        sed -i  s/NETWORK=10.0.0.0/NETWORK=10.22.22.0/ /etc/sysconfig/network-scripts/ifcfg-ib0
        sed -i  s/BROADCAST=10.255.255.255/BROADCAST=10.22.22.255/ /etc/sysconfig/network-scripts/ifcfg-ib0
Wrong ELF interpreter/runtime linker/dynamic linker
A compilation yields an executable which won't run:
   ./a.out 
  -bash: ./a.out: /lib/ld64.so.1: bad ELF interpreter: No such file or directory
because it is trying to use the wrong ELF interpreter
 readelf -l a.out 
 .    .
      [Requesting program interpreter: /lib/ld64.so.1]
 .    .
So use
    -Wl,--dynamic-linker /lib64/ld-linux-x86-64.so.2
to tell the compiler to tell the linker (ld) to use the correct ELF interpreter.
Disable auto-maximize in Gnome-3
Windows keep auto-maximizing; very irritating. Who asked them to?
  gconf-editor:

      apps --> compiz-1 --> plugins --> grid --> screen0 --> options --> top_edge_action

  set this to 0 (zero)
Persuading CPAN to use only HTTP, not FTP and use an HTTP proxy
  bash> cpan
      # ...start the first time and when prompted enter
      #        http://proxy.domain.thing:port
      #    then...
      #

  cpan> o conf urllist http://ppm.activestate.com/CPAN http://cpan.perl.org

  cpan> install Excel::Writer::XLSX
IPTables insists on printing to the console. . .
. . .not matter what the configuration of rsyslog? For example, with --log-level info and
   kern.warn                                           /dev/console                                                    
IPTables messages should not go to the console? Or --log-prefix "**IPT** blah..."
  :msg, contains, "**IPT**"                             -/var/log/iptables.log                                          
  & ~                                                                                                                   
should do the trick? Not if sysctl -a | grep printk (also cat /proc/sys/kernel/printk) yields
  7  4  1  7
since the first 7 means debug and above (i.e., all kernel messages) will be printed to the console, whatever rsyslog is configured to do. Solution:
  echo 4 > /proc/sys/kernel/printk
  cat /proc/sys/kernel/printk
  4  4  1  7
and all is well.
Print a (PDF) A0 Poster on A4?
Install Imagemagick, then:
  convert big.pdf -crop 4x4@  +repage  +adjoin  big_4x4@_%d.pdf
and print the 16 big_4x4*pdf files. Sadly, you then need a ruler, sharp knife and some sticky-tape. . .
Rescan SCSI/SATA Bus on Linux
 -- added a hotswap disk?
 -- added a disk on a virtual Linux host?
 -- don't want to reboot?

 -- then rescan the SCSI/SATA bus:

    echo "- - -" >/sys/class/scsi_host/host<n>/scan

        ...note the spaces between the dashes...
        ...you may as well rescan all of N=0, 1, 2 as it takes only a second...

 -- then "fdisk -l" will show up the new disk
Debian Backports — why is it preferring the old packages?
 -- because you are an idiot with /etc/apt/preferences

      Package: *
      Pin: release a=stable
      Pin-Priority: 1001

    which means that stable will be preferred over backports *always*, so
    remove or modify the above!
Persuading CPAN to use HTTP Only (Not FTP) and a HTTP Proxy
  bash> cpan
      # ...start the first time and when prompted enter
      #        http://proxy.domain.thing:port
      #    then...
      #
  cpan> o conf urllist http://ppm.activestate.com/CPAN http://cpan.perl.org
  cpan> install ...
Trouble with SGE's Qmon
It appears to try to start for a fraction of a second, then fails with
  X Error of failed request:  BadName (named color or font does not exist)
    Major opcode of failed request:  45 (X_OpenFont)
    Serial number of failed request:  535
    Current serial number in output stream:  546
Solution: install xfonts-75dpi on local machine and restart local X-server (do appropriate re-read of available fonts). There should presumably be font-substitution which is not working.

Update: no need to do a restart, on the local machine simply xset fp+ /usr/share/fonts/X11/75dpi/ or whatever the path is, and then on the remote machine xset -q to check that the path is added! Then start qmon...
DNS Resolution Very Slow Sometimes. . .
. . .in office at work. So add dnsmasq to Debian and Ubuntu boxes.
NX Keyboard Mapping Weirdness
Minimal install of Debian on a remote host running NX server; connect from local NX client: keyboard mapping screwed — arrow keys do not work.

The local key presses are not being mapped correctly by the remote box. Install X on the remote box and restart NX server and all is well.
Avoiding the worst user interface ever (using wget to download Solaris patches)
  wget --http-user="<username>" --http-passwd="<password>" https://updates.oracle.com/patch_cluster/10_x86_Recommended.zip 
Materials Studio SGE Bug. . .
Fixed!
HTC Desire on Orange Portable Wifi Hotspot Problems. . .
Solved!
RedHat, Gedit, "no module named gconf". . .
Lots of python/gconf-related errors when using gedit on RedHat.  Install

  gnome-python2-gconf-2.16.0-1.fc6.x86_64.rpm

and they go away.
SGE Won't Restart!
 -- in $SGE_ROOT/default/spool/qmaster/messages after a failed restart see 

      07/05/2011 16:45:08|  main|redqueen|E|can't find queue "r2-mace-parallel-12.q@R2-27" referenced in job 22959

 -- rm -rf:
     -- job_scripts/22959
     -- jobs/00/0002/2959

 -- restarts ok
Looking at your initrd
  cd tmp
  cp /boot/initrd-<xyz>.gz .
  gunzip  initrd-<xyz>.gz
      # ...don't be fooled:  in some distros there is no ".gz" suffix, you
      #    you may need to "mv initrd-<xyz> initrd-<xyz>.gz" and then gunzip...

  mkdir my-initrd
  cd my-initrd
  cpio -i < ../initrd-<xyz>
  
  # ...then, for example...
  ls -l lib
      # ...to see what kernel modules are included.
Looking at your mbr
  dd if=/dev/sda of=mbr.dump bs=512 count=1

  file mbr.dump

  mbr.bin: x86 boot sector;
  partition 1: ID=0×83, active, starthead 1, startsector 63, 40949622 sectors;
  partition 2: ...
  .
  .
Adding httpproxy to the new talby
  -- add httproxy to /usr/local/sbin/

  -- add httproxy to /etc/services --- port 80 (replacing www)

  -- apt-get install openbsd-inetd

  -- add 
         httpproxy       stream  tcp     nowait.300      root    /usr/local/sbin/httpproxy       /usr/local/sbin/httpproxy
     to /etc/inetd.conf

  -- apt-get install apache2

  -- /etc/apache2/ports.conf:
       ## NameVirtualHost *:80
       ## Listen 80
       NameVirtualHost *:8999
       Listen 0.0.0.0:8999

  -- /etc/apache2/apache2.conf:
         ###########################KeepAlive On
         KeepAlive Off
Using X11 Forwarding after su -
  user> su -
  root> export DISPLAY=localhost:<MN>
      # ...where MN is what "user" had...

  root> export XAUTHORITY=$USER/.Xauthority
      # ...where USER is "user"...
Upgrade Fedora 14 to Fedora 15 Alpha
Preupgrade failed — on reboot install images could not be found. Google suggested that others had same problem. So tried a yum-based upgrade:
http://fedoraproject.org/wiki/YumUpgradeFaq#For_direct_yum_upgrades
Downloaded Firefox v4 Beta onto my Ubuntu Box: ./firefox: no such file or directory
 -- even, ./firefox-bin:  no such file or directory

 -- turned out that the download was 32-bit, the OS is 64-bit and no ia32-libs installed.
Using 32-bit Flash in Firefox on 64-bit Debian
 -- Adobe have removed 64-bit support for the time being
 -- download the 32-bit plugin
 -- apt-get install nspluginwrapper
 -- nspluginwrapper /home/simonh/Downloads/libflashplayer.so
 -- start iceweasel
 -- about:plugsin
Flash in Firefox and Chrome on Ubuntu v10.04
  /usr/lib/chromium-browser/plugins# ls -l
  total 0
  lrwxrwxrwx 1 root root 40 2010-12-22 17:15 libflashplayer.so -> /home/simonh/Downloads/libflashplayer.so
  root@boiler:/usr/lib/chromium-browser/plugins# ls -l /usr/lib/firefox-addons/plugins/
  total 0
  lrwxrwxrwx 1 root root 40 2010-06-27 07:51 libflashplayer.so -> /home/simonh/Downloads/libflashplayer.so
Graphics Corruption on RS690M (Radeon X1200) with Xorg ATI Driver
In /etc/modprobe.d/radeon-kms.conf, does adding
options radeon modeset=0
and reboot fix things? [[https://bugs.launchpad.net/ubuntu/+source/linux/+bug/556782]]
x11vnc on Solaris
here
Making a Scientific Linux Live USB Stick
here
EFI and GPT Muddle with RHEL
here
Upgrading Fedora 11 to Fedora 12 via YUM
here
Copying DVDs via dd
here
TTY Colours
here
Dual Screen, Debian Squeeze and ATI RV516
here
Custom DSDT for Kernel for Packard Bell/Gateway Netbook
here
Perl HTTPD Proxy
Years ago, essentially as a learning exercise, I wrote a HTTP proxy which sits in front of Apache and filters out requests that look mischievous, the blocks the requestor via IPTables. Today it stopped working. But I managed to fix it.
Redhat's Crap Network Init Script
here
Upgrading Fedora 11 to Fedora 12 via Yum
here
2010 Feb 23: Upgrading 64-bit Flash for Iceweasel
The BBC said I needed to upgrade the Flash plugin in Firefox on my Debian box to view the videos. Two issues here. . .
2010 Feb 04: Installing 64-bit Java Plugin for Firefox on Debian
Here
2010 Jan 07: Javascript, Java and Signed Applets
part done
2009 Dec 14: tombox vs gnote(s)
TODO
2009 Dec 14: atop and iotop
TODO
2009 Nov 28: Stratini
TODO
2009 Nov 28: Powertop
TODO
2009 Nov 28: Swiftfox
TODO
2009 Nov 01: Breaking and Fixing Hibernation in Ubuntu
here
2009 Oct: Dual Nvidia Card Troubles on Fedora
here
2009 Oct: Upgraded RHEL 4.x to Fedora 7 (then . . . 11
here
Sept 16:
on debian, openbox won't save config changes with "cannot write /openbox/lxde-rc.xml"; export XDG_CONFIG_HOME=/home/simonh/.config then start openbox
Sept 16: VNC and gnome-terminal fonts
find the dpi on the local desktop via xdpyinfo | grep dots; hack the vncserver script to start Xtightvnc with -dpi <dpi>
Aug 18:
Fortran Scratch Files
Aug 03:
VirtualBox and PulseAudio
July 17:
Archivemount, Tar and CIFS
July 14:
I finally bothered to find out how to make, for example, Ctrl-rightarrow, do what I want it to do in BASH and also Emacs terminal (-nw) sessions. . .
June 23: Adding a Dir of MP3s to XMMS2 with a One-Liner
here
2009 May 22: Fedora 10, Old Dell Optiplex GX270 and Nvidia Cards
here. . .
2009 May 22: Fedora 10 and RPM Fusion
here. . .
2009 May 05: Fedora 10 Installer Bug (Network Config)
here. . .
2009 April 30: Message Bus Hangs and NSS/LDAP
On my Scientific Linux 5.x box, with authentication from a remote LDAP server configured, the thing hangs on boot at the message bus (dbus) start. One can workaround this problem, but it's not clear why it happens in the first place.
2009 April 20: RPM Query Tags
Java Universe jobs have stopped working under Condor on one of my clusters: the configuration has not changed in ages; the Condor daemons have been running for ages. So what has changed? Use RPM querytags to find out!
2009 Mar 16: USB Stick Automouting on RHEL
USB sticks are not automounted on my nice Scientific Linux (RHEL) 5.x desktops. Why not?. . .
2009 Mar 03: Netconsole
Netconsole. . .
2009 Feb 27: CIFS Stuff
CIFS stuff. . .
2009 Feb 06: Condor Config on SMP Machines
On SMP machines, Condor divides the machine up into VMs. A consequence is that if a non-Condor process starts on such a machine, on which two Condor jobs are running, only one Condor job will be suspended. What if we want all Condor jobs suspended?
2009 Jan 22: Nortel Switch Console Access
Why, oh why, don't Nortel wire their switch serial console access the same as CISCO and Netgear (for example)?.
2008 Nov 24: Cross-grading RedHat
here.
2008 Nov 10: LDAP Authentication on Solaris 10
Just been tidying up some Web pages and could not find a better place for this.
2008 Oct 06: Firefox v3, CIFS home-dir and nobrl
Recently I found Firefox v3 fail to, well, do anything other than launch. Poking around in ~/.mozilla I found lots of SQLite-related files with the suffix .corrupt! A quick Google indicated SQLite and CIFS don't like eachother out-of-the-box. The solution is to remount with "nobrl".
2008 Oct 05: SGE's Qmon Fonts
SGE's Qmon seems to choose some old-fashioned fonts which are not available out-of-the-box on some modern Linux distros' X-server. This can result in empty-dotted-rectangle symdrome. The simplest solution: change everything to "fixed".
2008 Sept: IP Tunelling
I have been playing with IP tunnelling, IPIP to be precise. It works very nicely with Condor in place of GCB.
2008 Aug 19: After Patching SSHD on Solaris Won't Forward X11
After patching a Solaris 10 server and rebooting, the SSH daemon will no longer forward X11 connections. Thankfully there is a simple workaround.
2008 Aug 18: Single Clicks are Double with Mouse!
Weird shit: Firefox menus won't open; Web-page drop-down boxes won't drop; then pastes into BASH are double each time — the penny drops. xev confirms that each mouse click is interpretted as two clicks. xorg.conf needs some work . . .
2008 July 28: Detecting USB Kbd/Mouse Movements on Condor on Linux
According to the Condor doc at CS at Uni of Wisconsin, USA, when on Linux, Condor cannot properly detect USB keyboard/mouse activity. There are workarounds. For example in some cases, as pointed out by David McBride of Imperial College, simply add stuff to the CONSOLE_DEVICES macro in the Condor config, viz
    CONSOLE_DEVICES = mouse, console, psaux, input/mice, tty0, tty1, \
        tty2, tty3, tty4, tty5, tty6, tty7, tty8, tty9
  
If that does not work, then simply have a small C programme monitor (for USB input devices) e.g., /dev/input/mice and/or /dev/input/by-id/usb-Dell_Dell_USB_Keyboard-event-kbd and when activity shows, update e.g., /dev/my_condor_activity which CONSOLE_DEVICES lists. Such a C programme can be found via this message in the Condor Users email list archives.
2008 July 27: Building MPICH-1.2.7 on OpenSUSE 10.3
The included RPMs do not include the shared-memory devices. The configure process turns off Fortran support owing to the failure of a test linking Fortran to C libs. Poking through config.log reveals it cannot find libgcc_s.so. This is because MPICH looks under /usr/lib64; SuSE install it under /lib64. ln -s /lib64/libgcc_s.so.1 /usr/lib64/libgcc_so and all is well.
2008 July 22: Adding The Sans TTF to Fedora 9
here
2008 July 07: Putting bitmap fonts (MiscFixed 6x13) back into gnome-terminal
Everyone knows that bitmap fonts are best for X-shells — xterm, gnome-terminal, yet out-of-the box, Gnome does its best to make them unavailable to you in gnome-terminal. Get them back.
2008 July 03: GSI-SSHTerm Features. . .
GSI-SSHTerm promises to take much of the pain out of accessing HPC clusters (for example) in cases where authentication is via X509 certificates. But it can also be infuriating, infuriating. . .
2008 June 05: OpenSuSE and YUM ****-up!
By default on OpenSuSE 10.3, YUM will update installed packages without regard for their architecture; it will replace an x86_64 package with a newer version from i586. This breaks pretty much everything, including RPM! Recovering is not trivial. . . Thanks SuSE.

Looks like others have been caught too.

Apparently Zypper works properly.
2008 May 27: Hacking MPICH-MX Scripts to Work with Condor's Parallel Universe
Condor serves well as a CPU-cycle scavenger and also scheduler of MPICH (and LAM) MPI jobs. However, out of the box, it does not work with MPICH-MX, the Myrinet-specific implementation of MPICH as the mpirun (family of) script(s) is different from that in (plain) MPICH. A certain amount of sleuthing and hacking is required to make it Condor's Parallel Universe play nicely with MPICH-MX. . .
2008 May 15: Backups — rsync and cp -l Versus Apple's Time Machine
A keen Mac user recently evangelised to me on the wonders of Apple's Time Machine backup s/w. I am not convinced. A simple script based on nothing more than rsync and cp -al (-l means use hard links) does the same thing. . .
2008 May 09: OpenSSH 4.8 has chroot functionality built-in
OpenSSH v4.8 now has chroot functionality built-in. This is certainly easier than the previous options: "manually" chrooting the server; using libpam-chroot; or using the ChrootSSH patch. (All three options are described in the Securing Debian Manual.)
2008 April 24: LDAP Search and Apache LDAP Auth
A quick notes on ldapsearch — anonymous and with simple bind — and LDAP-authentication/authorization for Apache-2.
2008 April 24: Solaris Patch Rollback and /var/sadm Diskpace Usage
The Solaris patch/package system saves old versions of files under /var/sadm/pkg/<package>/save so that patches can be rolled back if required. This process can accumulate a lot of diskspace. Saved files for bedded-in patches can be safely removed to recover diskspace.
2008 April 22: Objective-C Developments
Objective-C is Object-Oriented C for those who wish to stay at least slightly sane. Java was strongly influenced by Objective-C. It seems that while I was sleeping Obj-C has gotten gotten exceptions, garbage-collection and more. . .
2008 April 02: Firewall/IPTables Scripts
IPTables configuration which: saves multiple rule-sets (ok, this bit is borrowed from Debian); breaks the rule-set into many distinct chains each of which represents one service and where each such service can be restarted/reconfigured separately and easily; and includes a mechanism of automatically reverting to a previous ruleset (by way of easing the stress levels during remote-admin of firewalls). Details and examples. . .
2008 March 28: Wot, no /dev/loop#?
It may be that these are missing from your Linux box but you want to mount a filesystem image (file). Try modprobe loop.
2008 March 25: Non-working Qsub Scripts and DOS Line Endings
My (SGE) qsub script just won't run — why, why, why?
2008 March 14: Two IP Addresses on one NIC; Routing Appropriate Traffic Through Each
UoM email-routers refuse to relay from *.nw-grid.ac.uk by default (quite reasonably). Options: wait for a router config change or alias a second IP address onto the NIC (from *.manchester.ac.uk) and route all email traffic through that.
2008 March 10: TrueType Fonts on Debian and RCS Template Web Pages
Installation and setup of TrueType fonts on a Debian box, in particular those used in the RCS templates for presentations; construction of a RCS-compliant template for Web-based presentations. Details. . .