Note to self
- Booted Win 10 machine.
- Got usual login screen.
- Logged in as per usual.
- Got a black screen with a working, visible mouse pointer.
- Got the menu and chose Task Manager.
- Went to start up items and disabled most items, but enabled ‘Lenovo Utility’.
- Used Ctrl-Alt-Del to reboot.
- Got the screen back.
Of course, I’ve skipped all the messing around that I really did.
I don’t know why. Other non-admin account on the machine worked fine, so something funny happened in a setting somewhere. Anyway, there you go.
The whole world of ’tilde’ accounts is to give you a little server space where you can monkey around in bash and maybe build a website the 1990s way — by editing HTML in nano, emacs or vim.
Mine is here: https://tilde.club/~mz721/, and this is how it looked as-provided by the admin:
I have set it up so that if I scp files into the right directory, they will be automatically added to the index.html.
Consider the following bash script. I log into my account and run it from ~/public_html using nohup so that it does not stop when I log out. The makelinks.sh script lives in the ~/public_html/pages directory and just creates a block of HTML with links to each of the HTML files it finds in there.
The script then creates a little file with the time and date updated information in it, then cats all the bits together, then sleeps for a day and runs again. My scripting is very crude, but seems to work.
while true do cd pages ./makelinks.sh cd .. echo \<p\> \</p\> > date echo \<p\> \</p\> >> date echo Last updated: `date` >> date cat index.top.html pages/index.middle.html date index.tail.html > index.html rm date sleep 24h done
Here is the text of makelinks.sh. It loops over all the .html files in the directory. The echo command prints out a line of the form of a basic HTML link. It grabs the second line of the html file for use as the link text (that is what the head/tail bit does) then creates the link.
rm index.middle.html for f in *.html do echo \<p\>\<a href=\"pages/$f\"\>$(head -2 $f | tail -1)\</a\>\</p\> >> index.middle.html done
The output of makelinks.sh looks something like
$ cat pages/index.middle.html <p><a href="pages/hermes10.html">The Hermes 10 electric typewriter</a></p>
So all I have to do is make sure I upload a HTML file (with its dependencies) that looks something like the one below. Top 3 lines are:
- open comment
- link text
- close comment.
After that, any legit HTML should do.
<!-- Link text - always here. --> <html><head> <title>Title</title> </head> <center> <h1>Main heading</h1> </center> Content </body></html>
So I make up my new page locally, with the correct 3-line header, then scp it to the correct folder, and the script wakes up once a day and adds the page to the index.
Crude, but effective. Obviously, I can complexify what I do and add more features, but I’ll let that evolve with time.
Here’s a random example for no good reason.
Here is the gnuplot script (surfaceplot.gp):
set iso 30 set samp 50 unset key #set title "sin(r)" set xlabel "x" font "Times:Italic,14" set ylabel "y" font "Times:Italic,14" set zlabel "z" font "Times:Italic,14" set xrange [-4:4] set yrange [-4:4] set xtics offset -0.5,-0.5 set ztics 1 unset surf set style line 1 lt 4 lw 0.5 set pm3d set term post level1 color font "Times,12" fontscale 1.0 set output "plotfile.eps" splot sin(sqrt(x**2+y**2))
Here are the commands run at the command line:
$ gnuplot surfaceplot.gp $ epspdf plotfile.eps $ xpdf plotfile.pdf $ pdftoppm.exe -r 600 plotfile.pdf > plotfile.ppm $ convert plotfile.ppm plotfile.png $ display plotfile.png $ rm plotfile.ppm
And this gives me an eps, a pdf and a png:
89K plotfile.eps 56K plotfile.pdf 990K plotfile.png
And here’s a simple script to plot sections through the surface:
$ cat cuts.gp unset key #set title "sin(r)" set xlabel "x" font "Times:Italic,18" set ylabel "z" font "Times:Italic,18" set xrange [-4:4] set yrange [-1:1] set border lw 0.25 #set style line 1 lt 4 lw 0.5 set term post level1 color font "Times,12" fontscale 1.0 set output "plotfile-cut-y=0.eps" plot sin(sqrt(x**2+0**2)) lc rgb 'black' lw 4 set output "plotfile-cut-y=1.eps" plot sin(sqrt(x**2+1**2)) lc rgb 'black' lw 4
And here is plotfile-cut-y=1
Soooo….. I typed a bunch of hyphens then hit Enter, and Word drew me a line. Fine, I wanted that. It separated what was done from what was ‘in process’. Now I want to get rid of the line.
Highlight and delete — no.
Highlight and use the border menu to choose none — no! I tried this suggestion, but without success.
I could move the line up and down, but I could not delete it. But then I could!
At this point, we can undo the line if we want to by clicking on the menu icon that comes up when Word automatically creates the line, and we could select Undo Border Line, Stop Automatically Creating Border Lines or Control AutoFormat Options. So at this point it is easy to remove the line.
But let’s say we want to keep the line for now and delete it later. We go on, typing some more text below the line. The autoformat menu icon disappears and does not come back.
Now, how can we get rid of the line? First, highlight it by keyboard or cursor.
Now, type Ctrl+Shift+n — the line goes away! Now, this is Word key binding for ‘Apply the Normal style’, which means you can get the same result by using the Styles pane or clicking Normal on the styles ribbon on the Home tab.
If the Normal style does not work, you can also try the ‘Clear All’ option at the top of the Styles pane.
Rainbowstream lets you read, post to, search and almost everything else twitter requires — and from a text terminal. No need to run a GUI or anything fancy.
You just type reasonably mnemonic commands at a prompt. To print off the last 20 tweets in your home stream, you type:
[#username] home 20
Where ‘[#username]’ is the prompt. To get some help about tweet commands, type:
[#username] h tweets
You can favourite, retweet, follow links (sometimes) and so on. To show the last 5 tweets about some topic, you’d type:
[#username] s some topic
And so on. It installs via pip — that is, it’s a Python program. The simplest thing in my experience is to do as the instructions say, then make a soft link in your bin directory.
It may throw some errors about `the twitter stream API’. I believe some aspects of the API have been redesigned and don’t work with rainbowstream; I don’t really know, but the website has some information. But the interactive stuff seems to work fine, so it remains useful.
This is an extract from the install instructions at the website:
GitHub – orakaro/rainbowstream: A smart and nice Twitter client on terminal written in Python.
$ sudo apt-get install python-dev libjpeg-dev libfreetype6 libfreetype6-dev zlib1g-dev $ cd installs/ $ virtualenv venv $ sudo apt install python3-venv python3-pip python-pip $ sudo pip install virtualenv $ virtualenv venv $ source venv/bin/activate $ pip install rainbowstream $ ln -s /home/username/installs/venv/bin/rainbowstream /home/username/bin/rainbowstream $ rainbowstream -iot
Note to self — nothing to see here.
I sometimes play with emTeX inside DOSBox. The DVI viewer is very nice.
Sometimes, I have a font that the DVI viewer will not render, even though I can LaTeX and (often) dvips the file no worries. The viewer, dviscr, needs packed bitmap pixel files (xxxx.pk) of each size, and in the right place in the emTeX directory tree, usually in C:\TEXFONTS.
Say I want to generate the pncr8r pk file at 180 size, using the old DOS file name convention, then put it where dviscr will find it.
I sometimes use the the Linux machine that hosts the DOSBox session:
$ gsftopk --dosnames pncr8r 180 gsftopk(k) version 1.19.2/927                                                                                                                                                                                                                                      $ cp pncr8r.pk /path/to/TEXFONTS/PIXEL.LJ/180DPI/
Then, back in DOSBox, refresh the file tree
Then it works.
Note that the main difference between pk files on Linux and DOS is that DOS can only use 8.3 file names, so it omits the scale number (180 in this case), which means that copying into the correct directory, with name of the form XXXDPI where XXX is the number, is vital because that is how dviscr selects the correct pk file.
Note also that dvips will resort to using the .pk files to generate the PostScript if there is no PostScript font available, so doing this will sometimes fix missing glyphs in dvips output.
From an old WordPerfect 5.1 document
This is a summary of part of the Basic guide to Pro-Cite, section ‘Creating a bibliography from a manuscript’.
1. Insert your citations in the WP document. Two ways:
- author/date, like (Smith, 1994) or (Smith & Jones 1987)
- record number, like (#324) where 324 is the record number in Pro-Cite.
2. Save the document, exit WP5.1.
3. Search for the citations in the document:
- open Pro-Cite and the Pro-Cite database containing the records
- in Main Menu, press M for search Manuscript
- press O for Options and set appropriately
- select all database records
- F to give the document File name (changing directory if need be), then Enter
- in Main Menu, press M for search Manuscript, then Enter.
4. Generate the reference list to insert into your document:
- go to Print menu and set your output format to WP5.1
- Print the reference list
- go to search Manuscript and ‘Clear manuscript order’
- close Pro-Cite.
5. Insert the list into your document:
- open your document in WP5.1, and move the cursor to where the list is to go
- Shift+F3 to switch to the second document
- open reference list, and copy it all
- switch back and paste it in.