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
@degitgitagitya
degitgitagitya / .env
Last active May 10, 2024 00:12
Next JS + Next Auth + Keycloak + AutoRefreshToken
# KEYCLOAK BASE URL
KEYCLOAK_BASE_URL=
# KEYCLOAK CLIENT SECRET
KEYCLOAK_CLIENT_SECRET=
# KEYCLOAK CLIENT ID
KEYCLOAK_CLIENT_ID=
# BASE URL FOR NEXT AUTH
@antoviaque
antoviaque / gist:0b6cc931290881de546319cf673186f6
Last active May 8, 2024 09:16
Open edX - SSO Doc - Draft

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. [
@xameeramir
xameeramir / default nginx configuration file
Last active May 4, 2024 17:27
The default nginx configuration file inside /etc/nginx/sites-available/default
# Author: Zameer Ansari
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
@bennylope
bennylope / ffmpeg-watermark.md
Created April 22, 2016 23:17 — forked from webkader/ffmpeg-watermark.md
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.

@mrbar42
mrbar42 / README.md
Last active April 20, 2024 02:57
bash scripts to create VOD HLS stream with ffmpeg almighty (tested on Linux and OS X)

running:

bash create-vod-hls.sh beach.mkv

will produce:

    beach/
      |- playlist.m3u8
 |- 360p.m3u8
@nileshsimaria
nileshsimaria / docker-default-directory
Last active April 4, 2024 09:13
Change docker's default /var/lib/docker to different directory on Ubuntu
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
virolea / upload.js
Last active March 15, 2024 13:45
Tracking file upload progress using axios
upload(files) {
const config = {
onUploadProgress: function(progressEvent) {
var percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total)
console.log(percentCompleted)
}
}
let data = new FormData()
data.append('file', files[0])
@eunsukimme
eunsukimme / Dockerfile.app
Last active March 7, 2024 09:29
Configuration Files for Logging System wigh Docker-elk, Filebeat and Node.js
FROM node:12
WORKDIR /app
COPY ./package*.json ./
RUN npm install
ENV PORT=4000
COPY . .
CMD ["npm","run","start"]
@d-demirci
d-demirci / keycloak.yml
Created September 15, 2020 18:29
keycloak tutor openedx plugin
name: keycloak
version: 0.1.0
patches:
common-env-features: |
"ENABLE_THIRD_PARTY_AUTH": true
openedx-lms-common-settings: |
SOCIAL_AUTH_KEYCLOAK_KEY = 'educasual'
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'
SOCIAL_AUTH_KEYCLOAK_AUTHORIZATION_URL = 'http://keycloak.nubidus.com/auth/realms/openedx/protocol/openid-connect/auth'
@aamishbaloch
aamishbaloch / remove_server_details.md
Last active February 13, 2024 14:18
Remove Server Details from Response Header - Nginx

Remove Server Details from Response Header - Nginx

Below mentioned method is used to hide or remove the NGIX details from the header of your http requests.

Install Nginx Extras

sudo apt-get update
sudo apt-get install nginx-extras

Remove Server Details