Archive | Computing RSS for this section

Flash on Firefox on Debian — one way to update it

This is just what I did. It could be simpler but it’s what I did. It worked.

Firefox is always telling me my Flash installation is outdated and a security risk. I’d rather just not use it, but the computer needs to work with Flash-enabled education-related websites, I have no choice in the matter if important things are going to get done.

So I clicked through the links and ended up on Adobe’s Flash page. I clicked through asking for the .deb file, but apparently this needs some kind of handler for apt-get type installation through the browser which is specific to Ubuntu, a Debian derivative, and I use actual Debian, so no good.

Another time, I selected ‘APT for Debian/Ubuntu’ and got the error message:

“The address wasn’t understood”, and the browser went to

apt:adobe-flashplugin?channel=$distro-partner

So I googled a bit. Unenlightened. Something called pepper exists, but only for Chrome, or maybe there’s a wrapper so it’ll work on Firefox but maybe the wrapper is flaky and… I dunno.

Instead, went to https://get.adobe.com/flashplayer or whatever and downloaded the rpm not the deb (as noted, the apt/deb file is for Ubuntu and would not download — Firefox did not recognise the protocol).

rpm is at:

https://get.adobe.com/flashplayer/download/?installer=FP_27.0_for_Linux_32-bit_(.rpm)_-_NPAPI&sType=7757&standalone=1

Then used alien to make a deb package; it makes no promises but converts between rpm and deb, and Slackware tgz.

sudo apt-get install alien

Went to where the rpm was downloaded and typed:

alien --to-deb --scripts flash-player-npapi-27.0.0.187-release.i386.rpm

Output:

flash-plugin_27.0.0.187-1_i386.deb generated

OK. install the deb file:

$ sudo dpkg -i flash-plugin_27.0.0.187-1_i386.deb
(Reading database ... 228404 files and directories currently installed.)
Preparing to unpack flash-plugin_27.0.0.187-1_i386.deb ...
Unpacking flash-plugin (27.0.0.187-1) over (26.0.0.131-1) ...
Setting up flash-plugin (27.0.0.187-1) ...
Processing triggers for gnome-menus (3.13.3-9) ...
Processing triggers for desktop-file-utils (0.23-1) ...
Processing triggers for mime-support (3.60) ...
Processing triggers for hicolor-icon-theme (0.15-1) ...

Looked very promising, but the plugin did not show up in firefox when I fired it up and went to the address:

about:plugins

I guessed I might have to manually tell firefox where the new library lives. Where was it installed to? Can look at the file tree in the .deb file:

dpkg-deb -c flash-plugin_27.0.0.187-1_i386.deb

Ah-ha. It’s in

usr/lib/flash-plugin/libflashplayer.so

So fired up firefox again and…tried to use the Add-ons menu to manually add the file.

about:addons then click the gearwheel and ‘Install Add-on from file’

Navigated to where the so file was, but was not recognised as an Add-on.

Firefox told me it was corrupt.

OK. In my ignorance and the knowledge that I am documenting what I do so it can always be undone, this led me to look at the about:plugins firefox screen, which told it was getting the .so file from:

Path: /usr/lib/mozilla/plugins/libflashplayer.so

Also took a look at usr/share/doc/flash-plugin-26.0.0.131/readme.txt

So after closing down firefox and backing up the older version of libflashplayer.so, I just copied the one from usr/lib/flash-plugin/ to /usr/lib/mozilla/plugins

$ sudo cp /usr/lib/flash-plugin/libflashplayer.so /usr/lib/mozilla/plugins/

On firing up firefox and going to about:plugins, I got this:

Shockwave Flash

    File: libflashplayer.so
    Path: /usr/lib/mozilla/plugins/libflashplayer.so
    Version: 27.0.0.187
    State: Enabled
    Shockwave Flash 27.0 r0

