?

Log in

No account? Create an account
And today's prize for computing fuckwitterry goes to.... Windows Update on Windows 7, which spent something in the region of 24 hours "preparing" to update my computer (post Windows Update reboot) before I decided I'd had enough and actually needed to use the laptop again... at which time, a power cycle seems to have "magically" done whatever Windows was pissing about allegedly "preparing" to do.... the Windows Updates from Patch Tuesday are installed and, apart from taking a lot longer than normal to get from logon to fully started, seems to be working as normal.... so quite what it was doing is anyone's guess.......

Just went to download the latest version of Azureus for my Linux system and it seems SourceForge have decided to introduce a sneaky "feature" thats "on" by default.... they've made it so that when you try to download a file, what you actually get is an "ad support installer"... thing is, they don't bother to make any mention that this is going to happen.... so if you;re paying attention to the size of your download and/or where the download is coming from, you see a 75k-ish file (in my case) coming from some advertising company's site, not the 23MB file coming from kent.ac.uk that I was expecting..... this is a Very Bad Thing for them to be doing (verging on Evil), ESPECIALLY without telling you what the f*** is going on... TBH, I though SF had been hacked and was serving up malware without bothering to even hide the fact!

I'm now a very grumpy JoJo! (esp as I spent 10 minutes trying to figure out what the hell was going on!)

From an 'aside' perspective... perhaps the *stupidest* thing with this is that I'm using Windows to download a file for my Linux system.... so if I weren't paying attention, I'd now have a "vuze.tar.exe" (that was *supposed* to be a "vuze.tar.bz2") that would simply *fail* when I tried to use it.... talk about alienating your users.... "here, have a totally *useless* download that won't even do what we (SF) want it to because we're assuming your downloading it on the machine you want to run it on".... sheeesh...!

BTW: this behaviour (the stupid ad-support .exe installer thing) can be disabled by clicking the "Direct Download: Off" text just above the files list at the right hand side, next to the RSS icon.

More on Explorer sub-context-menus...

If you saw my last post (on cascading submenus from the Explorer context-menu), and you followed the link to MS's documentation, you might have noticed another page that refers to using ExtendedSubCommandsKey and wondered why I didn't mention it.

The short answer to this is simple; I couldn't get it working!

Turns out I'm not the only one and the general opinion on that particular bit of documentation is about as far from complimentary as you can get!

Anyway, I've had a bit of a Google since then and come across this blog post that makes sense of how to use this registry entry to build a submenu.

The cool thing with ExtendedSubCommandsKey is that it lets you build multiple levels of submenu.... "extended flyouts" I think is one phrase used to describe these... the image at the top of the ExtendedSubCommandsKey documentation page (reproduced here) demonstrates this:

[Explorer cascading submenus]

but (amongst that pages many failings), the page fails to elaborate on how to achieve such a thing.

Given the knowledge that this is possible, and the content of the blog post, this really is just a case of join-the-dots, but I figured I'd write it down here, in case I actually need it one day...

So, to summarise the blog post, there are three parts to making an ExtendedSubCommandsKey-based submenu work:

  1. A menu entry in the shell key. This doesn't have to have an MUIVerb entry (even if the docs suggest it does) but I do recommend you use set the menu entry text using either the default value of shell\keyname or the MUIVerb value... using shell\keyname is liable to cause confusion when you get into the cascading menu definition where it isn't allowed.

    The order of precedence for where the menu entry text comes from is shell\keyname < shell\keyname\@ < shell\keyname\MUIVerb (IOW, an MUIVerb value will supercede the others)

  2. An ExtendedSubCommandsKey (REG_SZ) String Value that tells Explorer the key (under HKCU) to look at for the submenu, eg *\ContextMenus\menu (I'm using ContextMenus as a container to keep things neat and together (esp once we have multiple cascades), but you don't have to... you can even just have the menu definition as, ie, *\menu) .
  3. A menu structure definition at the location referenced by ExtendedSubCommandsKey, so we might construct the hierarchy *\ContextMenus\menu\shell\menuentry\command, with appropriate values along the way.

    This appears to be the same menu structure as you might expect to find under HKCU\<somekey>.

So what do we need to know to make an extended cascade work?

Not much more actually... the key is to realise that you can put the same things in your submenu definition as you can put in the normal context-menu, and that this includes ExtendedSubCommandsKey values (but there is one important caveat)... So basically, create another menu structure, say at *\ContextMenus\menu2 and an menu entry in the original submenu definition with the new structure's location as its ExtendedSubCommandsKey value... and now for that caveat: this menu entry won't just use shell\keyname as the menu text, you must specify the text as either the menu key's default value or as the MUIVerb value. (I know, I pretty much already said that when summing up the blog post, but it bears reiteration!)

And a couple of screengrabs demoing this:

[Registry for cascading submenus]

[Registry cascade]

[The cascading context-menu in Explorer]

Note: The information in this entry describes a change to the Windows' Registy. If you would like to apply this change, but you do not understand what the Registry is, what it does, what manually editing the Registry could mean for your computer or what the modification described is doing, YOU SHOULD NOT MAKE THE CHANGE(S) DESCRIBED. If you proceed and Something Bad™ happens to you or your computer, sorry, but that's your problem!

While I was working on the Administrative Editor context-menu entry (described in this post), I stumbled upon a little bit of Microsoft documentation on adding cascading context-menu entries to Explorer using only the Registry, so I thought I'd have a quick play! And it turns out that this is actually incredibly easy.

