Skip to content

Instantly share code, notes, and snippets.

@bparaj
bparaj / howto_python_flask_iis_wfastcgi
Last active Apr 1, 2021
Python Flask on IIS with wfastcgi
View howto_python_flask_iis_wfastcgi
Assume IIS is installed. My machine already had IIs 8.5.
Install Python
==============
1. Download web installer (Python 3.6.3).
2. Run as Administrator.
3. Select custom installation for all users.
4. Choose install directory such that there are no white spaces in the path. Not sure if it needs to be done. Just being cautious.
5. Check the box for "Add Python 3.6 to PATH".
@PuKoren
PuKoren / recompile-and-run.sh
Last active Apr 10, 2021
Recompile APK + Sign with apktool
View recompile-and-run.sh
# You must first install apktool (https://github.com/iBotPeaches/Apktool) and android SDK
# and decompile apk using it
# apktool d -rf my-app.apk
# then generate a key for sign in:
# keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
rm signed-app.apk
apktool b -f -d com.myapp
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore com.myapp/dist/com.myapp.apk alias_name
zipalign -v 4 com.myapp/dist/com.myapp.apk signed-app.apk
@laurenarcher
laurenarcher / livestreamingyoutube
Created Nov 21, 2014
Livestreaming to Youtube Live, Ubuntu, Linux FFMPEG
View livestreamingyoutube
Terminal Commands:
One webcam:
ffmpeg -f alsa -ac 2 -i hw:1,0 -f v4l2 -s 1280x720 -r 10 -i /dev/video1 -vcodec libx264 -pix_fmt yuv420p -preset ultrafast -r 25 -g 20 -b:v 2500k -codec:a libmp3lame -ar 44100 -threads 6 -b:a 11025 -bufsize 512k -f flv rtmp://a.rtmp.youtube.com/live2/YOURSTREAMNAMEHERE
Two webcam overlay:
ffmpeg -f alsa -ac 2 -i hw:1,0 -f v4l2 -s 1280x720 -r 10 -i /dev/video1 -f v4l2 -s 320x240 -r 10 -i /dev/video0 -filter_complex "[1:v]setpts=PTS-STARTPTS[bg]; [2:v]setpts=PTS-STARTPTS[fg]; [bg][fg]overlay=shortest=1 [out]" -map "[out]" -map 0:a -vcodec libx264 -pix_fmt yuv420p -preset veryfast -r 25 -g 20 -b:v 2500k -codec:a libmp3lame -ar 44100 -threads 6 -b:a 11025 -bufsize 512k -f flv rtmp://a.rtmp.youtube.com/live2/YOURSTREAMNAMEHERE
View golang_rsa_oaep_decrypt.go
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/sha1"
"crypto/x509"
"encoding/base64"
"encoding/pem"
"fmt"
@tonyseek
tonyseek / supervisord.service
Created Aug 8, 2014
Running supervisord with systemd.
View supervisord.service
[Unit]
Description=supervisord - Supervisor process control system for UNIX
Documentation=http://supervisord.org
After=network.target
[Service]
Type=forking
ExecStart=/usr/bin/supervisord -c /etc/supervisord.conf
ExecReload=/usr/bin/supervisorctl reload
ExecStop=/usr/bin/supervisorctl shutdown
@NickSto
NickSto / gist:6920790
Last active Jul 11, 2017 — forked from rnorth/gist:2031652
Cookie-based authentication with nginx
View gist:6920790
worker_processes 1;
error_log logs/error.log;
events {
worker_connections 1024;
}
@dristic
dristic / webrtc.js
Last active Sep 21, 2020
Full code from my WebRTC Data Channel post.
View webrtc.js
// Fix Vendor Prefixes
var IS_CHROME = !!window.webkitRTCPeerConnection,
RTCPeerConnection,
RTCIceCandidate,
RTCSessionDescription;
if (IS_CHROME) {
RTCPeerConnection = webkitRTCPeerConnection;
RTCIceCandidate = window.RTCIceCandidate;
RTCSessionDescription = window.RTCSessionDescription;
@deltheil
deltheil / nginx.conf
Created Jun 4, 2012
Hide sensitive GET parameters within nginx access logs thanks to the Lua module
View nginx.conf
http {
log_format filt '$remote_addr - $remote_user [$time_local] "$_request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
server {
location /login {
# `set` is provided by the Rewrite module
set $filter "password|secret";
@liuw
liuw / ctype_async_raise.py
Created Apr 17, 2012
Nasty hack to raise exception for other threads
View ctype_async_raise.py
#!/usr/bin/env python
# liuw
# Nasty hack to raise exception for other threads
import ctypes # Calm down, this has become standard library since 2.5
import threading
import time
NULL = 0
@rnorth
rnorth / gist:2031652
Created Mar 13, 2012
Cookie-based authentication with nginx
View gist:2031652
worker_processes 1;
error_log logs/error.log;
events {
worker_connections 1024;
}