Which is indeed the version number of the current Flash, and lo and behold firefox stopped telling me I need to update Flash and Flash-enabled pages are working.

Long story short, I suspect I could have just exploded the rpm, fond the .so file and stuffed it into the correct directory, rather than messed around with alien. But things are working and that’ll do until next time the plugin is deemed outdated and firefox starts complaining again. I already had any config files from the automagically installed previous version(s), too. If it was a clean install, just copying the .so to the mozilla/plugins/ directory would probably not work — there’s other stuff in /usr. Maybe it’s put in the correct place by the dpkg install of the alien-made package, but I do not really know.

But it works.

Advertisements

Weird Windows errors: Windows\system32\config\systemprofile\Desktop

Note to self:

Windows\system32\config\systemprofile\Desktop is unavailable it might have been moved or deleted.

or

“Windows\system32\config\systemprofile\Desktop” refers to a location that is unavailable It could be on a hard drive on this computer, or on a network. Check to make sure that the disk is properly inserted, or that you are connected to the Internet or your network, and then try again. If it still cannot be located, the information might have been moved to a different location

Oh crap. Windows cannot find your personal information. It’s like everything in AppData is missing. The desktop is empty and a message like that above keeps cropping up when you try to do anything much.

https://appuals.com/fix-system32configsystemprofiledesktop-refers-to-a-location-that-is-unavailable/ is where you need to go. But I am making this posting because there may be extra complexities. We have a situation where the login name of an account was changed, so, for example, the login might be ‘Kids’ but the actual desktop is stored in C:\Users\Dad\Desktop because the account was repurposed.

If you go to the link above, it offers some advice:

Solution 2: Reset Desktop’s Location

In Explorer, navigate to

C:\Users

Open the folder with the relevant username and right click on Desktop. and then select Properties. Select Location and then ‘Restore Default’ then OK and reboot.

Now, when I did this, the error message went away — yay — but the applications could not find the personal, local stuff stored in AppData — logins, local resources for Minecraft, all that malarkey. I think it is because the username and the folder name are not the same. That’s my theory, anyway. So I went to method 3 — registry editing…:

In the Run box of the Start menu (or after pressing Win Key + R) type regedit and press enter. May need to say ‘Yes, I know this is admin task’.

Here are the verbatim instructions:

In the left pane, click on HKEY_CURRENT_USER to expand it. 
Now click on Software under it. 
Similarly navigate to Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders.

Make sure User Shell Folders is highlighted and in the left pane, then double click Desktop. 
Make sure under Value data: the value is either %USERPROFILE%\Desktop or C:\Users\%USERNAME%\Desktop is the value. 
Click OK. 
Close the registry editor. 
And restart your system, and check if your problem is fixed.
Now, all the relevant fields on the computer in question were of the format %USERPROFILE%\Desktop. So instead I changed the relevant ‘Desktop’ key (and only that one) to the second format, C:\Users\%USERNAME%\Desktop

And that seemed to work. I don’t know what the kid did to the machine to cause the problem, of if it was just bad luck, but the inconsistent naming I suspect made things worse.

If it works for you, thank the original poster.

Et seq.

Accidental/coincidental fix of ethernet socket

The lights were out; those little LEDs that flash on the back of the computer when the Ethernet cable is plugged in. Dead. No internet. Could plug the cable into a different machine and it worked, but my main desktop could not even see the router.

Hmm…

Worse, I was working at home and needed to upload a day’s work to the server and it needed to be that day because it had to go to a client.

Hmm…

I tried rebooting, wiggling cables, jiggling the connections between the socket and the motherboard (it’s the built-in port, so attached directly to the MB). No good. Despite previous tests, rebooted router. No good.

In the end I copied the file onto USB and uploaded from the other computer. Then I turned the desktop off and left it for a few hours. Turned it back on.

Nothing.

Then I pulled out the Ethernet cable and the power plug. No standby power, nothing. Left it for a day.

Now it is working again.

