Projects

  • Documents from Git – Oli’s version

    This WordPress Plugin lets you easily publish, collaborate on and version control your [Markdown, Jupyter notebook] documents directly from your favorite remote Git platform, even if it’s self-hosted.

    The advantages are:

    • Write documents in your favorite editor and just push to your remote repository to update your blog instantly
    • Use the power of version control: publish different versions of the document in different posts, i.e. from another branch or commit than latest master
    • Easy to update by your readers via pull requests, minimizing the chance of stale tutorials

    The following document types are currently supported:

    • Markdown
    • Jupyter notebooks (only for public repositories)

    The following platforms are currently supported:

    • Github
    • Bitbucket
    • Gitlab

    Usage

    Note, this plugin uses Github’s wonderful /markdown API to render to HTML. This comes with 2 caveats:

    1. Unless authenticated, the rate limit is set at 60 requests per minute. Since v1.1.0 the plugin is capable of statically caching content. In case that’s not dynamic enough for you, your only option currently is to not use any cache in which case every document will be pulled from your provider every time someone opens it on your site. Then it’s strongly recommended to create a Github access token and register it with the plugin. Then the rate limit will be set to 5000 requests per hour. See Global attributes section for details on how to do that.
    2. The Markdown content cannot exceed 400 KB, so roughly 400 000 characters incl whitespace. If not a monographic dissertation, this should not be an applicable limit though.

    Configuration

    In the main menu Settings > Documents from Git you can set all important global settings.

    Note: previous config.json is deprecated now due to security concerns.

    Shortcodes

    The features of the plugin are provided through shortcodes. You can use them in your posts, pages or custom post types.

    Publish documents

    [git-<platform>-<action>] The document-specific shortcode

    • <platform> can be one of
      • github: if you use Github as your VCS platform
      • bitbucket: if you use Bitbucket as your VCS platform
      • gitlab: if you use Gitlab as your VCS platform
    • <action> can be one of
      • markdown: Render your Markdown files hosted on your VCS platform in Github’s rendering style
      • jupyter: Render your Jupyter notebook hosted on your VCS platform (only for public repositories)
      • checkout: Renders a small badge-like box with a link to the document and the date of the last commit
      • history: Renders a <h2> section with the last commit dates, messages and authors

    Manipulate rendering style

    [git-add-css] adds a <div id="git-add-css" class="<classes_attribute>" to wrap content. That way you can manipulate the style freely with additional CSS classes. Follow these steps:

    1. Add a CSS file to your theme’s root folder, which contains some classes, e.g. class1, class2, class3
    2. Enqueue the CSS file by adding wp_enqueue_style('my-style', get_template_directory_uri().'/my-style.css'); to the theme’s functions.php
    3. Add the enclosing git-add-css shortcode to your post with the custom CSS classes in the classes attribute, e.g.:
    [git-add-css classes="class1 class2 class3"]
        [git-gitlab-checkout url=...]
        [git-gitlab-markdown url=...]
        [git-gitlab-history url=...]
    [/git-add-css]

    Attributes

    Each shortcode takes a few attributes, indicating if it’s required for public or private repositories:

    • url: The URL of the document in the repository
      • Type: string
      • Action: all except git-add-css
      • Public repo: :ballot_box_with_check:
      • Private repo: :ballot_box_with_check:
    • user: The user name (not email) of an authorized user
      • Type: string
      • Action: all except git-add-css
      • Public repo: :negative_squared_cross_mark:
      • Private repo: :ballot_box_with_check:
    • token: The access token/app password for the authorized user
      • Type: string
      • Action: all except git-add-css
      • Public repo: :negative_squared_cross_mark:
      • Private repo: :ballot_box_with_check:
    • cache_ttl: The time in seconds that the plugin will cache, only for cache_strategy=static.
      • Type: integer
      • Action: all except git-add-css
      • Public repo: :negative_squared_cross_mark:
      • Private repo: :negative_squared_cross_mark:
    • cache_strategy: Only static caching is implemented so far. dynamic caching is on the way!
      • Type: integer
      • Action: all except git-add-css
      • Public repo: :negative_squared_cross_mark:
      • Private repo: :negative_squared_cross_mark:
    • limit: Limits the history of commits to this number. Default 5.
      • Type: integer
      • Action: history
      • Public repo: :negative_squared_cross_mark:
      • Private repo: :negative_squared_cross_mark:
    • classes: The additional CSS classes to render the content with
      • Type: string
      • Action: git-add-css
      • Public repo: :ballot_box_with_check:
      • Private repo: :ballot_box_with_check:

    Caching

    Often we need to prioritize speed when loading content and, in addition, it is very costly to fetch, load and format the content every time we need to read the content of the post.

    This plugin soon offers 2 methods for caching, static and dynamic which can be set via the cache_strategy property.

    • Static caching (cache_strategy=static)

    This is the default strategy, as it doesn’t require any user action.

    The property cache_ttl sets how many seconds the content cache will keep alive.

    Currently there’s no way to flush the cache manually. However, changing cache_ttl or the history limit will create a new cache.

    • Dynamic caching (cache_strategy=dynamic)

    This is not implemented yet. See #20 for details.

    Token authorization

    You need to authorize via user and token if you intend to publish from a private repository. You don’t need to authorize if the repository is open.

    However, keep in mind that some platforms have stricter API limits for anonymous requests which are greatly extended if you provide your credentials. So even for public repos it could make sense. And unless you use this plugin’s caching capabilities, it’s strongly recommended to register a Github access token regardless of the VCS hosting platform, see the beginning of the chapter.

    How to generate the token depends on your platform:

    This plugin needs only Read access to your repositories. Keep that in mind when creating an access token.

    Examples

    We publish our own tutorials with this plugin: https://gis-ops.com/tutorials/.

    • Publish Markdown from Github

    [git-github-markdown url="https://github.com/gis-ops/tutorials/blob/master/qgis/QGIS_SimplePlugin.md"]

    • Publish Markdown from Github with 1 hour cache

    [git-github-markdown url="https://github.com/gis-ops/tutorials/blob/master/qgis/QGIS_SimplePlugin.md" cache_ttl="3600" cache_strategy="static"]

    • Publish Jupyter notebook from Github

    [git-github-jupyter url="https://github.com/GIScience/openrouteservice-examples/blob/master/python/ortools_pubcrawl.ipynb"]

    • Publish from a private repository

    [git-bitbucket-jupyter user=nilsnolde token=3292_2p3a_84-2af url="https://bitbucket.org/nilsnolde/test-wp-plugin/src/master/README.md"]

    • Display last commit and document URL from Bitbucket

    [git-bitbucket-checkout url="https://bitbucket.org/nilsnolde/test-wp-plugin/src/master/README.md"]

    • Display commit history from Gitlab

    git-gitlab-history limit=5 url="https://gitlab.com/nilsnolde/esy-osm-pbf/-/blob/master/README.md"]

    • Use additional CSS classes to style

    The following example will put a dashed box around the whole post:

        [git-add-css classes="md-dashedbox"]
            [git-github-checkout url="https://github.com/gis-ops/tutorials/blob/master/qgis/QGIS_SimplePlugin.md"]
            [git-github-markdown url="https://github.com/gis-ops/tutorials/blob/master/qgis/QGIS_SimplePlugin.md"]
            [git-github-history url="https://github.com/gis-ops/tutorials/blob/master/qgis/QGIS_SimplePlugin.md"]
        [/git-add-css]

    With the following CSS file contents enqueued to your theme:

    
        div.md_dashedbox {
            position: relative;
            font-size: 0.75em;
            border: 3px dashed;
            padding: 10px;
            margin-bottom:15px
        }

    div.md_dashedbox div.markdown-github { color:white; line-height: 20px; padding: 0px 5px; position: absolute; background-color: #345; top: -3px; left: -3px; text-transform:none; font-size:1em; font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; }

    Installation

    WordPress.org

    The latest version is on Oli’s GitHub repository

    https://github.com/magicoli/documents-from-git

    There is no automatic update process from GitHub. You need to download the latest release and upload it to your WordPress installation, or, for advanced users, clone the repository into your wp-content/plugins folder and use git features.

    Note: The release from the original author on WordPress plugin store is deprecated and does not receive updates Documents from Git.

    Troubleshooting

    For troubleshooting and frequently asked questions, please refer to the FAQ page.

    Acknowledgements

    Contributions from other projects

    The file structure has been reorganised from the original version to make it more maintainable and to follow WordPress best practices, mainly bringing the wordpress file structure to the root folder, so applying this repo modifications to an original clone might need some extra preparation, but is not impossible.

    PDC Sponsored the Bitbucket integration.

  • Disable Password Change Notification

    Simple plugin to disable admin notifications when users change their password. No configuration, activate the plugin and voilà.

  • Bash helpers

    Copyright 2015 Olivier van Helden olivier@van-helden.net. Released under GNU Affero GPL v3.0 license, unless otherwise stated. http://www.gnu.org/licenses/agpl-3.0.html

    A couple of useful tools for bash scripting.

    helpers

    Put this line at the beginning of your script (do not run the file directly, source it):

    . /path/to/helpers

    and use these functions inside the script

    end [errornumber] [message]
    log [errornumber] [message]
    readvar [var]
    yesno [-y] ["message"]
    ucfirst [string]

    ini_parser

    A tool to read .ini config in bash scripts

    let’s say you have a .ini file with this content

    [Default]
        name = "Albert"
    [Smart]
        name = "Einstein"

    Put this line at the beginning of your script (do not run the file directly, source it):

    . /path/to/ini_parser

    And, where you need it

    ini.parse /path/to/config/file.ini
    ini.section.Default
    echo $name

    Output: Albert

    Then, later… (no need to repeat ini.parse /path/to/config/file.ini)

    ini.section.Smart
    echo $name

    Output: Einstein

    Voilà ! (en français dans le texte)

    More details inside ini_parser

  • Band Tools

    Post types and tools for bands. Allow publishing of records with songs list. Easy enough for a single band. Complete enough for several ones.

    Although you can get this plugin for free, buying it will fund development and help providing future features.

  • w4os – OpenSimulator Web Interface (dev)

    Ready to use WordPress interface for OpenSimulator. Provides user registration, default avatar model choice, login info, statistics and a web assets server for grids or standalone simulators.

    Full installation instructions

    Theme compatibility list

    See Features and Roadmap sections for current and upcoming functionalties.

  • Universal Translator (Yandex Edition)

    Important note:

    As noted by sninksnoodle on Oct 27, 2020, Yandex does not provide free API keys anymore (#1). The main goal of this fork was to provide an free alternative to Google Translate, so the project is now obolete.

    However, this code also fixed a couple of bugs in the available version of Hank Hamos Universal Translator (which dates 2015), so it might be worth to catch and bring these fixes to the Google Translate version.

    Original readme

    It is based on the excellent Universal Translator by Hank Ramos. However, the initial version was using Google translation engine API and Google decided to switch to a paid license. So I rewrote some parts of the code to use Yandex engine instead.

    Get the latest version in Speculoos’ grid speculoos.world:8002:Lab or on the git repository https://git.magiiic.com/opensimulator/Universal-Translator-Yandex (and if you make improvements, please share them there)

    New features

    • It’s working! No kidding: the version available on LSL scripts wiki and on other sites like Outworldz is incomplete and not ready to work, even taking apart the Google license issue.
    • Use Yandex translation API. It is not only free (while Google isn’t anymore), but it is easy to get an API key (while it’s quite complicate with Google or Microsoft API’s).
    • The API key is not hardcoded but instead stored in a notecard. This avoids a single key being spread everywhere and causing "maximum allowed requests reached" kind of messages.

    DO NOT DISTRIBUTE THE TRANSLATOR WITH THE API KEY. It could end up being used by dozens of users, and becoming useless.

    Main (and not so new) features

    • Multiplex mode: if several translators are in the same area, one becomes the master and makes actual translation requests for the other ones. This avoid overload when lot of people are present and using it.
    • Speaker language auto detection (though users can also choose their language manually)
    • Translations sent by instant messages, no spam on the public channel
    • Can be used as an object in the parcel or as a HUD.
    • Can use both an object in the parcel and people wearing HUD, without spamming public channel, nor overloading the servers and the API key limits.

    To do

    • Get an updated list of available languages ✓ A (beautiful) texture and logo
    • Detect the most used languages and show them at beginning of the list
    • Allow to set a fixed list of preferred languages to show first (probably before the auto-detected mostly used ones).

    Notes

    We use a dedicated function json2List instead of llJson2List (not compatible with 0.8). It’s a little bit rough, but it works.

  • Scrup – LSL scripts auto-update

    An update ecosystem to allow OpenSimulator scripts to self-update. It should also work in Second Life with a small tweak (see below).

    Installation

    • ScrupServer: the lsl server script, to put inside an in-world object. The object will also contain non-running copies of the latest versions of the scripts to update.
    • ScrupClient: The portions of code to include own script. It is intended to be lightweight, we don’t want it to get bigger than the script itself.
    • Web application: the rest of this repository. It will allow both client and server to register an exchange the needed information for updates.
    • Database: scrup use a sqlite database for efficiency only. It will be created automatically in PHP tmp_dir (or upload_tmp_dir). It stores only runtime data sent by server and client, so it can get deleted or lost without real harm.

    In the client script:

    • copy the variables and the scrup() function as is in your script (also include debug() function if you don’t have one)
    • please include a credit line at the beginning, after yours
    • insert scrup(ACTIVE) at beginning of default state_entry() and on_rez() (the latter only if you don’t use llResetScript)
    • use scrup(FALSE) to stop updates at any time in your script (for example, while executing a task that should not be interrupted). The authorization pin will be revoked and a new one will be generated on scrup(ACTIVE) or scrup(TRUE)
    • use scrup(TRUE) or scrup(ACTIVE) to resume normal operations (value of scrupAllowUpdates is still honored)

    Status

    This is a work in progress and more like a proof of concept. Updates are functional, but…

    • only if the server and the object are in the same region (you can wear the object and TP to the region hosting the server, though, and even wear the server and visit the regions where objects need update)
    • only one client can be present in a prim (several can if each one is in a different prim of the same object, though)
    • there are no verifications (allowed grids, owners, creators), so it should probably not be used at a wide scale. Yet.

    Second Life

    The only OSSL function used in scripts is osGetGridLoginURI(), in , which is useless in SL. So to make the script work in SL, replace the function by a fixed value "secondlife://" (detailed explanation in the scripts comments).

    Roadmap

    • Let ScrupServer script update itself too
    • Let two ScrupServers exchange their latest versions
    • If there are no updater in the same region, send a message notification to the owner
    • Or better: send an updater box to the owner as a workaround to region limitations (wear to update)
    • Allow bundles (all scripts in an object + other inventory items), mix with updater box concept
    • Find a f* way to send updates to other regions (let’s forget other grids for now)
  • PeepingToms

    OpenSim script to let NPCs be attracted when someone sits on an object Made

    by Gudule Lapointe @ speculoos.world:8002

    This is not my best achivement, but I find it quite funny. If you use NPCs in your region, put this script in one of the animated objects, and NPCs passing by will one by one come together to watch when someone sits on it.

    You can fix the scan radius, the distance they keep from the watched avatar, the occuppied angle (360 for all around, smaller to get them more in front), adjust rotation (to get them on the side, on front or rear), and make them change dress when they watch.

    Sometimes, an NPC is too far and cancel its move right before being in place so it disappear and go back to its initial position. It’s a bug, but it adds some randomness, so it sounds fair to me.

    Requirement

    It uses only standard LSL functions, but rely on an NPC server, which means it’s only relevant in a region where OSLL NPC functions are enabled.

    Installation

    1. Have already an NPC rezzer box, "OSW NPC" or "ActiveNPCs"
    2. If you want custom dresses, add correspondig notecards in the NPC box, as
      APP_Npcname_Dressname
    1. Put the script in any object where visitor sit, alongside the original script. You can put custom settings in the object description, in the form:
      searchRadius, minRadius, maxRadius, spreading, orientation, changeDress

    The script is auto-updating (in limited conditions). So either don’t change anything in the script, either disable auto-update to avoid losing your changes.

    Foot notes

    • If you setup a custom dress, ensure that you have a matching NPC notecard for each one in your NPC rezzer, otherwise you will get annoying system errors.
    • This script is intended to work with "OSW NPC" or "ActiveNPCs" (the latter being an enhanced version of the original). I made a fix for the error messages issue mentioned above, its available on https://github.com/GuduleLapointe/active-npcs-ef-Gudz-mods
    • If you distribute this script, include this README and credits
    • If you make changes, please share with me so I can improve the original

    Have fun! (and let me know about it)

  • OpenSimMaps (standalone)

    The web map tool for OpenSimulator, for

    • standalone use
    • or integration with

    Support this project: https://magiiic.com/support/OpenSimMaps

    Features

    • show grid map with region maptiles
    • click to get a choice of teleport methods
    • supports varregions
    • supports multiple maps
    • uses Google Maps v3 API

    New

    • allow standalone use: include minimal settings, independant to other helpers or web interface
    • include settings for integration with Flexible Helper Scripts
    • separate settings file from the rest of the code: one for php (config.php), one for javascript (config.js)
    • distribution now contains only example settings file, to alow smooth update without losing config
    • added hop:// to teleport link choices

    TODO

    • remove old API key probably belonging to one of the original developers
    • … and many other things whose details would be laborious (so much to do, so little time)
    • please use issues to request new features or report bugs

    Installation

    • clone this folder inside your website documentroot, e.g /var/html/opensimmaps/, to make it accessible as https://yourgrid.org/opensimmaps/ (you can rename it)
    • Copy config.php.example as config.php and adjust settings (this helper only needs database credentials OPENSIMDB*)
    • Copy config.js.example as config.js and adjust settings (particularly xlocations, ylocations, mapcenternames, hgdomains and hgports)
    • make a soft link from the OpenSim maptile/00000000-0000-0000-0000-000000000000 folder to data/regions/, for example on linux (adjust to your setup):
      ln -s /opt/opensim-0.9.2.0/bin/maptiles/00000000-0000-0000-0000-000000000000 /var/html/opensimmaps/data/regions

    Alternatively, you can make data/regions/ folder and copy the maptiles in it, but it won’t be updated automatically.

    • Original readme specified to rather use Warp3DImageModule, but it is now the default. Your OpenSim.ini file should contain these settings:
      [Map]
        MapImageModule = "Warp3DImageModule"
        TextureOnMapTile = true
        DrawPrimOnMapTile = true

    Credits

    Based on hawddamor’s opensimmaps (optimized for OpenSim Redux web interface).

    This is a modified version of hawddamor/opensimmaps. The modifications from the original project are mainly related to file locations and some variable names.

    More information on original project and authors in README and LICENSE files.