Skip to content

Instantly share code, notes, and snippets.

View atenni's full-sized avatar
🤷‍♂️

Andrew Tennikoff atenni

🤷‍♂️
  • Sydney, Australia
  • 08:36 (UTC +10:00)
View GitHub Profile
@atenni
atenni / Archive Moodle Logs.md
Last active June 7, 2017 08:17
Script to archive moodle logs to a separate stats server for future long time series/big data analysis.

Archiving mdl_log, daily

(From http://www.ualberta.ca/~dostatni/moodlemoot2013/mdl_log.html)

The following script is executed daily. It generates a CSV file with all the moodle activity for previous day. That file is saved together with apache access and error logs in a log server. This data is used to verify student challenges ( eg. "I couldn't submit my assignment because there was a problem with the system"), identify trends and trace the origin of errors (to a specific code deployment).

This level of archiving allows us to remove the mdl_log entries from the active database. Currently the logs take up about half of the size of the database on disk.

dump_yesterdays_logs.sql

How to convert raw Echo360 Personal Capture file with ffmpeg

When Echo360 Personal Capture is set to record video and display, the output file is a container containing both video streams (at least on Windows 7). If you want to edit this footage in third party software before uploading it into Echo you'll probably need to seperate these video streams. Using ffmpeg is one way to do this.

Quick start

ffmpeg -i audiovideodisplay.wmv \
@atenni
atenni / keybase.md
Created March 26, 2016 05:17
Keybase.io public auth

Keybase proof

I hereby claim:

  • I am atenni on github.
  • I am atenni (https://keybase.io/atenni) on keybase.
  • I have a public key whose fingerprint is 5354 0DBA 6CB6 0CFB 4BFD 21ED 2CC2 BDDA EA0E 29B8

To claim this, I am signing this object:

@atenni
atenni / GetResults.xml
Last active March 3, 2016 22:12
Anonymised example of Formsite's GetResults. Includes headers [fs_include_headings=true], limit to two responses [fs_limit=2]. Docs: https://www.formsite.com/documentation/api/
<?xml version="1.0" encoding="UTF-8"?>
<fs_response status="success" timestamp="2016-01-30 13:03:29">
<headings>
<heading for="result_status">Result Status</heading>
<heading for="login_username">Login Username</heading>
<heading for="login_email">Login Email</heading>
<heading for="date_start">Start Time</heading>
<heading for="date_finish">Finish Time</heading>
<heading for="date_update">Update Time</heading>
<heading for="user_ip">User's IP Address</heading>
@atenni
atenni / Financial Indicators - Monthly.csv
Last active December 23, 2015 02:29
Includes: S&P/ASX 200, AOAI, Dividend yield, ASX P/E ratio, Domestic market cap, Interbank cash rate, 2yr bonds, 3yr bonds, 5yr bonds, 10yr bonds
ASX200 Close AOAI Index Dividend yield ASX P/E ratio Domestic market cap ($m) Interbank cash rate 2yr Bond 3yr Bond 5yr Bond 10yr Bond
31/12/79 1000 9.50 10.02 10.08
31/01/80 1174.3 9.24 10.42 10.45
29/02/80 1214.6 8.86 10.90 10.55
31/03/80 1040.9 10.40 11.20 11.20
30/04/80 1079.3 10.68 11.45 11.73
31/05/80 1214.6 13.72 11.80 11.78
30/06/80 1286.5 13.73 11.78 11.76
31/07/80 1305.5 12.86 11.78 11.78
31/08/80 1355 12.42 11.78 11.82
ASX200 Close
17/10/2001 3249.6
1/11/2001 3337.5
3/12/2001 3422.3
2/01/2002 3464.2
1/02/2002 3414.3
1/03/2002 3414.8
2/04/2002 3350
1/05/2002 3373.6
3/06/2002 3216
# The four main financial journals
* Journal of finance
* Review of financial studies
* Journal of financial economics
* Journal of financial and quantitative analysis
@atenni
atenni / Marked Numbered Equations.md
Last active December 17, 2015 11:59
Marked.app header to make MathJax automatically number equations.
XHTML Header: <script type="text/x-mathjax-config">
  MathJax.Hub.Config({ TeX: { equationNumbers: {autoNumber: "AMS"} } });
</script>

When included as the first line in a Marked document, the following equation will be automatically numbered:

\begin{equation}

E = mc^2

@atenni
atenni / AOAI.csv
Last active December 17, 2015 11:48
Financial Indicies
Date AOAI Index
1979-12-31 1000.00
1980-01-31 1174.30
1980-02-29 1214.60
1980-03-31 1040.90
1980-04-30 1079.30
1980-05-31 1214.60
1980-06-30 1286.50
1980-07-31 1305.50
1980-08-31 1355.00

Create Postgres dev environment in Windows 7 for Django

Install Postgres

  1. Download and run the Postgres Windows installer http://www.postgresql.org/download/windows/
  2. Initally the only user will be postgres. Edit the pg_hba.conf file (probably in C:\Program Files (x86)\PostgreSQL\8.4\data) to add trust to all the methods
  3. Additionally, add local all all trust to the top row to allow localhost access.
  4. Use createuser (in C:\Program Files (x86)\PostgreSQL\8.4\bin) to create a new database (super)user