MixedBagOfTricks - henk52/knowledgesharing GitHub Wiki

Mixed bag of tricks

Google chat bots

References

pub-sub

Publishing bots:

Webhook bots:

lighttpd

lighttpd.conf

server.modules = (
	"mod_access",
	"mod_alias",
	"mod_compress",
 	"mod_redirect",
#       "mod_rewrite",
)
server.modules += ( "mod_cgi" )

server.document-root        = "/var/www/html"
server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
server.errorlog             = "/var/log/lighttpd/error.log"
server.pid-file             = "/var/run/lighttpd.pid"
server.username             = "www"
server.groupname            = "www"
server.port                 = 8080

# see stderr output from CGI processes, you need to set
server.breakagelog = "/var/log/lighttpd/breakage.log"

alias.url += ( "/cgi-bin/" => "/var/www/html/cgi-bin/" )
cgi.assign = ( ".pl"  => "/usr/bin/perl",
                   ".cgi" => "/usr/bin/perl" )


index-file.names            = ( "index.php", "index.html", "index.lighttpd.html", "index.pl" )
url.access-deny             = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

compress.cache-dir          = "/var/cache/lighttpd/compress/"
compress.filetype           = ( "application/javascript", "text/css", "text/html", "text/plain" )

# default listening port for IPv6 falls back to the IPv4 port
## Use ipv6 if available
#include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
#include_shell "/usr/share/lighttpd/create-mime.assign.pl"
#include_shell "/usr/share/lighttpd/include-conf-enabled.pl"

cgi-bin/index.pl

#!/usr/bin/perl -w

# http://perldoc.perl.org/CGI.html

use CGI;                             # load CGI routines

my $q = CGI->new;                        # create new CGI object

print $q->header,                    # create the HTTP header
         $q->start_html('HELLO WORLD'), # start the HTML
         $q->h1('hello world'),         # level 1 header
         $q->end_html;                  # end the HTML

OpenGrok

  1. git clone https://github.com/oracle/opengrok.git
  2. cd opengrok
  3. docker build . --tag opengrok:latest
  4. docker run -d -v <SOURCE_DIR>:/opengrok/src -p 8080:8080 --name grok_cgate opengrok:latest
  5. firefox http://localhost:8080
⚠️ **GitHub.com Fallback** ⚠️