Skip to content

Instantly share code, notes, and snippets.

View JeanSebTr's full-sized avatar

Jean-Sébastien Tremblay JeanSebTr

View GitHub Profile
@jedy
jedy / go_scp.go
Last active May 31, 2022 07:20
an example of scp in golang
// https://blogs.oracle.com/janp/entry/how_the_scp_protocol_works
package main
import (
"fmt"
"golang.org/x/crypto/ssh"
)
const privateKey = `content of id_rsa`
@PaulStovell
PaulStovell / 01 - Command line
Last active December 15, 2015 02:19
How Octopus will invoke ScriptCS scripts.
tentacle run-script -f Hello.csx -v Hello=Bar
@phillip-haydon
phillip-haydon / boxstarter-script
Last active October 1, 2023 22:02
My Boxstarter Script
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Set-StartScreenOptions -EnableBootToDesktop -EnableDesktopBackgroundOnStart -EnableShowStartOnActiveScreen -EnableShowAppsViewOnStartScreen -EnableSearchEverywhereInAppsView -EnableListDesktopAppsFirst
Install-WindowsUpdate -acceptEula
cinst notepad2
cinst SublimeText3
cinst sublimetext3-contextmenu
cinst git-credential-winstore
cinst ConEmu
cinst poshgit
@johnkattenhorn
johnkattenhorn / HostEnvironment.ps1
Created January 19, 2015 11:31
Boxstarter Script for Host Environment
function SetPowerPlan([string]$PreferredPlan)
{
Write-Host "Setting Powerplan to $PreferredPlan"
$guid = (Get-WmiObject -Class win32_powerplan -Namespace root\cimv2\power -Filter "ElementName='$PreferredPlan'").InstanceID.tostring()
$regex = [regex]"{(.*?)}$"
$newpowerVal = $regex.Match($guid).groups[1].value
# setting power setting to high performance
powercfg -S $newpowerVal
}
@philchuang
philchuang / phil-dev-vm.boxstarter.package.ps1
Last active December 17, 2022 22:08
Personal dev boxstarter scripts
######## Phil's dev VM boxstarter script ########
###############
#### NOTES ####
###############
## After a restart/reconnect, even though it shows the login screen, boxstarter is still working
### NOTES when kicking off remotely from host to VM, fails on Configuring CredSSP settings
## check http://blogs.technet.com/b/heyscriptingguy/archive/2012/12/30/understanding-powershell-remote-management.aspx
@kriegsman
kriegsman / TwinkleFOX.ino
Last active January 9, 2024 02:20
TwinkleFOX: Colored Twinkling Holiday Lights
#include "FastLED.h"
#if defined(FASTLED_VERSION) && (FASTLED_VERSION < 3001000)
#warning "Requires FastLED 3.1 or later; check github for latest code."
#endif
#define NUM_LEDS 100
#define LED_TYPE WS2811
#define COLOR_ORDER GRB
@darconeous
darconeous / kidde-interconnect.md
Last active July 10, 2024 23:44
kidde-interconnect

Original "dumb" smoke detector interconnect sounds the siren on all interconnected smoke detectors when a 9-to-12 volt (referenced to neutral/white) direct-current signal is continuously present on the signal wire (red). This still how pretty much all interconnected smoke alarms indicate a fire condition.

However, modern interconnected detectors are capable of detecting carbon monoxide and other conditions. When these conditions are signaled, they must be identified as something other than a smoke alarm by the other detectors. Ideally, any dumb smoke detectors

@paulirish
paulirish / coverage.js
Created July 12, 2017 20:15
JS coverage profiler data via protocol
'use strict';
const chromeLauncher = require('chrome-launcher');
const CDP = require('chrome-remote-interface');
const launchChrome = () =>
chromeLauncher.launch({
chromeFlags: ['--disable-gpu', '--headless']
});
@remi
remi / shc.js
Last active March 2, 2022 14:32
Extract JSON object from https://smarthealth.cards QR code
// Extract JSON payload from SHC QR code (without any kind of private/public key verification)
// Credits + inspiration
// https://github.com/dvci/health-cards-walkthrough/blob/main/SMART%20Health%20Cards.ipynb
// Usage
// $ node shc.js "shc:/01234569…"
const zlib = require("zlib");