Don’t know why; not complaining.

Random acts of something.

$$ math $$ versus \[ math \] in LaTeX

Let’s say you want to display some maths in LaTeX. You don’t want to use equation and related environments.

Inline maths is enclosed between dollar signs, and is formatted as part of the sentence.

A displayed equation is enclosed between pairs of dollars or between \[ and \]. But $$ … $$ and \[ … \] are not the same. For one thing, \[ … \] responds to the documentclass option fleqn to align the equations to the left rather than center them. Thus, we get this:

Where ‘Inline’ is indented because it starts a paragraph. First two displayed equations use $$ … $$ and are centred, the last uses \[ … \] and is indented by a length called mathindent.

Here is the LaTeX code

\documentclass[fleqn]{article}
\begin{document}
Inline maths: a simple equation might be $x+y=1$.
The solutions to the quadratic equation
$$ax^2 + bx + c = 0$$
are given by
$$x=\frac{-b \pm \sqrt{b^2-4ac}}{2a},$$
which is to say
\[x=\frac{-b \pm \sqrt{b^2-4ac}}{2a}.\]
\end{document}

Notice the argument ‘fleqn’ has been given to the article class, but $$ … $$ did not obey it. \[ … \] did, but not all the way to the left. If you want the left aligned maths to be hard left, you need to redefine mathindent to be zero length:

\setlength{\mathindent}{0pt}

and this gives

Anyway.

 

Comparing PDFs; diff-pdf, pdftotext, diff…

Command line tool diff-pdf at https://vslavik.github.io/diff-pdf/ is a very handy tool. It basically superimposes two PDFs to make the differences show up. It’s not a textual comparison as such. Here is the command line:

$ diff-pdf --view test.pdf test_mod.pdf

The black bits are common to both files, the red is in one version and the cyan in another. If the differences result in new lines being inserted, the whole page turns blue/red, since the lines don’t match up any longer:

So it is a very good way of isolating minor changes (say, between consecutive proofs of the same document) and checking if two files are actually identical (though conventional diff can indicate whether two binary files differ or not). It’s less good for comparing and decided which version is ‘better’ since the result can look a bit messy.

Using conventional diff:

$ diff test.pdf test_mod.pdf
Binary files test.pdf and test_mod.pdf differ

Use of pdftotext on both PDFs, then using conventional diff is pretty useful, too. Here is the output from just such a test:

$ pdftotext.exe test.pdf
$ pdftotext.exe test_mod.pdf
$ diff test.txt test_mod.txt

1,3c1,5
< This is a very basic look at using METAFONT and gnuplot to make figures
< for use in LATEX. I am using Linux, but the same process ought to work for
< other LATEX environments; indeed, that ought to be one of its strengths. --- > This is an extremely basic look at using METAFONT and gnuplot to make
> figures for use in LATEX. I am using Cygwin, but the same process ought to work
> for other LATEX environments; indeed, that ought to be one of its strengths.
> Here is some text added to make the line wrap and offset compared to the other
> document.
36c38
< see. --- > see. Also, this document is really just to show use of diff-pdf.
42d43
< 5. If you like at this point you can try:
45c46,47
< $ gftodvi test2.600gf --- >
  5. If you like at this point you can try:
> $ gftodvi test2.600gf
78a81,84
1
> 2
>
>
  Figure 1: Here is my pointless plot.
83,85d88
< 2
<
<
  Figure 1: Here is my pointless plot.

No conclusion. Just noting that these tools are handy.

Ende.

Plotly on cygwin; the absolute basics

This has to be about the absolute basics. I don’t know anything else.

