sudo apt-get update
sudo apt-get install -y --no-install-recommends build-essential libmariadb-dev-compat libpq-dev libssl-dev pkgconf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --[[ deepcopy.lua | |
| Deep-copy function for Lua - v0.2 | |
| ============================== | |
| - Does not overflow the stack. | |
| - Maintains cyclic-references | |
| - Copies metatables | |
| - Maintains common upvalues between copied functions (for Lua 5.2 only) | |
| TODO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import distlib.scripts | |
| import io | |
| import os.path as osp | |
| import sys | |
| # from distlib import __version__ as distlibversion | |
| from pathlib import Path | |
| from zipfile import ZipFile | |
| SCRIPT = """import sys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'ap' | |
| require 'mail' | |
| # String monkeypatch | |
| # This is one of many possible "encoding problem" solutions. It's actually an intractable problem | |
| # but you'd have to read "Gödel, Escher, Bach" to understand why... | |
| class String | |
| def clean_utf8 | |
| # self.force_encoding("UTF-8").encode("UTF-16BE", :invalid=>:replace, :replace=>"?").encode("UTF-8") | |
| unpack('C*').pack('U*') if !valid_encoding? |
Locate the section for your github remote in the .git/config file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git@github.com:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Generated by: JavaCC 21 Parser Generator. JSONParser.java */ | |
| package org.parsers.json; | |
| import org.parsers.json.ast.*; | |
| import java.util.*; | |
| import java.util.concurrent.CancellationException; | |
| import java.util.logging.*; | |
| import java.io.*; | |
| import java.nio.file.Files; | |
| import java.nio.file.Path; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Generated by: JavaCC 21 Parser Generator. Do not edit. JSONConstants.java */ | |
| package org.parsers.json; | |
| /** | |
| * Token literal values and constants. | |
| */ | |
| public interface JSONConstants { | |
| public enum TokenType { | |
| EOF, WHITESPACE, COLON, COMMA, OPEN_BRACKET, CLOSE_BRACKET, OPEN_BRACE, CLOSE_BRACE, TRUE, FALSE, NULL, STRING_LITERAL, NUMBER, INVALID | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mkdir heroku | |
| cd heroku/ | |
| virtualenv --no-site-packages env | |
| source env/bin/activate | |
| pip install bottle gevent | |
| pip freeze > requirements.txt | |
| cat >app.py <<EOF | |
| try: | |
| import gevent.monkey |
This set of files is to help you set up a socket listener for Python logging in a production environment.
The other files are:
| Filename | Purpose |
|---|---|
| prepare.sh | A Bash script to prepare the environment for testing. |
| supervisor.conf | The Supervisor configuration file, which has entries for the listener and a multi-process web application. |
| ensure_app.sh | A Bash script to ensure that Supervisor is running with the above configuration. |
| log_listener.py | The socket listener program which receives log events and records them to a file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # -*- coding: utf-8 -*- | |
| # | |
| # Copyright (C) 2021 Red Dove Consultants Limited. BSD-3-Clause licensed. | |
| # | |
| from ctypes import * | |
| from ctypes.wintypes import BYTE,WORD,DWORD,LPWSTR,LPCWSTR,HANDLE,LPVOID,BOOL | |
| import os | |
| import sys |