Skip to content

Instantly share code, notes, and snippets.

View mdeweerd's full-sized avatar

MDW mdeweerd

  • France
View GitHub Profile
@mdeweerd
mdeweerd / example.puml
Last active July 3, 2020 21:20 — forked from QuantumGhost/example.puml
A simple template for PlantUML to draw ER diagram.The basic idea comes from http://plantuml.sourceforge.net/qa/?qa=331/database-modeling
@startuml
' uncomment the line below if you're using computer with a retina display
' skinparam dpi 300
!define Table(name,desc) class name as "desc" << (T,#FFAAAA) >>
' we use bold for primary key
' green color for unique
' and underscore for not_null
!define primary_key(x) <b>x</b>
!define unique(x) <color:green>x</color>
!define not_null(x) <u>x</u>
<?php
$isAjaxUpdate=Yii::app()->request->isAjaxRequest;
if(!$isAjaxUpdate||Yii::app()->request->getParam('ajax')==='mygridid')
$this->widget('zii.widgets.grid.CGridView',
array(
'id'=>'mygridid',
'dataProvider' => new CArrayDataProvider(
array(
array(
'id'=>1,
@mdeweerd
mdeweerd / Multipcap.pl
Last active April 20, 2021 00:47
wireshark / pcap tools
#!/usr/bin/env perl
# multipcap.pl
# License MIT + Any article (blog, site, documentation, etc)
# should link back to this page.
# Link : https://gist.github.com/mdeweerd/4bf3375b2ec56b5492a7a4695e19e92e
use strict;
#use File::PCAP::Reader; # Needed to read the pcap file
#use File::PCAP::Writer; # Needed to write the pcap file
@mdeweerd
mdeweerd / logToPcap.pl
Last active May 27, 2021 22:14
Perl script to convert a regular log file as syslog messages in a pcap file for wireshark
#!/bin/perl
# SCRIPT TO CONVERT TEXT LOG TO PCAP FILE
# READS DATES FROM LOG FILE
# WHEN READING FROM PIPE (UNTESTED) WITHOUT DATES,
# THE CURRENT TIMESTAMP IS USED.
#
# Potential parameters to the script:
# Parameter ending in ".log" is the log input file
# Parameter ending in ".pcap" is the log output file
# Digit from 0 to 7 is the log index.
@mdeweerd
mdeweerd / KICAD_GENERATE_GERBER.BAT
Last active October 23, 2021 12:54 — forked from Salamandar/kicad_generate_gerber.py
Python script that generates Gerber, Drill map, Position file, and zips everything.
@echo OFF
REM
REM WRAPPER FOR WINDOWS INCLUDING THE PYTHON PATH FROM KICAD ITSELF
REM
REM GIT: git@gist.github.com:df5b6a1462d3052a42dbaa0e35a5b952.git
REM URL: https://gist.github.com/df5b6a1462d3052a42dbaa0e35a5b952
REM
PATH="c:\Program Files\KiCad\bin";%PATH%
echo %~dp0
@mdeweerd
mdeweerd / doBomHtml.sh
Created October 24, 2021 14:45
Script to generate Interactive BOM (runs on cygwin).
#!/bin/bash -x
#
# Generate Interactive BOM2HTML
#
# Only argument is .kicad_brd file
#
# Options can be set in 'bomhtml.conf' located in the directory of DESIGN.kicad_brd
# Can set KICAD_PYTHON in environment to change path.
KICAD_PYTHON=${KICAD_PYTHON:=/cygdrive/c/Program\ Files/KiCad/bin/python}
@mdeweerd
mdeweerd / YouTube Video Data Tool.html
Last active October 31, 2021 13:25 — forked from jgrant41475/YouTube Video Data Tool.html
Fetches YouTube Video Information and creates a json-ld Video Object
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Foundation | Welcome</title>
<!-- <link rel="stylesheet" href="css/foundation.css" /> -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.7.3/css/foundation.min.css" integrity="sha512-2meDMHyoDRV8O0gr5Diq32ch+6QqI9Af9Km4eFwgxZg356CbUI4S30C3zuUetkNAN4Bn+17y9OgxoQ3HnQ648w==" crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
<body>
@mdeweerd
mdeweerd / motion_controlled_scenes_with_sun_elevation_check.yaml
Created November 6, 2021 16:39 — forked from Martinnygaard/motion_controlled_scenes_with_sun_elevation_check.yaml
Homeassistant blueprint for motion-activated light scene with sun elevation sensor
blueprint:
name: Motion-activated light scene with optional ambient scene with sun elevation sensor
description: Turn on a light scene when motion is detected and the sun is below given threshold. Four different scenes can be defined depending on time of day.
domain: automation
source_url: https://gist.github.com/Martinnygaard/7645dcee2ca03d18c7a9523aa592605b
input:
motion_entity:
name: Motion Sensor
description: Choose which motion sensor to use. If multiple motion sensors should trigger this automation, then group them in a template sensor or regular group.
selector:
#!/bin/bash -xv
### Country list
# CHANGE WITH YOUR COUNTRIES
COUNTRIES="europe/france/guadeloupe europe/france/guyane europe/france/mayotte europe/france/martinique europe/france/reunion europe/france"
# SMALL SUBSET FOR TESTING:
COUNTRIES="europe/france/guyane europe/france/mayotte"
NOMINATIM="/var/www/Nominatim"
cd $NOMINATIM/data
  • Task 1
  • Task 2
  • Task 3
  • Task 4
  • Task 3
  • Task 4 tab later

No list item:

[x] Task without list.