Plotly (https://plot.ly/) is an interactive, online graphing tool. It can be called from JavaScript, Python, whatever. This post is about getting it to work through Python on Cygwin.

This all mostly follows instructions on the Plotly website.

(1) Installed via pip. What’s pip? A Python package manager. I ran the Cygwin setup.exe program and made sure that Puython was installed (in my case it was 2.7) and then installed the matching pip2.7 (Cygwin package python2-pip). So installed that and all its dependencies.

(2) Opened a Cygwin terminal (not an X terminal, just mintty) and typed:

$ pip install plotly

and watched some magic occur.

(3) Went to the Plotly website and created my (free) account. Went to my account settings and selected ‘API keys’. Could not see key — just looked like a row of dots! But hitting ‘Regenerate key’ gave me a new, visible one. Copied that text and noted my username.

(4) In Cygwin, (note, $ is the Cygwin prompt, >>> is the python prompt) typed:

$ python
Python 2.7.13 (default, Mar 13 2017, 20:56:15)
[GCC 5.4.0] on Cygwin

>>> import plotly
>>> plotly.tools.set_credentials_file(username='DarrenG2', api_key='<<insert your key here>>')

quit()

This set up the info needed for the local Plotly/Python installation to talk to the website where the graph will appear.

(5) Checked that this had worked out. Back at Cygwin prompt, in home directory, typed:

$ cat .plotly/.credentials
{
    "username": "DarrenG2",
    "stream_ids": [],
    "api_key": "<<your key here>>",
    "proxy_username": "",
    "proxy_password": ""
}

(6) OK, looked good. Now, tested it by grabbing an example from the Plotly website. Created a file ‘plotly_example.py’ and pasted in some text copied from the website:

import plotly.plotly as py	
from plotly.graph_objs import *

trace0 = Scatter(
    x=[1, 2, 3, 4],
    y=[10, 15, 13, 17]
)
trace1 = Scatter(
    x=[1, 2, 3, 4],
    y=[16, 5, 11, 9]
)
data = Data([trace0, trace1])

py.plot(data, filename = 'basic-line')

(7) Then saved and ran the script

$ python2.7.exe plotly_example.py
High five! You successfuly sent some data to your account on plotly. View your plot in your browser at https://plot.ly/~DarrenG2/0 or inside your plot.ly account where it is named 'basic-line'

Looked good, though they’ve spelled ‘successfully’ unsuccessfully.

(8) But where was the graph? Well, I was working in a basic terminal window. It sent the graph to the web, but then tried to open it using the default links, the text browser. So all I got was a blank screen (typed ‘q’ to quit links). There are a couple of options to see the graph — one is just to paste the given URL into Edge, Chrome, Firefox. Another is to tell Cygwin to look elsewhere for its browser…

(9) Edited my .bash_profile file in my Cygwin home directory and added these two lines:

$ BROWSER=/cygdrive/c/Users/darren/AppData/Local/Mozilla\ Firefox/firefox.exe
$ export BROWSER

This set up the environment variable BROWSER and pointed it at the firefox.exe file (non-admin install, so in an unusual place). I also ran these two lines in the terminal window to save me closing and reopening it.

(10) Repeated step (7) and — lo and behold! — a Firefox window popped up and the graph was in it!

Plotly graph in Firefox, after running the script in Cygwin.

Plotly graph in Firefox, after running the script in Cygwin.

Now, mastery of Plotly and Python is a much bigger project, but at least this offers the beginnings. Note also that the graph can be edited interactively within the webpage where it appears.

 

Plots away!

 

Ghostscript and GSview without administrator privileges

First, the downloads. GhostScript from: https://ghostscript.com/download/

I downloaded gs921w64.exe, and double clicked, but Win 10 wanted admin credentials to run the installer. I changed extension to zip and double clicked. Extracted contents to

C:\Users\usename\install\gs

Then the viewer, GSview. To: http://pages.cs.wisc.edu/~ghost/gsview/index.htm

Again, install wanted admin rights, even when I did not specify C:\Program Files.

Again, renamed to zip, and unzipped into

C:\Users\usename\install\gsviewtemp

Then went in there and double-clicked setup.exe

Created and then set install directory to be

C:\Users\usename\install\gsview

Unclicked ‘for all users’ since no admin rights. Ran installer; it did stuff, but said something failed. Still, tried to run gsview64.exe itself (found it in the install folder and clicked on the exe file); it started but said it cannot find ghostscript; ok need to set some variables/config stuff.

So, GSview was running, but crippled. Went into its menus.

Selected ‘Option’ → ‘Advanced configure’ and put in the correct locations for ghostscript lib and dll. For ‘Ghostscript DLL’:

C:\Users\username\installs\gs\bin\gsdll64.dll

For ‘Ghostscript include Path’:

C:\Users\username\installs\gs\lib;C:\Users\username\installs\gsview\Ghostgum\fonts

(The fonts folder was not there; I just created it where GSview expected it. It’s empty.) Closed then reopened gsview64.exe; it opened without error messages. Opened a test file… (examples inside gs folder). Yep. OK, try printing to some writer… only found 3 devices… pdfwrite, mswinpr2 and djet500… where are others? Won’t worry for now.

Oh well, seems usable.

Added the ghostscript binary (bin) directory to my local user path. (See for example here for local path.) Might be useful to add the gs lib to the path as well. The lib folder is where a lot of the batch files (command line tools) live. Didn’t find any pfb files after the install (maybe that was the error the installer threw?)  so added the path to the type1 fonts in my MikTeX installation. Can’t hurt, probably won’t help.

Added the path to the GSview binary to my path as well, just so I can use it from the command line more easily.

Anyway, seems to work nicely.

Standard example file from Ghostscript, viewed using GSview installed without administrator rights on Windows 10.

Standard example file from Ghostscript, viewed using GSview installed without administrator rights on Windows 10.

Natch.

Search insde Word, PDF, XML and other files—installing and using crgrep

I am an editor in a business that uses Micro$oft products, but I want to be able to use the Linux CLI tools with which I am moderately familiar. In particular, I want to be able to grep Word documents, and that’s a problem because the new Word file format chops the text up and zips it up and hides it away. I googled and read a bit about crgrep (‘common resource grep’). Here is my experience so far.

Downloaded from

https://bitbucket.org/cryanfuse/crgrep

or

https://sourceforge.net/projects/crgrep/

Created a subdirectory c:\Users\username\installs\crgrep and downloaded the zip file into it. Worked in Cygwin, hence the forward slashes and dollar signs in the following. This could also be done through the GUI or in a PowerShell or CMD window. Choice is a wonderful thing.

$ unzip crgrep-1.0.5.zip
$ cd crgrep-1.0.5/
$ vim INSTALL.txt

OK, so it needs java. Does it need the compiler (probably not, but check…). In the crgrep folder, typed:

$ grep -ir javac

Returned no results calling the javac compiler. So it looks like the program needs the runtime but not the development kit (JDK), so that’s good. It’s what you’d expect. Now, I have the wonderful ImageJ installed (works effortlessly in userspace), and it installs the Java runtime environment, JRE. Maybe I can use that.

Now, according to the INSTALL.txt file, the JAVA_HOME variable that crgrep wants points at something like

JAVA_HOME=C:\Program Files\Java\jdk1.8.0_xx

and my grepping told me that java.exe should be in %JAVA_HOME%\bin\java.exe

In Cygwin, my ImageJ tree looks like:

/cygdrive/c/Users/username/installs/ij/ImageJ/jre/bin

Which meant I needed to set JAVA_HOME to be C:\Users\username\installs\ij\ImageJ\jre (Windows-style path) (that is, the variable points the directory with the bin directory inside it, not the bin directory or the binary file itself.)

But first checked the version — needs 1.8.

$ cd ../../ij/ImageJ/jre/bin/

$ ./java.exe -version
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)

