Skip to content

Instantly share code, notes, and snippets.

@snzip
snzip / stream_to_youtube.sh
Created January 30, 2020 14:31 — forked from olasd/stream_to_youtube.sh
Stream video to youtube via ffmpeg
#! /bin/bash
#
# Diffusion youtube avec ffmpeg
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée.
VBR="2500k" # Bitrate de la vidéo en sortie
FPS="30" # FPS de la vidéo en sortie
QUAL="medium" # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube
@snzip
snzip / bluetooth-raspberry-pi-communication.py
Created December 14, 2019 08:41 — forked from keithweaver/bluetooth-raspberry-pi-communication.py
Sending information with bluetooth on Raspberry Pi (Python)
# Uses Bluez for Linux
#
# sudo apt-get install bluez python-bluez
#
# Taken from: https://people.csail.mit.edu/albert/bluez-intro/x232.html
# Taken from: https://people.csail.mit.edu/albert/bluez-intro/c212.html
import bluetooth
def receiveMessages():
@snzip
snzip / BU-restore functions in postgresql
Created October 24, 2019 14:33 — forked from denitram/BU-restore functions in postgresql
Postgresql: backup and restore functions
# First, make a dump of the database without data (-s)
$ pg_dump -h localhost -U username -Fc -s -f db_dump dbName
# Create a list of the functions
$ pg_restore -l db_dump | grep FUNCTION > function_list
# Restore the functions in an other database
$ pg_restore -h localhost -U username -d other-dbName -L function_list db_dump
@snzip
snzip / tornado_temp_json_post.py
Created September 30, 2019 01:54 — forked from joshmarshall/tornado_temp_json_post.py
JSON to Arguments POST in Tornado
import tornado.ioloop
import tornado.web
import tornado.httpserver
import tornado.httputil
import json
class MainHandler(tornado.web.RequestHandler):
def post(self):
# do something useful
name = self.get_argument('foo')
@snzip
snzip / gist:5405a5fd0de8ef16b0df658879333492
Created September 28, 2019 11:05 — forked from t3chnoboy/gist:8322246
Convert all files in folder to utf-8 using iconv
# http://stackoverflow.com/questions/4544669/batch-convert-latin-1-files-to-utf-8-using-iconv
find . -type f -exec bash -c 'iconv -f iso-8859-1 -t utf-8 "{}" > /path/to/destination/"{}"' \;
@snzip
snzip / oracle_database_schema_tables_views.sql
Created May 24, 2019 06:59 — forked from luzfcb/oracle_database_schema_tables_views.sql
sql for introspection information about schema, tables, views and other for various database
-- basic doc: http://docs.oracle.com/cd/B19306_01/network.102/b14266/admusers.htm#i1008832
-- get all database schema's name from Oracle Database
-- http://www.orafaq.com/wiki/List_of_default_database_users
-- http://www.adp-gmbh.ch/ora/misc/known_schemas.html
SELECT DISTINCT OWNER
FROM ALL_OBJECTS
WHERE OWNER NOT IN ('APEX_030200', 'CTXSYS', 'DBSNMP', 'EXFSYS',
'MDSYS', 'OLAPSYS', 'ORDDATA', 'ORDPLUGINS',
'ORDSYS', 'PUBLIC', 'SYS', 'SYSTEM', 'WMSYS',
@snzip
snzip / install_sqlplus.md
Created May 8, 2019 08:48 — forked from tcnksm/install_sqlplus.md
How to install oracle client to Ubuntu 12.04

Install SQL*Plus

  1. Download .rpm package here
    • oracle-instantclinet*-basic-*.rpm
    • oracle-instantclinet*-devel-*.rpm
    • oracle-instantclinet*-sqlplus-*.rpm
  2. Install alien (sudo apt-get install alien)
  3. Convert the rpm files and install
    • sudo alien -i oracle-instantclinet*-basic-*.rpm
  • sudo alien -i oracle-instantclinet*-devel-*.rpm
@snzip
snzip / README.md
Created October 17, 2018 16:08 — forked from aaronk6/README.md
launchUri

Cross-browser implementation of navigator.msLaunchUri

Microsoft’s navigator.msLaunchUri method only works in Internet Explorer on Windows 8. Therefore I came up with a (nearly) cross-browser implementation that uses the native msLaunchUri when it’s available and falls back to adventurous hacks when running in other browsers.

Description

launchUri (uri, successCallback, noHandlerCallback, unknownCallback)
@snzip
snzip / esp8266-smart-config.ino
Created October 7, 2018 04:15 — forked from anoochit/esp8266-smart-config.ino
esp8266-smart-config
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
void setup() {
int cnt = 0;
// set for STA mode
WiFi.mode(WIFI_STA);
// put your setup code here, to run once:
@snzip
snzip / rsa_encryption.java
Created August 9, 2018 13:30
how to encrypt & decrypt with RSA in Java
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.PublicKey;
import javax.crypto.Cipher;
public class Sample {