Skip to content

Instantly share code, notes, and snippets.

View singh-gur's full-sized avatar

Gurbakhshish Singh singh-gur

  • Macquarie Group
  • Philadelphia
View GitHub Profile
version: "3.8"
services:
db:
image: postgres
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=dbuser
- POSTGRES_PASSWORD=dbpass
ports:
@singh-gur
singh-gur / Ender_3_V2_end.gcode
Last active October 12, 2020 01:41
Enver 3v2 GCode
; Ender 3 Custom End G-code
G91 ;Relative positioning
G1 E-2 F2700 ;Retract a bit
G1 E-2 Z0.2 F2400 ;Retract and raise Z
G1 X5 Y5 F3000 ;Wipe out
G1 Z10 ;Raise Z more
G90 ;Absolute positionning
G1 X0 Y{machine_depth} ;Present print
M106 S0 ;Turn-off fan
@singh-gur
singh-gur / cura_mp_u2.gcode
Created August 11, 2020 16:42
Cura MP U2 settings
;(**** start.gcode for Ultimate2 (150S)****)
M104 S170
G28 ; Home extruder
G1 Z140 F300
G28 Z
G29
G1 Z15 F100
M107 ; Turn off fan
G90 ; Absolute positioning
M82 ; Extruder in absolute mode
@singh-gur
singh-gur / mjpg_strm.service
Last active August 10, 2020 23:03
Octoprint setup
[Unit]
Description=MJPG Streamer Service.
After=network.target
[Service]
Type=simple
Restart=always
User=linaro
WorkingDirectory=/home/linaro/dev/repos/github/mjpg-streamer/mjpg-streamer-experimental
ExecStart=/usr/local/bin/mjpg_streamer -i "input_uvc.so -d /dev/video4 -r 1280x720 -f 30" -o "output_http.so -w ./www"
@singh-gur
singh-gur / pyodbc-unixODBC-lambda-layer
Created July 21, 2020 16:53 — forked from diriver63/pyodbc-unixODBC-lambda-layer
pyodbc and unixODBC for MSSQL as a lambda layer
# use https://github.com/lambci/docker-lambda to simulate a lambda environment
docker run -it --rm --entrypoint bash -e ODBCINI=/opt/odbc.ini -e ODBCSYSINI=/opt/ lambci/lambda:build-python3.7
# download and install unixODBC
# http://www.unixodbc.org/download.html
curl ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.7.tar.gz -O
tar xzvf unixODBC-2.3.7.tar.gz
cd unixODBC-2.3.7
./configure --sysconfdir=/opt --disable-gui --disable-drivers --enable-iconv --with-iconv-char-enc=UTF8 --with-iconv-ucode-enc=UTF16LE --prefix=/opt
@singh-gur
singh-gur / set_current.bat
Created March 13, 2020 12:11
Sets the current symbolic link for the given directory, for hot swapping the portable install versions
@echo off
pushd %~dp1
rd current
mklink /J current %~nx1
popd
@singh-gur
singh-gur / go_pbe.go
Created July 19, 2019 06:13
GoLang PBE using SHA256 for creating of the key
package main
import (
"crypto/rand"
"crypto/sha256"
"fmt"
"hash"
"golang.org/x/crypto/nacl/secretbox"
"golang.org/x/crypto/pbkdf2"
@singh-gur
singh-gur / search.bat
Created December 3, 2018 21:10
Create a windows command line search
@echo off
setlocal EnableDelayedExpansion
for %%x in (%*) do (
set searchQ=!searchQ!+%%x
)
set q=%searchQ:~1%
REM echo %q%
start www.google.com/search?q=%q%
@singh-gur
singh-gur / PromisePipeline.ts
Last active May 10, 2018 13:59
Improving promise pileline
import * as Bluebird from 'bluebird';
export type PromiseGenerator<T> = ((T) => Bluebird<T>);
export class PromisePipeline<T> {
private generators: Array<PromiseGenerator<T>>
private scope: T
constructor(generators: Array<PromiseGenerator<T>>, scope: T) {
this.generators = generators;
this.scope = scope;