OK.

I installed in userspace (work computer, no root/admin access), so I went to my Windows account settings (given the various versions of Windows, I’ll assume a user can find their own account setting page) and (for Win 10; Win 7 is no doubt different) in the ‘Find a Setting’ box I typed ‘env’ for ‘environment variables’, and chose ‘edit the variables for your account’. Note that searching for ‘path’ turns up nothing. It’s a little trick!

Added an entry to the path:

(Path → Edit → New)

c:\Users\username\installs\crgrep\crgrep-1.0.5\bin

and created a new environment variable:

JAVA_HOME=C:\Users\username\installs\ij\ImageJ\jre

And exited everything, esp. the command line window, then opened it again, typed SET in a CMD (‘DOS’) window to see if the new variables were present, then tried the command:

H:>crgrep --help
usage: crgrep [options]  []
crgrep: Common Resource Grep.
 -a,--text               Process binary files or database columns as if
                         they were text
    --color        Alias for 'colour'.
    --colour       Colour-highlight matched text ('always', 'auto'
                         or 'never'). Default colour is red, see USAGE.txt
                         for other colour settings.
 -d,--database           Database grep (disables file search)
 -h,--help               Help
 -i,--ignore-case        Ignore case distinctions in matched text
 -l,--list               List resources which produce a match by name. No
                         content is searched.
 -m,--maven              Include Maven POM file dependencies in search
    --mood    Only include matching content expressing a
                         specific sentiment; values include 'positive',
                         'negative' or 'neutral'. Ignored if -l specified.
                         Requires model data; see INSTALL.txt
    --ocr                Enable OCR text extraction from images; requires
                         tesseract libraries. See INSTALL.txt
 -p,--password      Password required to access a resource,
                         optionally used with -u
 -P,--proxy         Proxy settings for http access, specified as
                         [:]
 -r,--recurse            Recursive search into resources
 -u,--user          User ID or username required to access a resource
 -U,--uri           URI to specify a JDBC database resource
 -V,--version            Print the version number of CRGREP to the
                         standard output stream
    --warn               Display all warnings to standard output
 -X,--extensions    Enable one or more extensions; comma sep. list
                         such as -Xdebug,trace
