Skip to content

Instantly share code, notes, and snippets.

View myleshk's full-sized avatar
🎯
Focusing

Myles Fang myleshk

🎯
Focusing
View GitHub Profile
@myleshk
myleshk / Setup edX notes steps.md
Last active March 25, 2019 02:54
edx notes api setup
  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 / .gitignore
Last active March 21, 2018 06:41
DB Migration Tool
*.ini
@myleshk
myleshk / config.ini.template
Last active March 20, 2018 10:23
Fill dummy records into tracking_video_pings_per_hour so its records for old videos matches table tracking_video_pings
[default]
user = user
password = password
host = localhost
database = edxapp_event
@myleshk
myleshk / kafka-zookeeper.service
Last active January 3, 2018 02:53
Run Kafka & Zookeeper & Luigid using systemd on Ubuntu 16.04
[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 January 2, 2018 08:36
Init Script for Apache Kafka as Ubuntu Service (Deprecated)
#! /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 November 21, 2017 08:58
Specific version of MySQL 5.6 install on Ubuntu 14.04
#!/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 October 20, 2017 02:45
nodejs simple webserver test
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');
});