Skip to content

Instantly share code, notes, and snippets.

View mdeweerd's full-sized avatar

MDW mdeweerd

  • France
View GitHub Profile
@mdeweerd
mdeweerd / convert_shape.py
Last active December 3, 2023 15:21 — forked from slazav/convert_shape.py
Convert OpenSCAD files to STEP or IGES using FreeCAD python library
#!/usr/bin/env /cygdrive/c/Program Files/FreeCAD 0.21/bin/python
#!/usr/bin/env /cygdrive/c/Program Files/FreeCAD 0.20/bin/python
#!/usr/bin/env python3
#!/usr/bin/env /cygdrive/c/Program Files/FreeCAD 0.20/bin/FreeCAD
#!/usr/bin/env /cygdrive/c/Program Files/FreeCAD 0.20/bin/FreeCADCmd
#!/usr/bin/freecad
#!/usr/bin/python
# (Options above for reminder, easy exchange of lines to adapt to local platform).
# /!\ Launch this script using the python provided/used by FreeCAD
# (Select/add the appropriate line above)
@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 / 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: [email protected]:df5b6a1462d3052a42dbaa0e35a5b952.git
REM URL: https://gist.github.com/df5b6a1462d3052a42dbaa0e35a5b952
REM
PATH="c:\Program Files\KiCad\bin";%PATH%
echo %~dp0
@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 / 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>
#!/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
<?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,