Skip to content

Instantly share code, notes, and snippets.

🌴
On vacation

林果皞 limkokhole

🌴
On vacation
Block or report user

Report or block limkokhole

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@limkokhole
limkokhole / aes.py
Created Jan 23, 2020 — forked from gsakkis/aes.py
Porting AES from M2Crypto to Crypto
View aes.py
from binascii import hexlify, unhexlify
from hashlib import md5
from Crypto.Cipher import AES
try:
from M2Crypto import EVP
except ImportError:
EVP = None
def m2_encrypt(plaintext, key, iv, key_as_bytes=False, padding=True):
@limkokhole
limkokhole / adjust_video_speed.md
Created Jan 18, 2020 — forked from hermanschaaf/adjust_video_speed.md
Adjust Speed of a Video with ffmpeg
View adjust_video_speed.md

To increase speed of a video by a factor of 1.5x:

ffmpeg -i input.mp4 -filter_complex "[0:v]setpts=PTS/1.5[v];[0:a]atempo=1.5[a]" -map "[v]" -map "[a]" output.mp4

We can use this to adjust the speed of all the videos in a directory (Linux and macOS only):

mkdir -p output
@limkokhole
limkokhole / webserver.py
Created Jan 14, 2020 — forked from patmandenver/webserver.py
Python SimpleHTTPServer with header outputs
View webserver.py
#!/usr/bin/python
#
# Author: Patrick Bailey
# Twitter: @whiteboardoder
#
#The MIT License (MIT)
#
#Copyright (c) 2016 "whiteboardcoder" Patrick Bailey
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
@limkokhole
limkokhole / post-server.py
Created Jan 14, 2020 — forked from kylemcdonald/post-server.py
Python POST simple server
View post-server.py
import SimpleHTTPServer
import SocketServer
PORT = 8000
class ServerHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_POST(self):
content_len = int(self.headers.getheader('content-length', 0))
post_body = self.rfile.read(content_len)
@limkokhole
limkokhole / m3u8_decryptor.py
Created Jan 5, 2020 — forked from delimitry/m3u8_decryptor.py
Python script for download and decrypt TS chunks from m3u8 file
View m3u8_decryptor.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import requests
import sys
from Crypto.Cipher import AES
@limkokhole
limkokhole / app.py
Last active Dec 9, 2019 — forked from carlos-jenkins/app.py
Example to set to a Gtk application a custom theme.
View app.py
# -*- coding:utf-8 -*-
#
# Copyright (C) 2013 Carlos Jenkins <carlos@jenkins.co.cr>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
View slowloris.pl
#!/usr/bin/perl -w
use strict;
use IO::Socket::INET;
use IO::Socket::SSL;
use Getopt::Long;
use Config;
$SIG{'PIPE'} = 'IGNORE'; #Ignore broken pipe errors
print <<EOTEXT;
@limkokhole
limkokhole / query-parser.rb
Created Oct 1, 2019 — forked from jamis/query-parser.rb
A simple example of a BNF-based, recursive-descent parser for reading a field-based query string
View query-parser.rb
require 'strscan'
# expr := term
# | term AND expr
# | term OR expr
# term := value
# | atom ':' value
# atom := word+
# | quoted_string
# value := atom
@limkokhole
limkokhole / compare.py
Created Aug 21, 2019 — forked from astanin/compare.py
Compare two aligned images of the same size
View compare.py
#!/usr/bin/env python
"""Compare two aligned images of the same size.
Usage: python compare.py first-image second-image
"""
import sys
from scipy.misc import imread
from scipy.linalg import norm
@limkokhole
limkokhole / connect.c
Created Aug 3, 2019 — forked from skreuzer/connect.c
Make socket connection using SOCKS4/5 and HTTP tunnel
View connect.c
/***********************************************************************
* connect.c -- Make socket connection using SOCKS4/5 and HTTP tunnel.
*
* Copyright (c) 2000-2004 Shun-ichi Goto
* Copyright (c) 2002, J. Grant (English Corrections)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
You can’t perform that action at this time.