If  is not specified, or is '-', read from stdin
Please report issues at https://bitbucket.org/cryanfuse/crgrep/issues

OK, promising.

I want it for grepping Word files, so let’s see… yes, it finds ‘data’ in the test file, and outputs a nice clean stream:

H:>crgrep data text.docx
text.docx:T:A key part of his research was the analysis of large
datasets. As part of this he developed a software suite that included
data modelling, reduction and correction techniques, and made of use the
National Computing Infrastructure and other supercomputers. He enjoys
the challenge of analysing and explaining complex data using words and
carefully designed graphics. He likes Linux and the LATEXtypesetting
system.

How about PDF? Converted the Word doc to PDF using the ‘Save as’ dialogue in Word. Then…

H:\>crgrep data text.pdf
text.pdf:1:36:datasets. As part of this he developed a software suite
text.pdf:1:37:that included data modelling, reduction and correction
text.pdf:1:40:challenge of analysing and explaining complex data using

Different output because of how PDF and Word chop up the text, but instances found in both cases. No need to specify a file type or anything. I have not explored the command line options, but I am already finding the program useful — for example, when I want to find multiple instances of multiple expressions (say acronyms or references) in multifile projects.

Kudos.

Just grepping around.

ReactOS on VirtualBox: No need for step-by-step instructions

This is so simple there’s no need for step-by-step instructions, but I kept notes so I might as well post them.

ReactOS 4.5 on VirtualBox 4.3.x on Debian 8.x. Not on VB5.1 because the older versions are what the Debian repo provides.

(1) Installed VirtualBox;

$ apt-get install virtualbox dkms 

Host is 32 bit Debian 8.4 Netbook with 1 GB RAM and 250 GB HD. Low spec! (Atom N550)