There are three steps:

  1. Add a new context-menu entry, configured as a cascading menu
  2. Decide what entries you want and create unique "verb" entries for them
  3. Add the "verbs" to the cascading menu

As an experiment, I decided I would add an "Administrative Tasks" submenu to the context-menu for "all items" (that is, the "*" key of HKCR), and that I'd have two entries (based on the Administrative Editor modification that triggered this little investigation) in my submenu; one for GVim and one for Notepad.

Note: I'm not going providing .reg files for cut'n'pasting for this. While the process is easy, one of the keys you are adding to already has content present, and I have no way of knowing if you have entries there that I don't... and accidentally if a .reg file I provided were to overwrite something important in there, it would be extremely difficult to track down and fix.

Note: Explorer only gained this capability in Windows 7. If you're using Vista or earlier, I'm afraid this will not work for you.

The Cascading Context-Menu Entry

This is created just like any other context-menu entry; add a subkey to the shell key under the particular HKCR subkey you want it for.... in other words, for "all items", you add a new subkey under HKCU\*\shell, for a 'txtfile', you add a new subkey under HKCU\txtfile\shell. For my example, I now have a key at HKCU\*\shell\admintasks.

Next up isto tell Windows that this is a cascading submenu. To do this, I just have to add a String Value (a REG_SZ) called MUIVerb, with the value being the text you want displayed in the context-menu, ie "Administrative Tools" in my example. Easy!

You can also add an "Extended" REG_SZ (just as you can for a normal menu entry) if you only want the submenu to show up when the context-menu is triggered by shift-right-click.

At this point, if we open a context-menu for a file, all you'll see is a normal menu entry, ie:

[Context-menu showing Administrative Tools entry]

Adding Verbs


As we've already seen, in order to add submenu support, Microsoft have reused the same basic mechanism for defining a context-menu entry as has (I presume) always been available in the Explorer shell. They have had to extend it a little to add in this extra capability, but I haven't introduced that part yet.

But when it came to defining the entries for the submenu, guess what?

Yep! They used the same mechanism....

But (you might think) that means that there has to be a way to connect the context-menu entry for the submenu to the different entries that will make up the submenu. And if you did think that, then you'd be bang on, there does, and there is... and it comes in two parts, the first of which are "verbs".

Now, a "verb" is what (in the documentation) Microsoft call the combination of the key-structure in the Registry that defines a submenu entry and the label that is attached to it. The key-structure is exactly the same as a context-menu entry, its just stored in a different Registry key; HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell.

So now we know the what and the wherefore, we can add some new verbs. Remember, I want to have two entries in my submenu, one for an Administrative "Edit with Vim" and one for an Administrative "Edit with Notepad"? If I were just adding these to the normal context-menu, I'd add the keys runas_gvim and runas_notepad, so I'm going to use those same key names as my verbs, which means that I modify the Registry like this:

Registry Key: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell


  runas_gvim\
    (default) = Edit with &ViM
    HasLUAShield = ""
    command\
      (default) = "c:\program files\x64\nircmd.exe" elevate "c:\program files 
(x86)\vim\vim74\gvim.exe" "%1"
  runas_notepad\
    (default) = Edit with &Notepad
    HasLUAShield = ""
    command\
      (default) = "c:\nirsoft\x64\nircmd.exe" elevate notepad.exe "%1"

The first of which, if you read the previous post, should look familiar.

Note: The HasLUAShield value displays the UAC shield icon in the menu and can be omitted if the command doesn't trigger a UAC prompt.

Joining The Dots

So, we have a context-menu entry and we have some verbs, the final piece of the puzzle is to connect the two together, and to do this, all we do is add a list of verbs under the context-menu entry in a value called 'SubCommands', with the verbs separated by semicolons, ie:


Registry Key: HKCU\*\shell\admintasks

  SubCommands = runas_gvim; runas_notepad

And if we right-click a file, we can see that we now have a submenu, complete with entries.


[Context-menu showing Administrative Tools submenu]

Note: The information in this entry describes a change to the Windows' Registy. If you would like to apply this change, but you do not understand what the Registry is, what it does, what manually editing the Registry could mean for your computer or what the modification described is doing, YOU SHOULD NOT MAKE THE CHANGE(S) DESCRIBED. If you proceed and Something Bad™ happens to you or your computer, sorry, but that's your problem!

A couple of days ago, I decide to update a bunch of open-source software that I have installed on Windows 7. This is (obviously) not a world-altering event, I only mention it as its what triggered this little tweak.

One of the programs I updated is the ViM editor, using the GViM 7.4 installer.

I then found myself needing to use ViM's 'DIFF' mode and ran into the issue described in this post on Stack Overflow.

In attempting to apply the described fix, I ran into something that's annoyed me every time I've run into it, but always when I've been trying to just get something done... and that is that although I can right-click a file in Explorer and choose "Edit with ViM", the GViM that gets started will not be able to save the file if its in a location controlled by UAC.... in this particular case, c:\Program Files (x86)\vim... and if your editor doesn't provide its own privilege elevation support, well, you're stuck!

Now normally I'll just 'Command Prompt Here' and use either Kai Liu's elevate.exeor (more likely) ConEmu's csudo.cmd to run console-mode ViM on the file with elevated priveleges.

