Skip to content

Instantly share code, notes, and snippets.

@mdauphin
mdauphin / node-Red-ai.json
Created November 13, 2023 10:24
Node-RED deeptracking AI detection
[
{
"id": "2fbe43a0.aa5a5c",
"type": "tab",
"label": "NVR Alarm",
"disabled": false,
"info": ""
},
{
"id": "418f6f82.2d31a",
#decode torrent file
import os
import sys
def decode(f):
c = f.read(1)
if c.isdigit(): #string
len = dec_size(f,c)
return f.read(len)
import string
import random
''.join(random.SystemRandom().choice(string.ascii_letters) for _ in range(64))
@mdauphin
mdauphin / notebook_opencv.ipynb
Created December 20, 2016 12:45
Jupyter Notebook OpenCV2 matplotlib and numpy minimal include
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
User nobody
Group nogroup
Port 8888
Listen 127.0.0.1
Timeout 600
DefaultErrorFile "/usr/share/tinyproxy/default.html"
StatFile "/usr/share/tinyproxy/stats.html"
Logfile "/var/log/tinyproxy/tinyproxy.log"
LogLevel Info
PidFile "/var/run/tinyproxy/tinyproxy.pid"
@mdauphin
mdauphin / convert.cmd
Created November 11, 2016 14:06
Convert a m4a folders content to 128k mp3 with ID3Tag by using ffmpeg under windows
for %%F in (*.m4a) do ffmpeg -i "%%F" -ab 128k -map_metadata 0 "%%~nF.mp3"
@mdauphin
mdauphin / VideoLength.vbs
Created October 6, 2016 12:25
Get all videos in argument path and output file size and video length
set objShell = CreateObject("shell.application")
set objFolder = objShell.NameSpace(Wscript.Arguments(0))
For Each fileName in objFolder.Items
set objFolderItem = objFolder.ParseName(fileName)
size = objFolder.GetDetailsOf(objFolderItem, 1)
length = objFolder.GetDetailsOf(objFolderItem, 27)
height = objFolder.GetDetailsOf(objFolderItem, 283)
width = objFolder.GetDetailsOf(objFolderItem, 285)
Wscript.Echo fileName & vbTab & size & vbTab & length & vbTab & height & vbTab & width
@mdauphin
mdauphin / gist:c92567528e900be9b2c3a2a89dbb23eb
Created August 16, 2016 09:25
Retrieve all emails for sugarcrm users
-- Retrieve all emails for sugarcrm users
SELECT user_name, email_addresses.email_address
FROM `users`
JOIN email_addr_bean_rel on bean_id = users.id
JOIN email_addresses on email_addresses.id = email_addr_bean_rel.email_address_id
WHERE status = 'Active' and user_hash is not null and users.deleted = 0 and email_addresses.invalid_email = 0
order by user_name ;
@mdauphin
mdauphin / download.py
Last active August 3, 2016 06:04
Python download RSS podcast
import feedparser
import sys
import urllib2
import os.path
'''
Download all mp3 from rss podcast in current directory
program usage:
python download.py http://url/podcast.rss
'''
@mdauphin
mdauphin / gist:21eb2a09e967862a48fd0d63c6012dbc
Created July 27, 2016 12:48
Build AVRDude from ubuntu for windows
UBUNTU:~/avrdude/avrdude-6.2$ sudo apt-get install bison flex libusb-dev
UBUNTU:~/avrdude/avrdude-6.2$ ./configure --host=i586-w32-mingw32 CC=i586-mingw32msvc-gcc
UBUNTU:~/avrdude/avrdude-6.2$ make