Skip to content

Instantly share code, notes, and snippets.

View maitrungduc1410's full-sized avatar
Keep chasing your dreams!

Duc Trung Mai maitrungduc1410

Keep chasing your dreams!
View GitHub Profile
antoviaque / gist:0b6cc931290881de546319cf673186f6
Last active June 16, 2022 15:58
Open edX - SSO Doc - Draft
View gist:0b6cc931290881de546319cf673186f6

Third Party Authentication Features in Open edX: Technical Knowledge Transfer

Part 1: Background / Notes

  • Open edX has full, integrated support for three different types of third party auth provider:
    1. OAuth based providers (OAuth2 and the older OAuth v1). Google, Facebook, LinkedIn, and Azure Active Directory are available by default. Any other OAuth backends supported by python-social-auth v0.2.12 can be enabled by changing a configuration setting. Contributed by Google (John Cox).
    2. SAML / Shibboleth. SAML is an SSO standard mostly used by universities and corporations. Shibboleth is the name of a particular implementation of SAML, commonly used by higher ed. institutions.
    3. LTI. Users can use Learning Tools Interoperability® (LTI®) to authenticate. Support for this was contributed by UBC.
  • The Open edX platform also includes limited support for the following SSO providers.
  1. [
wooooodward / axios.js
Created November 6, 2019 17:16
Axios plugin example with request interceptor that adds JWT token to the auth header and 401 response interceptor to refresh token
View axios.js
import Vue from 'vue'
import axios from 'axios'
import store from '../store'
import { TokenService } from '../services/storage.service'
// Full config:
let config = {
process.env.baseURL ||
d-demirci / keycloak.yml
Created September 15, 2020 18:29
keycloak tutor openedx plugin
View keycloak.yml
name: keycloak
version: 0.1.0
common-env-features: |
openedx-lms-common-settings: |
SOCIAL_AUTH_KEYCLOAK_SECRET = '7c81d36a-bec9-4833-931c-64baab674283'
SOCIAL_AUTH_KEYCLOAK_PUBLIC_KEY = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjyq0SjRVvMaoHDeB4AcyBmWNNLe36ibopb/8cgXwPIPtphX50MepMK5Xmne1euS6I8ZWPGJl3DNtK215AMUKoy87BSJX5o26RQx8d0M+WTvnw6EVLaskeJSiXu4WkYka2Ou+cc6mkyMMtDnkFybbjFFFdMOkDPSyCMEfakHH2b/es+6KBkIC+yqmigDy/S26rsVX5A7kFUP7QUGBPJqwOVQjyd9JaebQlxwN300NlWme2wZrypXOxWraPmpMsWlZVEtniqO+gtOT+ko41VQospwrsJSfSX05ch25WNIsDhOPNhfYOpdFDviHEiXMjtMm+XTLr0qfzVDdYEyJnmG7XwIDAQAB'
giehlman /
Created February 20, 2018 16:36
Update SonarQube properties file with project name and version from package.json
#!/usr/bin/env bash
#title :
#description :
# This script parses the project's name and version from its package.json and automagically
# updates the version and package name in the SonarQube configuration properties file.
# It can be used as a pre step before running the sonar-scanner command
# It also creates a backup of the props file with suffix *.bak
#prerequisites : NodeJS based project with package.json, sonar*.properties file in the cwd
#author : Christian-André Giehl <>
#date : 20180220
velopert / CounterManager.m
Created April 25, 2021 11:26
React Native iOS Native Component with Swift
View CounterManager.m
#import <React/RCTViewManager.h>
@interface RCT_EXTERN_MODULE(CounterManager, RCTViewManager)
RCT_EXPORT_VIEW_PROPERTY(onPressLeftButton, RCTDirectEventBlock)
RCT_EXPORT_VIEW_PROPERTY(onPressRightButton, RCTDirectEventBlock)
mrbar42 /
Last active August 3, 2023 07:03
bash scripts to create VOD HLS stream with ffmpeg almighty (tested on Linux and OS X)


bash beach.mkv

will produce:

      |- playlist.m3u8
 |- 360p.m3u8
aamishbaloch /
Last active September 6, 2023 03:09
Remove Server Details from Response Header - Nginx
bennylope /
Created April 22, 2016 23:17 — forked from webkader/
FFmpeg add a watermark to video

How to Add a Watermark to Video

FFMPEG filters provide a powerful way to programmatically enhance or alter videos, and it’s fairly simple to add a watermark to a video using the overlay filter. The easiest way to install ffmpeg is to download a pre-built binary for your specific platform. Then you don’t have to worry about including and installing all the right dependencies and codecs you will be using.

Once you have ffmpeg installed, adding a watermark is as easy as passing your existing source through an overlay filter like so:

ffmpeg -i test.mp4 -i watermark.png -filter_complex "overlay=10:10" test1.mp4

Basically, we’re passing in the original video, and an overlay image as inputs, then passing it through the filter, and saving the output as test1.mp4.

nileshsimaria / docker-default-directory
Last active September 20, 2023 15:58
Change docker's default /var/lib/docker to different directory on Ubuntu
View docker-default-directory
1. Take a backup of docker.service file.
$ cp /lib/systemd/system/docker.service /lib/systemd/system/docker.service.orig
2. Modify /lib/systemd/system/docker.service to tell docker to use our own directory
instead of default /var/lib/docker. In this example, I am using /p/var/lib/docker
Apply below patch.
$ diff -uP -N /lib/systemd/system/docker.service.orig /lib/systemd/system/docker.service
--- /lib/systemd/system/docker.service.orig 2018-12-05 21:24:20.544852391 -0800
virolea / upload.js
Last active September 26, 2023 06:04
Tracking file upload progress using axios
View upload.js
upload(files) {
const config = {
onUploadProgress: function(progressEvent) {
var percentCompleted = Math.round((progressEvent.loaded * 100) /
let data = new FormData()
data.append('file', files[0])