But this time I decided to do something about it... I had a quick Google for "windows edit as administrator" which returns at the top a few items suggesting using a different editor, like Notepad++ or running a one-off elevated Notepad by right-clicking a shortcut and choosing 'Run as administrator,' and using that to open the file... but these are just, to be frank, craptastic none-solutions... I want to be able to edit a file from anywhere in Explorer in the editor of my choice without having to copy the path and open a file manually in an editor I've had to manually invoke with elevated privileges.... after a few pages of this, I couldn't be bothered any more and gave up on Google and the wisdom of the masses, as it had occurred to me that I already know how to do 'runas' stuff for Explorer, atleast in part, so what if I used what I know to add an 'Edit with Administrative GViM'-type entry to all file types in Explorer and have it trigger UAC appropriately???

So I did... I even made it show the little UAC shield, just to be friendly! And it shows up when there's a 'runas' (iow, 'Run As Administrator") entry (rather than masking or being masked by it), such as with a batchfile... And to top it off, it only shows up if you right-click with Shift held down!

Screengrab: No entry with normal right-click:

[Explorer context-menu]

Screengrab: Shift-right-click shows the new Administrative ViM entry, with the UAC shield:

[Explorer extended context-menu]

(I used an .exe for this image just to show that the entry shows up, even when a 'runas' entry is present, because until 5 seconds ago, I'd forgotten that it was .bat files that had first shown the masking problem and I can't be bothered redoing the screengrabs!)

And what Dark Magic is needed to make this work?

Well, two things are needed:

  • Nir Sofer's awesome little NirCmd utility (download links are at the bottom of the page for 32- and 64-bit versions)
  • and a tiny little .reg file (described below)

Can't we do this only using windows?

Well... possibly... Windows does have a runas command, so you might just be able use that and follow the same principles I'm using however, runas is a Command Prompt tool and does not display the UAC prompt window (atleast, I can't get it to anyway), it asks for a password in an NT-DOS box.

Now, you might be thinking, as I did, Well surely Microsoft thought of this? Isn't there a way to do this straight from the Registry? I mean, that's how the "Run As Administrator" context-menu item works....

Believe me, I've asked myself the same questions.... and when I started out with this, I was using runas to just start GViM and I thought yay! that works and its so easy! and started writing this blog post...

Then I tried to admin-edit a batchfile using my menu item... except my menu item was AWOL....

And here's the Microsoft kick-in-the-crotch.... You can only have one runas item!

I thought I remembered a bit of Windows Voodoo, which was that you could have more than one runas item; you just used runas2 for the 2nd one... but that definitely doesn't work on Windows 7.

Thats why I've ended up using NirCmd; I'm hacking around the absence of something I expected the Windows Shell to implement, and cannot for the life of me work out why it doesn't... I mean, runas2, etc may not be pretty, but it would have been idiotically easy to have implemented!

NirCmd

NirCmd is a very handy 'Swiss Army Knife'-type utility. It has loads of neat little things it can do, for example, it can turn your monitor off, ask a question using a Windows dialog box and invoke a command if you answer in the affirmative, create shortcuts, minimise windows and all sorts of other useful little things.

In this particular case, we're going to use the elevate functionality, which lets you run a program with elevated privileges.

Download and extract NirCmd somewhere you can find it... c:\windows or c:\Program Files is fine... I'm using c:\Program Files as my example location.


Nir Sofer has all sorts of other nifty utilities too, listed on NirSoft.net, and they can (almost) all be downloaded (including x64 versions where available), packaged with a handy launcher utility (say for a USB stick) from launcher.nirsoft.net/download.html.

Note: I don't have any association with Nir or these tools, I've just had them as part of my software toolbox for years and just think they're really cool and everyone should know about them...!


Why are you using this privilege-elevation tool?

Can't you use one of the ones mentioned earlier?

Well, unlike those other ones, which are designed for use in a Command Prompt, this one doesn't bring/flash up an (annoying) NT-DOS window when you invoke it from the 'Run...' dialog or (more importantly) from a context-menu entry.

Registry Modification

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\runas_gvim]
@="Ed&it with Vim as Administrator"
"HasLUAShield"=""
"Extended"=""

[HKEY_CLASSES_ROOT\*\shell\runas_gvim\command]
@="\"c:\\program files\\nircmd.exe\" elevate 
                      \"c:\\program files (x86)\\vim\\vim74\\gvim.exe\" \"%1\""

Note: The last line starts with @ and goes right the way through to the %1 bit (as shown in the image below); its just too wide for my journal layout, so I had to split it.

Screengrabs: The ruans_gvim registry hierarchy in regedit:

[Registry Key: HKCR\*\shell\runas_gvim]

[Registry Key: HKCR\*\shell\runas_gvim\command]

