Code By
Lucas Mouilleron

An Open Source selection

TSMagellan

Last update : 20/08/2017 - 01:53
Private repository :(

TSAnalysis

Last update : 18/08/2017 - 19:29
Private repository :(

TSDataCenter

Last update : 18/08/2017 - 15:50
Private repository :(

TSSysAdmin

Last update : 17/08/2017 - 11:28
Private repository :(

TSSite

Last update : 20/07/2017 - 15:36
Private repository :(

stupidCMS

Last update : 20/07/2017 - 08:15

stupidCMS is a flat file stupid CMS with nice templating and caching engines.

Screenshot

Install

  • Drop all files (including .htaccess) at the site root
  • Create the file ./config.php and override default config (cf Overridable Configuration)

Stupid Pages (SP)

  • Stupid Pages files extensions is .html
  • In Stupid Pages, paths are relative to the site root
  • To link from a page to another page, use http://site.com/other-page
  • They use the Stupid Micro Templating Engine (SMTE) allowing administrable content declaration

Stupid Micro Templating Engine (SMTE)

  • Administrable contents : {{CNT:content-name}}
  • Administrable files : <img src="{{FILE:file-name.jpg}}"/> or <a href="{{FILE:file-name.pdf}}">the file</a>
  • Include another page in a page : {{INC:page-name-without-html-extension}}
  • Definitions : {{DEF:CONSTANT_NAME}} (for example SITE_URL)
  • If : {{IF:php expression}}content{{EIF}}

Studid Dynamic Page (SDP)

  • Stupid Pages files extensions can be .php
  • In this case the page is a Stupid Dynamic Page (SDP)
  • Custom php scripting can be addded
  • <?php global $stupid;?> must be called to make the stupid engine available
  • Sutpid API available :
    • $stupid->__inc("page-name-without-html-extension")
    • $stupid->__cnt("content-name")
    • $stupid->__file("file-name")
  • No CSPC cache is applied (it is applied only for included contents)

Compiled Stupid Pages Caching (CSPC)

  • Compiled Stupid Pages are cached for performance optimization
  • The cache engine is selectable in /config.php
  • Three engines are available :
    • None cache engine : no cache, all pages and contents are loaded from original files (not recommended)
    • File cache engine : cache files are located in /__cache
    • Redis cache engine : redis port is configurable in ___stupid/libs/stupidDefinitions.php
  • In DEVELOPMENT_MODE, the cache is disabled

Stupid Backend (SB)

  • stupidCMS comes with a stupid backend
  • Open http://site.com/admin in browser
  • Content editing :
    • Add contents in pages using the SMTE format
    • Run a Scan to populate the backend interface
    • Edit and save contents
    • Tips :
      • Contents are SMTE compatible, which means you can use the SMTE tags
      • Contents can be written in Markdown format :
  • Files editing :
    • Add files in pages using the SMTE format
    • Run a Scan to populate the backend interface
    • Edit and save files
  • Pages editing :
    • All SP and SDP can be edited from the backend
    • Templates can be used for scaffholding (templates are defined in /__templates)
    • /config.php is editable as well
  • Scan :
    • If SMTE administrable content are not visible, run Scan
    • Scan contents scans for contents and files
  • Clear :
    • If new contents or files don't appear, run Clear, to clear the cache
    • In DEVELOPMENT_MODE, cache is disabled, therefore Clear is not needed
  • Clean : TODO

Overridable configuration

  • Defined in ___stupid/libs/stupidDefinitions.php
  • DEBUG_MODE (true): displays hints
  • DEVELOPMENT_MODE (false): no cache for easier development
  • ADMIN_PASSWORD ("password"): has to be changed
  • SITE_URL ("http://localhost"): has to be set to the site root url
  • PAGE_404 (false): false or the name of the 404 page (without extension)
  • NO_SCAN_FOLDERS (none): folders not to scan when finding contents and files
  • SMTE_CACHE_ENGINE ("file"): file | redis | none

Dev

  • Install composer : curl -sS https://getcomposer.org/installer | php && mv composer.phar /usr/local/bin/composer
  • Install dependencies : cd ___stupid && composer install
  • Underlying cotents in ./__contents
  • Underlying files in ./__files

TODO

  • sub folder index
  • guidlines

Naming

Menus

httpBin

Last update : 13/07/2017 - 10:13

Screenshot

HTTP Client Testing Service.

Fork of http://httpbin.org.

Install

  • pip install -r requirements.txt

Run

  • cd .
  • gunicorn -b localhost:8080 httpbin:app

macInstaller

Last update : 11/06/2017 - 13:03
Private repository :(

TSDataCenterWebUI

Last update : 07/06/2017 - 14:17
Private repository :(

sshForFriends

Last update : 31/05/2017 - 16:32

Temporally give ssh access to your friends.

sshForFriends uses friends public keys to give them access to the computer.
When sshForFriends has finished running, public keys are cleaned and friends can't access the computer anymore.
Public keys are fetched from known identity providers.

Tested on macOS and Ubuntu.

No password, no hastle, 100% SSH.

Screenshot

Usage

  • sshForFriends [OPTIONS] friendUsername
  • friendUsername is the friend username which will be granted access (identity provider username)
  • sshForFriends -h for more usage help

Identity providers

  • Github : keys from https://github.com/$USER_NAME.keys (-g, -i github)
  • Keybase : keys from https://$USER_NAME.keybase.pub/id_rsa.pub (-k, -i keybase)

Behind a firewall

  • If the computer being accessed is behind a firewall, sshForFriends can use a public server for ssh forwading.
  • See params -x, -l, -m and -n
  • On the public server, make sure GatewayPorts yes is set in the /etc/ssh/sshd_config file
  • See examples below

Miscs

  • macOS, enable ssh server : sudo systemsetup -setremotelogin on

Examples

  • Give access from a machine to lucasmouilleron in one line : curl -sL https://raw.githubusercontent.com/lucasmouilleron/sshForFriends/master/sshForFriends -o $HOME/sshForFriends ; chmod a+x $HOME/sshForFriends ; $HOME/sshForFriends -g -x lucasmouilleron.com
  • Give access from a machine behind a firewall to lucasmouilleron in one line : curl -sL https://raw.githubusercontent.com/lucasmouilleron/sshForFriends/master/sshForFriends -o $HOME/sshForFriends ; chmod a+x $HOME/sshForFriends ; $HOME/sshForFriends -g -x lucasmouilleron.com -l sshtunnel -m 10022 lucasmouilleron

Credits

  • Inspired by https://github.com/flplv/ssh-allow-friend