Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Myles Fang myleshk

🎯
Focusing
View GitHub Profile
@myleshk
myleshk / config.ini.template
Last active Mar 20, 2018
Fill dummy records into tracking_video_pings_per_hour so its records for old videos matches table tracking_video_pings
View config.ini.template
[default]
user = user
password = password
host = localhost
database = edxapp_event
@myleshk
myleshk / .gitignore
Last active Mar 21, 2018
DB Migration Tool
@myleshk
myleshk / Setup edX notes steps.md
Last active Mar 25, 2019
edx notes api setup
View Setup edX notes steps.md
  1. Goto https://<your-lms-url>/admin. On the admin page, go to "Oath2" and click "Add" by "Clients". Fill out the following fields.
Item Value
User <leave blank>
Name edx-notes
Url https://<your-notesserver-url>
Redirect uri https://<your-notesserver-url>/complete/edx-oidc/
Client id <generated>
Client secret <generated>
@myleshk
myleshk / kafka-zookeeper.service
Last active Jan 3, 2018
Run Kafka & Zookeeper & Luigid using systemd on Ubuntu 16.04
View kafka-zookeeper.service
[Unit]
Description=Apache Zookeeper server (Kafka)
Documentation=http://zookeeper.apache.org
Requires=network.target remote-fs.target
After=network.target remote-fs.target
[Service]
Type=simple
User=kafka
Group=kafka
@myleshk
myleshk / kafka
Last active Jan 2, 2018
Init Script for Apache Kafka as Ubuntu Service (Deprecated)
View kafka
#! /bin/sh
### BEGIN INIT INFO
# Provides: kafka
# Required-Start: $local_fs $remote_fs $network $syslog $named
# Required-Stop: $local_fs $remote_fs $network $syslog $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Kafka server
### END INIT INFO
@myleshk
myleshk / MySQL_5.6_install_Ubuntu14.04.sh
Last active Nov 21, 2017
Specific version of MySQL 5.6 install on Ubuntu 14.04
View MySQL_5.6_install_Ubuntu14.04.sh
#!/bin/bash
#
# This script is not fully tested against data safety. Backup data and use at your own risk.
# To get available MySQL 5.6 versions, refer to https://dev.mysql.com/doc/relnotes/mysql/5.6/en/
#
version=$(cat /etc/*release | grep -Po '(?<=^VERSION_ID=")[0-9.]+')
sys_name=$(cat /etc/*release | grep -Po '(?<=^NAME=").*(?=")')
@myleshk
myleshk / nodejs_webserver_test.js
Last active Oct 20, 2017
nodejs simple webserver test
View nodejs_webserver_test.js
const http = require('http');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World\n');
});
You can’t perform that action at this time.