Skip to content

Instantly share code, notes, and snippets.

View vanleantking's full-sized avatar
🤣

Le Van vanleantking

🤣
  • U
  • Binh Thanh
View GitHub Profile

How to download your Udemy course videos using youtube-dl

$ youtube-dl --list-extractors | grep udemy

Steps

  1. Get link to the course to download. e.g. https://www.udemy.com/course-name/
  2. Login into udemy website, save the cookie from chrome using Chrome (Cookie.txt)[1] export extension. Save it to file udemy-cookies.txt
  3. Get the link of the video that you want to download. usually in format. Use the command provided below where you have to replace the {course_link} and {path_to_cookies_file} with respective paths.
$ youtube-dl {course_link} --cookies {path_to_cookies_file}
@vanleantking
vanleantking / 0_export_public_key.py
Created April 24, 2025 15:45 — forked from aellerton/0_export_public_key.py
Python sign message with private key and verify with public key
#!/usr/bin/env python
"""Extract the public key from the private key and write to a file.
"""
from Crypto.Hash import SHA256
from Crypto.Signature import PKCS1_v1_5
from Crypto.PublicKey import RSA
with open("private_key.pem", "r") as src:
private_key = RSA.importKey(src.read())
@vanleantking
vanleantking / sign.sh
Created April 24, 2025 15:45 — forked from ezimuel/sign.sh
Sign and verify a file using OpenSSL command line tool. It exports the digital signature in Base64 format.
#!/bin/bash
# Sign a file with a private key using OpenSSL
# Encode the signature in Base64 format
#
# Usage: sign <file> <private_key>
#
# NOTE: to generate a public/private key use the following commands:
#
# openssl genrsa -aes128 -passout pass:<passphrase> -out private.pem 2048
# openssl rsa -in private.pem -passin pass:<passphrase> -pubout -out public.pem
@vanleantking
vanleantking / crc16.c
Created April 3, 2025 14:42 — forked from tijnkooijmans/crc16.c
CRC-16/CCITT-FALSE
uint16_t crc16(char* pData, int length)
{
uint8_t i;
uint16_t wCrc = 0xffff;
while (length--) {
wCrc ^= *(unsigned char *)pData++ << 8;
for (i=0; i < 8; i++)
wCrc = wCrc & 0x8000 ? (wCrc << 1) ^ 0x1021 : wCrc << 1;
}
return wCrc & 0xffff;
@vanleantking
vanleantking / LaravelInterviewQuestions.md
Created February 4, 2025 14:21 — forked from lukevers/LaravelInterviewQuestions.md
Laravel Interview Questions

Laravel 5 Interview Questions

This is a compiled list of Laravel interview questions. If Laravel is an engineer's PHP framework of choice, they definitely have potential to be a good candidate, but a lot of new PHP engineers have been into Laravel too. The framework itself is very welcoming to newcomers, which makes it easy for beginners to feel that they know more than they really do.

General Questions

1. How long have you been using Laravel?

This question can help decide what level of questions to ask.

These are the tasks you might encounter in your PHP/Laravel job interviews:

  1. Coding exercises: These may involve solving programming problems using PHP or other relevant languages, implementing algorithms, or working with data structures.

  2. API design and implementation: You might be asked to design and implement APIs to meet specific requirements or integrate with existing systems.

  3. Database queries: You could be given tasks that involve writing SQL queries to retrieve or manipulate data in a database.

  4. Framework-specific tasks: You may have tasks to work with Laravel.

@vanleantking
vanleantking / reset php storm and jetbrains
Created September 27, 2024 13:54
reset php storm and jetbrains
#!/bin/bash
# reset jetbrains ide evals v1.0.4
OS_NAME=$(uname -s)
JB_PRODUCTS="IntelliJIdea CLion PhpStorm GoLand PyCharm WebStorm Rider DataGrip RubyMine AppCode"
if [ "$OS_NAME" == "Darwin" ]; then
echo 'macOS:'
for PRD in $JB_PRODUCTS; do
@vanleantking
vanleantking / Designing Event-Driven Systems links.md
Created August 17, 2024 07:54 — forked from giampaolotrapasso/Designing Event-Driven Systems links.md
List of links from Designing Event-Driven Systems by Ben Stopford
@vanleantking
vanleantking / gitignore-for-wp
Created July 15, 2024 07:17 — forked from samhotchkiss/gitignore-for-wp
Basic Gitignore for WordPress
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
@vanleantking
vanleantking / regexp phone number in text
Created June 22, 2024 17:06
regexp phone number in text
https://stackoverflow.com/questions/16699007/regular-expression-to-match-standard-10-digit-phone-number
(\(?\+84\)?\s?[0-9 -.\\?]+)|([0-9][.\- ]?){10}