Skip to content

Instantly share code, notes, and snippets.

Connect an IP camera via wired ethernet to an ethernet USB adapter to a Raspberry Pi

Connect the camera to the ethernet USB adapter via a CROSSOVER cable (or via an ethernet switch).

Install DHCP server:

sudo apt install isc-dhcp-server
@turingbirds
turingbirds / upload.php
Last active May 30, 2019 13:40
a simple php upload script
<?php
header("Content-Type: text/html; charset=utf-8");
function display_filesize($filesize) {
if (is_numeric($filesize)) {
$decr = 1024;
$step = 0;
$prefix = array('Byte','KB','MB','GB','TB','PB');
@turingbirds
turingbirds / inkscape_to_dxf.rst
Last active February 24, 2019 18:07
From InkScape to DXF

From InkScape to DXF

1. Save in Inkscape as PDF

Draft your design in InkScape. If there's any text, convert it to a path before or during exporting (Path → Object to Path).

Save as PDF (tested PDF v1.5).

@turingbirds
turingbirds / invoke.py
Last active August 29, 2015 14:16
Execute a child program in a new process
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Execute a child program in a new process"""
import os
import subprocess
def exec_binary(cmd_line_list, cwd=None, stdout=None, stderr=None, verbose=False):
"""Invoke an executable file.
@turingbirds
turingbirds / usbreset.rst
Created October 31, 2014 20:30
usbreset.c