Author: Jamie Scott
Testing self-pings
Link to previous entry…
Link to older entry.
Lenovo laptops freezing issues – WiDi driver
Had a new X240 that gave lots of problems when going to sleep. A factory restore sorted some of the issues, but not all – the system would bluescreen on entering sleep mode. Uninstalling the Intel WiDi software seemed to fix it, and also let the wifi work properly on a home router.
RAID Monitoring: PERC H710 Mini and Debian
Debian 7 works with the PERC H710 Mini in a Dell R520 out of the box. To monitor this however you need a binary from LSI. Helpfully, this comes in a packaged form from http://hwraid.le-vert.net/wiki/DebianPackages
http://blog.mattandanne.org/2012/01/hardware-raid-controllersrequire.html pointed me in the right direction. To install, add the repo in a .list file:
deb http://hwraid.le-vert.net/debian wheezy main
and then add the key:
wget -O - http://hwraid.le-vert.net/debian/hwraid.le-vert.net.gpg.key | apt-key add -
Update the repository lists, and then install the relevant package:
apt-get install megaclisas-status
Running megaclisas-status should then give the status of the array(s). The script is set up by default to email root every two hours if there is a problem. These defaults can be overridden using a defaults file:
/etc/default/megaclisas-statusd
You need to create this if necessary. The defaults are:
MAILTO=root # Where to report problems PERIOD=600 # Seconds between each check (default 10 minutes) REMIND=7200 # Seconds between each reminder (default 2 hours) RUN_DAEMON=yes
(can be found in)
/etc/init.d/megaclisas-statusd
If you have the system set up to divert root email to you then it should just work.
PERC H710 Mini virtual disk setup size problems
Interesting little wrinkle setting up a RAID5 on 4x4Tb drives in a Dell PowerEdge R520 with a PERC H710 mini controller. Using the fancy integrated interface (F11) the first VD of 20 Gb is fine, but the second only allows just under 1Tb to be used!
Using the basic bios extension thingy (Ctrl-R) it works fine. Also, somewhat faster…
Test attachments
Installation and configuration of EAGLE 7 licencing server
File download
The links on the cadsoft page were broken when I did this. The licencing setup files were found at:
ftp://ftp.cadsoft.de/eagle/licensing/7.0.0/
The later version directories only contain the lichostid files (also included in the full install). You do need this for the hostid – it doesn’t just work off the MAC address!
Install (Windows)
Put the unzipped file tree somewhere convenient – on Shuna it’s just stuck in C:
To install the server as a service, use the command line switch:
lmadmin -installservice "EAGLE flexlm"
or whatever you want the service to be called. You have to dig deep into the pdf documentation to find that one!
Log into the web interface
http://licencehost:8090
Login with default credentials (admin:admin) and change the password
Licence file
As per documentation – Administration > Vendor Daemon Configuration > Import License. This should import the file which points to the vendor daemon in the file tree.
Client configuration
Choose multi-user licence. Server is
shuna.physics.gla.ac.uk
and we’re currently using the default port (21111)
A nice way of configuring linux system-wide login notifications using PAM
There are several ways to have a linux box email you when someone logs in to it. Most of these use a script in either the local profile files (for individual users) or the system-wide profile (and/or in sshrc). Another nice way is to use the pam authentication system to do the job. A setup is given at:
http://blog.stalkr.net/2010/11/login-notifications-pamexec-scripting.html
Brief setup
Assuming Debian here.
Make sure the system is set up to talk to an email server and has some way of sending emails from the command line. The script here assumes the mailx package is installed.
Quick test:
echo "test" | mail -s "test" user@example.com
Create a script somewhere sensible (e.g. /usr/local/bin) and make it executable.
#!/bin/sh [ "$PAM_TYPE" = "open_session" ] || exit 0 { echo "User: $PAM_USER" echo "Ruser: $PAM_RUSER" echo "Rhost: $PAM_RHOST" echo "Service: $PAM_SERVICE" echo "TTY: $PAM_TTY" echo "Date: `date`" echo "Server: `uname -a`" } | mail -s "`hostname -s` $PAM_SERVICE login: $PAM_USER" user@example.com
replacing user@example.com with the required email address. Note that you could send the email to root or another local account if you have that aliased to an external address.
edit /etc/pam.d/common-session to add at the end:
session optional pam_exec.so /usr/local/bin/login_notify
and test it by logging in with an ssh session (terminal or winscp etc.)
Sudo uses common-session-noninteractive – not sure whether it would be best to put this in /etc/pam.d/sudo as well…
Wireless problems with Ubuntu 13.10 and self-signed certificates
Ubuntu 13.10 (and possibly 13.04) seem to have a problem with self-signed certificates when authenticating to wireless radius servers (i.e. the GUPHYSICS wifi). This is discussed in a variety of places:
https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1104476
The problem seems to be that the Network Manager setup is adding the line:
system-ca-certs=true
to
/etc/NetworkManager/system-connections/GUPHYSICS
even if you tick ignore when the system asks about certs the first time. Changing the value of the setting to false seems to fix this, although there is a possibility that it might get changed back by NM. (or delete the setting entirely, which seems to have happened on this laptop. Hmmm)
There is apparently a bugfix in place and rolled out to other distributions, but Ubuntu doesn’t have it yet…
Another way to fix this would be to get the certificate (probably in .pem format) and point the settings to it.
How the php array_multisort function works
The array_multisort function in php allows you to sort several arrays at the same time. How it works is:
- Sort first array by key value (depending on arguments)
- If there are any identical keys in the first array, sort these by the keys in the second array (assuming it is specified)
- etc.
The documentation for this isn’t particularly clear.