You can change various things (the bits marked in bold in the .reg file):

  • The registry key your menu entry will use
    • Modify runas_gvim everywhere it occurs.
      • By using different keys (runas_gvim, runas_notepad, etc), you can create as many Administrative tasks as you like.
      • I've used "runas" as part of my key names so that the elevated commands stand out when I'm looking in the registry, but that's just my preference, which you can ignore.
      • But don't use the "runas" key
  • The text that will show in the context-menu for you entry
    • Modify the value of runas_gvim\@
      • The & marks the next character in the text string as the hotkey for the entry (in this case it's 'i').
      • You do not have to have an & in you menu text.
  • The location of the nircmd.exe program
    • Modify the C:\\program files that precedes nircmd.exe
  • The command for the program you want
    • Modifying the portion of the runas_gvim\command\@= value that comes after elevate.
    • For the command string, remember that in a .reg file, you need to double-up on your backslashes
    • The \"%1\"" lump needs to appear as-is as the last thing on the line
  • Whether your entry is only shown when shift-right-click is used
    • the "Extended"="" line
    • If you want your entry to always show in the context-menu, you can
      • remove this line from the .reg file before you apply it
      • or you can delete the value-pair in regedit if you've already applied it
  • Whether your entry shows the UAC shield icon in the context-menu
    • the "HasLUAShield"="" line
    • If you don't want the UAC Shield icon shown
      • remove this line from the .reg file before you apply it
      • or you can delete the value-pair in regedit if you've already applied it

Uninstalling

Removing your menu entry is really easy; you can either use regedit to navigate to HKEY_CLASSES_ROOT\*\shell and delete the runas_gvim (or whatever you used) key, or you can update (if you changed the registry key) and use this .reg file:

Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\*\shell\runas_gvim]

And if you've deleted all of your Administrative entries, and aren't using NirCmd for anything else, you can delete that too.

Note: This is only tested in Windows 7, but it should work in any Windows that uses User Account Control (UAC).

And of *course*, when I just edited that message, I noticed that although LJ was stripping the id attribute, it was still present in the edit-post pane.... so I figured I'd see what happened with id and class on the first <p> of the post... and the class attribute came through into the output.... making me rather grumpy...!

So now I don't know whether it was a rendering glitch that was børking my output, an LJ bug that's now been fixed, an LJ fix that's now been bugged or what!!

ids definitely doesn't seem to get through to output though.

I guess I'll leave the post with all the hackery stuff up anyway, cos I still think its kinda neat....

LiveJournal CSS Hacking

