Skip to content

Instantly share code, notes, and snippets.

"""
@package
Output: CSV (comma-separated)
Grouped By: Value
Sorted By: Ref
Fields: Comment,Designator,Footprint,LCSC
Outputs the BOM for JLCPCB. Run this AFTER generating your POS file for SMT assembly.
Attempts to find and modify POS header to JLC format in the same output folder.
@gcormier
gcormier / update-tools.sh
Last active May 28, 2020 14:03
Update terraform and packer
#!/bin/bash
echo "Updating terraform..."
LATEST_URL=$(curl https://releases.hashicorp.com/terraform/index.json --silent | jq -r '.versions[].builds[].url' | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n | egrep -v 'rc|beta' | egrep 'linux.*amd64' |tail -1)
wget -O tf.zip $LATEST_URL --quiet
sudo unzip -o -q tf.zip -d /usr/local/bin
rm tf.zip
echo "Updated /usr/local/bin/terraform to version `terraform version`"
echo "Updating packer..."
@gcormier
gcormier / bashrc-update.sh
Last active August 28, 2019 17:39
bashrc
echo set -g default-terminal "screen-256color" > ~/.tmux.conf
echo set-option -g prefix C-a > ~/.tmux.conf
alias tf=terraform
export PACKER_LOG=1
export PACKER_LOG_PATH=~/.packer/log.txt
@gcormier
gcormier / Mikrotik Update OpenDNS
Last active April 21, 2019 17:07
Update OpenDNS with Mikrotik IP for custom dns settings
:local odnsuser "gcormier@gmail.com"
:local odnspass "password12345!"
# Set the hostname or label of network to be updated. This is the name of your OpenDNS network on the Dashboard.
# Note, you must have admin or edit (Read/Write/Grant in the OpenDNS Dashboard) to update IP addresses.
:local odnshost "Strand"
# May not be needed for your model number - commenting out this line may still work for single interface devices or if this is not supplied in the DNS-O-Matic script currently being used
:local inetinterface "ether1"
PS1='\[\033[0;92m\]\u\[\033[0;96m\] @ \h \w\[\033[0;92m\]$(__git_ps1)\n└─ ▶\[\033[0m\] '
@gcormier
gcormier / PCB-VORON
Last active July 10, 2021 21:44
VORON / Marlin / PCB / FlatCAM
1. Export Gerber file
2. Import into FlatCAM.
3. Make sure units are MM, make sure output format is
"cncjob_coordinate_format": "X%.4f Y%.4f"
4. Tool Diameter on Gerber object has to be small enough to resolve details, but not too big.
Tool Diameter : 0.15
Width : 5
Passe Overlap : 0.7
Select Combine Passes
@gcormier
gcormier / Win10Cleanup.ps1
Created April 18, 2017 22:00
Remove Win10 Bloat
## Removes a lot of crappy Windows 10 built-in applications.
Get-AppxPackage *3dbuilder* | Remove-AppxPackage
Get-AppxPackage *windowsalarms* | Remove-AppxPackage
#Get-AppxPackage *windowscalculator* | Remove-AppxPackage
#Get-AppxPackage *windowscommunicationsapps* | Remove-AppxPackage
Get-AppxPackage *windowscamera* | Remove-AppxPackage
Get-AppxPackage *officehub* | Remove-AppxPackage
Get-AppxPackage *skypeapp* | Remove-AppxPackage
Get-AppxPackage *getstarted* | Remove-AppxPackage
@gcormier
gcormier / ConfigurePHP.bat
Created April 1, 2017 20:49
Setup PHP on Windows Server 2016 / IIS 10
REM PHP Folder, no trailing backslash at the end!
SET PHP_FOLDER=C:\tools\php71
%windir%\system32\inetsrv\appcmd set config /section:system.webServer/fastCgi /+[fullPath='%PHP_FOLDER%\php-cgi.exe']
%windir%\system32\inetsrv\appcmd set config /section:system.webServer/handlers /+[name='PHPviaFastCGI',path='*.php',verb='*',modules='FastCgiModule',scriptProcessor='%PHP_FOLDER%\php-cgi.exe',resourceType='Either']
%windir%\system32\inetsrv\appcmd set config -section:system.webServer/fastCgi /[fullPath='%PHP_FOLDER%\php-cgi.exe'].instanceMaxRequests:10000
%windir%\system32\inetsrv\appcmd set config -section:system.webServer/fastCgi /+[fullPath='%PHP_FOLDER%\php-cgi.exe'].environmentVariables.[name='PHP_FCGI_MAX_REQUESTS',value='10000']
@gcormier
gcormier / plot
Last active November 13, 2016 00:48
Pen plotting setup with a Reprap
; Prepare printer for a regular G28 as if you were going to do a print.
G90 ; Absolute
G28 ; Home
G0 Z15 ; Move axis up (change this to your liking)
M18 ; Disable steppers
; Now, move the carriage to X0 Y0 of your piece of paper (watch out for butterfly clips holding paper down
; Insert the pen and push it firmly onto the paper.
G92 X0 Y0 Z1 ; Reset coords