(2) http://www.reactos.org/download and downloaded both disk images; starting with iso rather than LiveCD. Apparently should be able to use guest additions from Win 32 bit, 2003-era. Unzipped the images.

(3) Ran VB; selected ‘New’.

(a) Put in details — Name, Windows, 32 bit 2003.



(b) 512 MB RAM (default in this case)

(c) 20 GB HD.

(d) VDI format is fine.

(e) Dynamic is fine.

(4) System. Enabled PAE/NX.

(5) Storage — put the Reactos ISO in the virtual drive.

(6) Boot.

(7) Let install run:

(a) Chose language

(b) Pressed enter a bunch of times. I chose to do a full format not a ‘quick’ one.

(c) Waited… … … … … …

(d) Chose default to put OS in C:\ReactOS

(e) Chose default bootloader installation.

(8) Removed cd rom image from virtual drive. (Devices menu).

(9) Rebooted.

(a) Watched as it interrogated the hardware and installed some devices.

(b) Clicked through setup. Admin password.

(10) Rebooted again.

(11) It wanted to install a driver but could not. Oh well.

(12) Devices menu of VB — inserted guest addtions.

(a) Opened explorer in guest and double clicked on additions x86 exe file in the cdrom directory.

(b) Default install.

(c) Rebooted.

(13) Shared folders…

(a) Created a folder on Linux host. Made sure users had read/write permissions.

(b) In VB manager, added that folder in Share Folders menu. Did not click auto mount.

(c) Booted VM.

(d) Double-clicked ‘My netowrk places’ on the ReactOS desktop and there it was, called \\VBOXSVR\vbshare.

(e) In a terminal, needed to assign the folder a drive letter.

(f) Opened command prompt on guest and typed

C:\ net use x: \\VBOXSVR\vbshare

(g) Typed x:

(h) Typed X:\ notepad textfile.txt.

(i) Typed some crap. yep, it’s there.

(j) Looked for the file on host system. Modified it.

(k) Saw modifications in guest and host. OK, that works.

(l) I’m not going to bother automating it, I’ll just put a readme on the ReactoS desktop.

(14) Done, as far as I can see. Looks pretty good.

Having said that, all the applications I wanted to be able to run can run on wine.

Still, seems to work.

Wine.

CAPS LOCK disable on Windows without admin rights

Lots of sites tell you how to disable/remap CapsLock. But what if you don’t have administrator rights? Most of them tell you to pry off the key. Well, instead, I went to:

https://dropline.net/2009/05/mapping-caps-lock-to-control-without-admin-access/

Here is an extract, which I put here just in case the original site vanishes, as sites sometimes do:

There’s a duplicate of the keyboard mapping registry key under HKEY_CURRENT_USER, which non-administrators can modify, and it appears to behave exactly like the key under HKEY_LOCAL_MACHINE.  So, for anyone in a similar position, here’s the registry key to modify:

HKEY_CURRENT_USER→Keyboard Layout→Scancode Map =
hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00

You can download a registry update file here.  Save it to your computer, double-click it to update your registry, then reboot and enjoy your vastly-improved keyboard.

Here is a screengrab of the .reg file:

capslock

Worked a treat on Windows 7, but it did not work on Windows 10.

Hmm…Code for conversion of CapsLock to Shift is:

00,00,00,00,00,00,00,00,02,00,00,00,2a,00,3a,00,00,00,00,00

(http://johnhaller.com/useful-stuff/disable-caps-lock)

Codes explained here:

https://www.experts-exchange.com/articles/2155/Keyboard-Remapping-CAPSLOCK-to-Ctrl-and-Beyond.html

But why it does not work in Windows 10 I don’t know. I did try it on a work desktop machine (that’s why I don’t have admin rights, ‘cos it’s a work machine), so perhaps it downloads registry files on logging in? Does that make any sense?

Right now I don’t care enough to find out, but I’ll look into it at some point in the future.

 

So there.