Skip to content

Instantly share code, notes, and snippets.

View leMedi's full-sized avatar
🏠
Working from home

Mehdi ElHaij leMedi

🏠
Working from home
View GitHub Profile
/**
* @param string $dsn DSN string to pass the PDO object. Passed in to prevent tight coupling
* @param string $user Username for a privileged user in the database.
* @param string $password Password matching $user.
*
* @return \PDO
*/
function pdoConnect($dsn, $user, $password) {
$pdo = new PDO($dsn, $user, $password);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
@leMedi
leMedi / ffmpegToWeb.js
Created November 6, 2017 16:30 — forked from moeiscool/ffmpegToWeb.js
FFMPEG to Web Browser with Express, Socket.IO and JSMPEG
// Shinobi (http://shinobi.video) - FFMPEG H.264 over HTTP Test
// How to Use raw H.264 (Simulated RTSP)
// 1. Start with `node ffmpegToWeb.js`
// 2. Get the IP address of the computer where you did step 1. Example : 127.0.0.1
// 3. Open VLC and "Open Network Stream".
// 4. Input the following without quotes : `http://127.0.0.1:8001/h264` and start.
var child = require('child_process');
var events = require('events');
var express = require('express')
@leMedi
leMedi / ARMDebianUbuntu.md
Created February 19, 2018 15:24 — forked from Liryna/ARMDebianUbuntu.md
Emulating ARM on Debian/Ubuntu

You might want to read this to get an introduction to armel vs armhf.

If the below is too much, you can try Ubuntu-ARMv7-Qemu but note it contains non-free blobs.

Running ARM programs under linux (without starting QEMU VM!)

First, cross-compile user programs with GCC-ARM toolchain. Then install qemu-arm-static so that you can run ARM executables directly on linux