So, I noticed the other day that the little CSS tweaks I'd made to my LJ so it would output code, etc in an ok-looking format had stopped working. Turns out that LH have changed their HTML Cleaner so that it remvoes all class="user_class" and id="user_id" attributes in posts, which is just stoopid!. It also makes tweaking you journal's appearance a real PITA... Making this situation even more laughable is that one of LJ's features is the provision of Custom CSS functionality to let you do exactly that...! It actually makes me question why I have a paid account, I mean, this is a 'poweruser' kinda thing, it isn't (wasn't, anyway) a hack of any kind... By all means, don't allow scripts to be embedded, that makes perfect sense (and I can kinda understand not allowing the id attribute either, since that has scripting connotations too, although the id attribute is mandatory for some elements, atleast with XHTML1, which is what my journal's DOCTYPE is), but the class attribute is completely safe as its only purpose in life is as a coat-hook to hang bits of CSS-styling on... so why the cleaner removes it when its making a page 'safe', I have no idea!

Anyway, this posting started out as my test page for getting my hackarounds to work, and it demonstrates that this situation can *definitely* be hacked around.... atleast until LJ rename one of their classes that I'm using to restrict the scope of the hack to just my content. It also includes testing of a few less hacky tweaks, as I thought I'd best check they still worked too.

By the way, please don't count the number of extra <div> and <span> entities I've added to make this possible, or pay too much attention to how I'm abusing poor little <map> by using it as a pattern placeholder...!

If anyone is looking at this and thinking they'd like to 'borrow' it, my Custom CSS is included at the bottom, and before that is a table that lists the various lumps of markup that make it all work.

Since I'm making this public, I figure I'd better stick some sort of license on it... basically cause I think its actually pretty cool and I'd like to get credit for it (if there's any due!), so consider it released under the GNU Public License v2... Please feedback kudos, issues, cool modifications, etc in the comments of this post, thanks!

Styled Components

Basics

Heading 1 (matches entry title)

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

The last three Hn tags are the same size, which is 1px bigger than the P text.

A line of text before an HR. A line of text before an HR. A line of text before an HR. A line of text before an HR.


And one after it. And one after it. And one after it. And one after it. And one after it.

A self-referential link in a paragraph.

Edits

Another paragraph which {Edit} is not formatted has been modified and a link or two added.

A footnote that the page was changed and when (multiple edits should have multiple edit timestamps added):

Edited: Feb. 24, 2015th at 2:15 PM, Feb. 25th at 5:30 PM {2} and again, Feb. 25th at 11:30 PM {3}

The {Edit} text identifies which edit made a change, so {Edit#3} implies that the changes it marks were made during the 3rd edit listed in the footnote.

Lists

  1. Ordered list entry
  2. or two
  3. multi-paragraph

    multi-paragraph

  • Unordered list entry
  • or two
  • multi-paragraph

    multi-paragraph

Blocks

A paragraph indented a bit at both sides. A paragraph indented a bit at both sides. A paragraph indented a bit at both sides. A paragraph indented a bit at both sides. A paragraph indented a bit at both sides.

Like the previous, but with a bar on the left side, like some email programs use for quoted text. Like the previous, but with a bar on the left side, like some email programs use for quoted text.

The first one again, but multiple paragraphs. The first one again, but multiple paragraphs.

The first one again, but multiple paragraphs. The first one again, but multiple paragraphs. The first one again, but multiple paragraphs. The first one again, but multiple paragraphs.

Another indented-with-bar paragraph, but with a bar on both sides, so it resembles change-bars in old-style paper documentation updates.

Quotations

A paragraph with a quote and a citation (Me).

A multi-line blockquote. A multi-line blockquote. A multi-line blockquote. A multi-line blockquote. A multi-line blockquote. A multi-line blockquote. A multi-line blockquote.

And Citation

These don't look like quotes in a graphical browser, but they are wrapped in Q tags, so should (a) show up the semantics (b) show up as Qs in, say, Lynx:

An bar-indented paragraph that is also a quote, but which doesn't get <q>'s styling applied to it, so we can use this, ie for a quote from an email and it be shown semantically in the markup.

Same as the last, but for two-bar-indented paragraphs.

And nearly forgot the first block, oops!

Code, etc

We have two inline geek-esque forms, the first refers to code we're discussing, such as a function() and uses <code> tags, while the other refers to non-code stuff, like a filename, code that we're not discussing and more nebulous stuff, such as a man(1) page, and uses <tt> tags...

We also have two geekery blocks:

this.isa (source_code_section);
requires no_input_massaging;
except (html_entities_like ('<' && '>'));
if (a_line_has_indentation)
{
    then = this.is_respected();
}

This is for terminal output.
I get this giving 88 columns on Firefox 35/Windows 7 (so Consolas gets used as 
the font), but its probably best to stick to 79 characters, as per the CGA 
standard display, as things shift a bit when zoomed, and the fallback fonts,
browsers, Operating Systems will have different metrics.
         1         2         3         4         5         6         7         8        
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678

We can apply some text attributes like bold and italic using, ie <em>.
For others (underline, coloured and bright coloured) we use <span>s... 

Issues

  • You can NEVER nest four <span>s... three is fine, but four matches the 'edited' footnote... I don't think this should ever really be an issue, but its something to be aware of
  • The 'edited' footnote has a small issue, in that the shrunkenness applies to a <span> within a <p>, not to the <p> itself, so it doesn't shrink the block. This isn't super-obvious, it just means that you can see the grey background of the normal 'editted' <span> as a line above the 'Edited: ' text... which is annoying from a technical perspective, but doesn't look that bad...
  • Poor old <map> really is being abused...
  • Speaking of which, if you want the HTML to validate, you need to use a valid proper-form of <map> that includes an id attribute; I've used <map id="mymap1">, <map id="mymap2">, etc...

Notes

  • The Theme uses px for every size I've looked at, so the tweaking CSS does the same.
  • Its not easy to check that all this hackery is valid XHTML because the LJ stuff that surrounds your entry-content is piss-poor....

    If you run a page through W3's Validator, you'll see that LJ is super bad... Validating this test post, I'm getting, like, 200+ errors back; my entry's actual content starts around line 710-ish, and only raises errors regarding <map> not having the mandator id attribute specified, which is also LJ's fault, since its stripping the ids from my HTML.


Markup

{Edit} <span><span><span><span>{Edit}</span></span></span></span>
deleted <del>deleted</del>
inserted <ins>inserted</ins>
Editted: <span><span><span><span><span>Editted: </span></span></span></span></span>
  • List

    Entry wth multiple paragraphs

<ul><li><div><p>Multi-paragraph</p><p>List entry</p></div></li></ul>
Indented paragraph
<map id="m"><div><map id="n"><div>Indented paragraph</div></map>
</div></mapv>
Left-bar paragraph
<map id="m"><div><div><map id="n"><div>Left-bar paragraph</div>
</map></div></div></map>
Both-bar paragraph
<map id="m"><div><div><div><map id="n"><div>Both-bar paragraph
</div></map></div></div></div></map>
Paragraph quote (Cite) Paragraph <q>quote</q> (<cite>Cite</cite>)
Blockquote

Cite

<blockquote>Blockquote</blockquote><p><cite>Cite</cite></p>
Indented quote
<map id="m"><div><map id="n"><div>Indented quote</div></map></div></map>
Left-bar quote
<map id="m"><div><div><map id="n"><div>Left-bar quote</div></map></div>
</div></map>
Both-bar quote
<map id="m"><div><div><div><map id="n"><div>Both-bar quote</div>
</map></div></div></div></map>
code being discussed <code>code being discussed</code>
files, etc <tt>files, etc</tt>
code
block
<pre>code
block</pre>
output
block
<div><pre>output
block</pre><div>

The CSS

/* 
style "Spider Purple (Faerieality)
extends "Spider Purple"

Note: The theme is using px, so we do likewise 
*/
/*
Basics
----------
*/
div.post-asset div.asset-body {
/*
  Its nicer to have text justified when you have a solid block of colour down 
  the right side; the *wonky* of 'left' is too jarring against the 
  ruler-straightness!
*/
  text-align : justify;
}

div.post-asset div.asset-body h1 {
/*
  Taken from page-header2, so it matches the entry header
*/
  font-size : 22px;
  font-weight : bold;
}
div.post-asset div.asset-body h2 {
  font-size : 18px;
  font-weight : bold;
}
div.post-asset div.asset-body h3 {
  font-size : 16px;
  font-weight : bold;
}
div.post-asset div.asset-body h4 {
  font-size : 14px;
  font-weight : bold;
}
div.post-asset div.asset-body h5 {
  font-size : 14px;
  font-weight : normal;
}
div.post-asset div.asset-body h6 {
  font-size : 14px;
  font-weight : normal;
  font-style : italic;
}
div.post-asset div.asset-body tt {
  font-family : "Consolas", "Courier New", "Courier", monospace;
}
div.post-asset div.asset-body hr {
  width : 50%;
  height : 1px;
  color : #7B5191;
  border : none;
  background-color : #7B5191;
  height : 4px;
  margin-left : auto;
  margin-right : auto;
  margin-bottom : 9px;
}

div.post-asset div.asset-body a {
  color : #7B5191;
}

div.post-asset div.asset-body td {
  vertical-align : top;
}

/*
Edits
-------
*/
div.post-asset div.asset-body span>span>span>span {
/*
  For the {Edit} marker 
*/
  color : #a070c0;
  background-color : #e8e8e8;
}

div.post-asset div.asset-body span>span>span>span>span {
/*
  This one is for the 'Edited: timestamp' footnote
*/
  background-color : white;
  color : #a070c0;
  font-size : smaller;
}

div.post-asset div.asset-body del {
/*
  Red strike-through for erased, so its can still be seen... 
  Retractions not redactions!
*/
  font-style : normal;
  text-decoration : line-through;
  color : red;
  background-color : #ffe0ff;
}

div.post-asset div.asset-body ins {
/*
  Only fair that adds show up too
*/
  font-style : normal;
  text-decoration : none ! important;
  color : green;
  background-color : #e8ffdc;
}

/* 
Lists 
-----
*/
div.post-asset div.asset-body ul,
div.post-asset div.asset-body ol {
  padding-left : 14px;
  padding-right :22px;
  margin : 0 20px
}

div.post-asset div.asset-body li {
/*
  This evens up the indents on a list... breaking up the justified-ness 
*/
  text-align : justify;
  padding : 0 8px 0.5em;
}

div.post-asset div.asset-body li p {
/*
  This makes P-in-LIs not take up excess space... means we can have 
  multi-line LIs by doing LI-DIV-P1-P2
*/
  margin-bottom : 0;
}

/*
Blocks
------
The thinking with these is to escape user-selectorless-hell... these are 
various blocks of "normal" (ie, not code or quoted) text, so we have to work 
on the assumption that some box-model nesting is possible.... if we assume DIV 
container
--> DIV column
--> --> DIV row
--> --> --> DIV leeway
is the worst this will get, we need 5 DIVs for the
lowest-level block... no-one said this was gonna be pretty :-/
*/

div.post-asset div.asset-body>div>div>div>div>div>map>div {
/*
  Indent a block of text a bit.
  This is for a normal paragraph, not one squashed by the userpic.
  This is *specifically* for use where lines need to line up with the text in a 
  1st-level LI (ie after an image that gets the whole post width)
*/
  margin-left : 20px;
  margin-right : 20px;
  padding-left : 22px;
  padding-right : 22px;
}

div.post-asset div.asset-body>div>div>div>div>div>div>map>div {
/*
  Specialism of the above... adds a left border, like some email programs do
  for quoted message text
*/
  margin-left : 15px;
  margin-right : 20px;
  padding-left : 22px;
  padding-right : 22px;
  border-left : 5px solid #7B5191;
}

div.post-asset div.asset-body>div>div>div>div>div>div>div>map>div {
/*
  Specialism of the above... adds a right border too, like change-bars in 
  old-style paper documentation updates
*/
  margin-left : 15px;
  margin-right : 15px;
  padding-left : 22px;
  padding-right : 22px;
  border-left : 5px solid #7B5191;
  border-right : 5px solid #7B5191;
}

div.post-asset div.asset-body>div>div>div>div>div>map>div>p>span>q {
/* 
  Lets us set an indented block as a quote, without having quote styling 
  applied. The SPAN should prevent normal usage of a Q from being broken... 
  just don't find a need for a Q in a SPAN!
*/
  quotes : none;
  font-style : normal;
}

div.post-asset div.asset-body>div>div>div>div>div>div>map>div>p>span>q {
/* 
  Lets us set a left-bar-block as a quote, without having quote styling 
  applied. The SPAN should prevent normal usage of a Q from being broken... 
  just don't find a need for a Q in a SPAN!
*/
  quotes : none;
  font-style : normal;
}

div.post-asset div.asset-body>div>div>div>div>div>div>div>map>div>p>span>q {
/*
  Lets us set a two-bar-block as a quote, without having quote styling 
  applied. The SPAN should prevent normal usage of a Q from being broken...
  just don't find a need for a Q in a SPAN!
*/
  quotes : none;
  font-style : normal;
}

/*
Quotations
----------
2 forms of quotation are supported:
1) an inline quote, ie 
[ This is a sentence containing "...the damnation of saints" , as spake by 
(cite) as he struggled with LJ styling. ]
2) a statement quote, ie 
[
"To say sod it, I can hack this.....(!) or to hunt down the muppet who made 
LJ's HTML scrubber eat class, name and id attributes and make them eat every 
last rejected one, that is the question."
------> (cite) 
]
Originally this was a big PIA, as I was planning to use 'blockquote' for the 
block-indented-quotes, below, but since those are now done purely with DIVs 
and Qs, it can be used more correctly :-)

We also have 'cite' rules for the two 'q' types.... the 1st cite rule is nice 
and easy... the 2nd is a bit more challenging...
*/

div.post-asset div.asset-body p q {
  font-style : italic;
}

div.post-asset div.asset-body p q+cite {
  font-style : normal;
}

div.post-asset div.asset-body blockquote {
  font-style : italic;
  text-align : center;
  margin-left : 42px;
  margin-right : 42px;
  padding-left : 0;
  padding-right : 0;
/*
  Spider Purple's 'screen.css' includes a big quotemark that doesn't now work 
  right, so we have to override this:
    background: url(blockquote.gif?v=1) no-repeat 12px 3px;
  with this:
*/
background: none;
}

div.post-asset div.asset-body blockquote+p>cite {
  text-align : right;
  font-style : normal;
  margin-left : 20px;
  margin-right : 20px;
  display : block;
/*
  ^-- is a bit of a hack, but there's no easy way I can think of to apply 
  style to something that is the parent of the element of specificity
*/
}
div.post-asset div.asset-body blockquote+p>cite:before {
/* 
  Give blockquote citations some brackets 
*/
  content : "(";
}
div.post-asset div.asset-body blockquote+p>cite:after {
/* 
  Give blockquote citations some brackets 
*/
  content : ")";
}

/*
Code, etc
---------
Representation of code, both inline and as a block, program output (block 
only) and other (inline-only) geeky bits.
*/

div.post-asset div.asset-body>pre {
/*
  A block of code
*/
  margin-left : 40px;
  margin-right : 40px;
  padding-left : 2px;
  padding-right : 2px;
  border : 1px solid #7B5191;
  background-color : #d8c7dc;
  font-family : "Consolas", "Courier New", "Courier", monospace;
}

div.post-asset div.asset-body code {
/* 
  A fragment of code inline in a P 
*/
  padding-left : 2px;
  padding-right : 2px;
  border : none;
  background-color : #d8c7dc;
  font-family : "Consolas", "Courier New", "Courier", monospace;
}

div.post-asset div.asset-body>div>pre {
/* 
  A block of terminal output 
*/
  margin-left : 40px;
  margin-right : 40px;
  padding-left : 2px;
  padding-right : 2px;
  color : #c0c0c0;
  border : 1px solid #7B5191;
  background-color : black;
  font-family : "Consolas", "Courier New", "Courier", monospace;
}

Chewing on some Cinnamon Mint

So, I recently installed the Cinnamon version of Mint Linux on my (now) ex-WinXP laptop. I bought myself an external drive that it turns out was too big for an MBR... and GPT drives aren't supported in XP without spending cash.... to that meant I had to change OS, and with no spare Windows 7 licenses (and with using a Vista license at this point seeming rather foolish), an upgrade was out of the question, so that meant it *had* to be linux.

Anyway, setting up and settling in to Mint has mostly been a good experience... :-) and *soooo* much better than attempts 10 years ago trying to get the then-version of Fedora (or was it even RHL) to play with a Dell laptop!

Mint installed nicely, and out-of-the-box, Cinnamon isn't particularly onerous to use... and it has some functionality that Gnome have removed (esp in Nautilus) that I miss.

Sadly, I can't say there aren't some definite *issues* in the setup that I feel do the Mint team a disservice... for example, the default {Edit#2} multimedia music software (Banshee), whilst doing pretty much everything I want it to {Edit#2} in terms of multimedia playback, does do one very *specific* thing that I feel is a Very Bad Thing Indeed™ and it isn't even immediately apparent; it creates an ongoing playlist of everything you've played (presumably ever... or atleast until you work out whats happening and how to clear it)... which it will then proceed to play when whatever-it-was you actually *queued* to play has finished.... and there aren't even options to control this behaviour, you're just stuck with it! I know Banshee isn't just a media player, its supposed to be a media library too, but I really don't understand why the Banshee developers think this is a feature that people would actually *want* in either a media player or a media library... I mean, if I'm playing music, I don't then want a movie to start, and if I just opened a file to find out what it is, I don't then want to start going through all my other media....

Anyways, I'm realistic enough to know that there are bound to be niggles, that's to be expected; I have to put Windows through a fair bit of tweaking to get it to work how I want and then I have to find and install a load of other software to do things that it should do out-of-the-box but doesn't... and even the Banshee stupidity can be worked around... Mint *do* supply VLC, which doesn't have the same levels of stupid design (and which I've used for a few years in Windows for the DLNA/uPnP support), but there are a few niggly little things in VLC that just don't suit me.... however, SMPlayer is available from the software repos, and I get on just fine with that!

My biggest *moan* with Mint (and it *is* just a moan for a desktop machine like this that only has a limited scope of purpose and isn't going to be running lots of services... if this were a server, this would be a proper *issue*) is that I had hoped that by moving away from the RedHat side of the linux playing field on to something Debian-based I might avoid -sigh- systemd.... but -shrug- Fedora (which I run for my main Linux VM) has had is for ages, so I'm kinda used to running into it... and over the years, I've had the -cough- pleasure of new fangled init systems before and the *fun* of trying to make non-standard things *work* with both systemd and (prior to that) Upstart, back when they first hit Fedora... but I'd still like to have atleast one desktop linux machine running a proper (sysv) init... maybe, after some 17 years or so, its time to go back to Slack! ;-)

{Edit#2} That's a somewhat mean and inaccurate thing for me to say, afterall; I *am* running (the Slack-based, and init-based for that matter) UnRAID for my big datastorage box... I just meant that I'm not sure I fancy going Slack for a full-on desktop...


{Edit} Yes, I know Mint 17.1 isn't using systemd as init/process-0, but Ubuntu (Mint's upstream) are going over to it and granddaddy Debian (Ubuntu's upstream) are going over to it, and I just can't see that Mint are going to put the resources into trying go maintain an init configuration that isn't in upstream (atleast, not unless Devuan gains some traction); Debian's current Linux direction (despite Ian Jackson's heroic, Herculean efforts to avoid what is (essentially) vendor-lock-in and impart some sanity) is firmly pointed towards systemd eventually completely replacing sysvinit on all systems unless the sysadmin takes specific action to prevent this... and while that's not going to happen in Jessie (the next release), where new installs (but not upgrades) will be systemd-initted out-of-the-box, there's discussions ongoing that will affect the post-Jessie situation on how to handle upgrades from sysv-initted systems, how to handle the switchover so that sysadmins know whats happened and when its not appropriate to push systemd... the course is well and truly set, and that particular supertanker is going to take an immense effort to turn... :-(


On the data migration front, the the day-to-day stuff (like my Firefox browser profiles) was pretty much pain free.... a few paths to fix up here and there, but mostly everything just works.... although that may be atleast in part down to having been (atleast semi-) multi-platform for years now and generally using stuff that has cross-platform support for the majority of things that I might need to move.... and partly its down to this machine not actually having a great many things its actually used for these days, so some stuff didn't *need* to move over or couldn't (like the Bitvise SSH Server config which is never gonna work for openssh)...

Having said that though, migrating Azureus (or Vuze as its been known for a good few years, but which is just a *yucky* name!) has been a pain in the ****... it just doesn't do a good job with filesystem paths when moving an existing library from Windows to linux... I had hoped that the same functionality that I've used loads of times to point broken paths (ie, after moving storage around) at the relocated data would let me do the same thing after the move... but the GUI simply refuses to do anything at *all* with the DOS-esque paths. :-( But that is a whole different matter, and because its a long story, I've kicked it out of this post and into one of its own!

{Edit#2} I *am* going to post this at some point.... its just that its grown to three posts (so far) trying to keep each one under a million lines long... :-/

Edited: Jan. 24th, 2015 at 2:15 PM, and again Feb. 24th at 2:57 PM

(oops, this went all ranty!)

well,I seem to be putting together a fine collection of ex-electronics....

the 'rentals have been away since friday, so I've finally been able to turf all the stuff out of my room to be able to do some repairs after a clumsy heating engineer managed to bash a bracket off the wall (well, I say *off*.... it took a large chunk of plaster with it :-/

anyways, the turf out has also had an element of chucking out to it.... so its byebye to a few things that I've had knocking around 'just in case', like old-and-nearly-kapput mobys and old laptop batteries that work just about well enough to extract some information in an emergency... oh and the very dead harddisk from the other week (although I do need to tear it apart and attack that with a magnet at some point... not that i'm paranoid or nothink.....)

and now, me being in the process of putting my room to rights again, my vcr has decided to become an ex-vcr and won't do anything at all.... :-/

so i've just had an hour or so of fun taking it to bits and working out why its always had a tendency to chew tapes.... seems there's an issue with it not respooling the tape as the drums that pull the tape up to the head are returned to their at-rest positions... the tape then sags and either gets caught on the drums or various other protuberances in the cassette bay as the tape dooes its up-and-out manouver, so the tape is then trapped by the closing cassette-shutter and crushed against the bottom plate in the cassette cradle as it goes through the final bit of the eject sequence.... the result being a creased, crumpled, mangled tape thats still partially wrapped/hooked around various gubbins inside...... so thats nice to know..... bloody thing has never been 100%, what with the occassional tape-chewing incident and a tendency to fast-wind with far too much tension, resulting in tapes that had to be manually loosened just to get them to play (which is a *sod* with a vhs.... not like you can do the old pen-spooling trick like you can with audio tapes :-( ).... and I *knew* there was an actual proper honest-to-goodness fault with piece of c***, but noooooo, the damned fob-you-off f***wit shop staff "couldn't reproduce the issue" -!grrrrrr!- prolly didn't even try, a***holes....!!!

am i bitter....? well, i'm still p***ed off about it nearly 15 years (of rarely using the stupid thing cos there's a good chance it'll b0rk a tape) later, so what do you think....?!?! ;-)

-end-of-rant-

Strands:

Painfulness (and mini-catchup)

Oh, my facebook/LJ link got turned off again... guess that means I've not updated for a while!

 

So, I've been hurting since last tuesday... something not right with my right lung/ribcage... if I breathe normally, the last bit of the inhale hurts like hell... same if I stretch a little too far... doctor reckons I've either strained some of the little muscles round the lung or that I've managed to disturb the tissue that connects to the ribs... either way, it should sort itself out in time, and until then it'll be owwie!! I do now have some slightly better painkillers than I had... not that they make a *huge* difference, but any less is a definite improvement!!!

 

Right, quick catchup... dissertation has been going slowly... after many, many hours of graft, an extenuating circumstances submission and yet more graft, I now know I have until next april/may to get it done... what I *don't* yet know is whether I am able to continue on the same project or if I have to start over.

 

Apart from that, pretty much the  only other thing I've done was Glasto, which was fab ^^

Strands: