Tag Archives: linux

Customised Apache directory index, with breadcrumbs

Really quite pleased with this for usability.

https://apps.andymade.uk/downloads/password-generator/browse_source/main/java/uk/rfyoz/passwordgenerator/

I run a script which creates custom HeaderName and ReadmeName (footer file name) files for every directory along with a custom .htaccess to tell apache where those files are.

.htaccess looks something like this…


IndexOptions SuppressHTMLPreamble FancyIndexing VersionSort NameWidth=* HTMLTable Charset=UTF-8 SuppressDescription
HeaderName .header.html
ReadmeName /downloads/password-generator/footer.html
IndexIgnore header.html footer.html .htaccess .header.html

Python oEmbed Query for Twitter

I just wanted to find out how, and where wordpress was getting those readable urls from when I pasted in a twitter link.

#!/usr/bin/env python3

import urllib, json, sys, urllib.request
from urllib.parse import urlencode, quote_plus
element = sys.argv[1]
twitter_page = sys.argv[2]
fragments = { 'url': twitter_page }
querystring = urlencode(fragments, quote_via=quote_plus)
url = "https://publish.twitter.com/oembed?" + querystring
response = urllib.request.urlopen(url)
data = json.loads(response.read())
print(element + " = " +  data[element])
$ ./twitter-oembed-query.py url https://twitter.com/i/lists/1286992616240947205
url = https://twitter.com/rfyoz/lists/linux

Linspire/Freespire are back!

Freespire 6.0.3

Seems like that once dead distro pair are back in development, after going missing for ten years. (I think it was originally conceived by Andrew Betts.)

The Linspire and Freespire (and Xandros) marks were obtained from Bridgeways Inc by PC Opensystems LLC in 2018. They are now using them for their own Linux distributions; one being free (price) and one being paid for. Apart from the name and logos very little is the same as the original releases.

Q) How did we acquire the Linspire / Freespire trademarks?

We acquired them through Bridgeways.ca before they went out of business. We now own them and it has been our decision since to market them.”

https://www.linspirelinux.com/p/linspire-faq.html

You can find the new Linspire website at: https://www.linspirelinux.com/ (tweet @linspirelinux)

Freespire is living at: https://www.freespire.net/

Download Freespire 6.0.3

https://distro.ibiblio.org/blacklab/freespire/6/freespire-603.iso
https://distro.ibiblio.org/blacklab/freespire/6/freespire-603.iso.sha256
https://distro.ibiblio.org/blacklab/freespire/6/freespire-603.iso.md5

Redirect missing pages (404) to higher up same directory, Apache.

<Directory /var/www/html/mydirectory>
                RewriteEngine On
                RewriteCond $1 ([^/]+)/optional/(.*)
                RewriteCond /var/www/html/mydirectory/$1 !-f
                RewriteCond /var/www/html/mydirectory/$1 !-d
                RewriteCond /var/www/html/mydirectory/%1/optional/ -d
                RewriteRule (.*) "https://example.com/mydirectory/%1/optional/" [R=302,L]
</Directory>
                

Eg:

https://example.com/mydirectory/0101/optional/x/y/z/non-existant-file.html 

redirects to

https://example.com/mydirectory/0101/optional/