Skip to content

Instantly share code, notes, and snippets.

@c-nv-s
c-nv-s / docker-compose.yml
Last active December 26, 2023 14:12
chartbrew v3 postgres docker compose file
version: "3"
services:
chartbrew:
build: .
restart: always
ports:
- 4018:4018
- 4019:4019
expose:
@c-nv-s
c-nv-s / combine.go
Created November 26, 2023 17:09 — forked from DenoGeek/combine.go
Recombine file chunks
chunkSizeInBytes := 1048576
chunksDir := "/path/to/uploads/temp/3203610240-WildifeTactics"
/*
Generate an empty file
*/
f, err := os.Create("testfile.mp4")
if err != nil {
fmt.Printf("Error: %s", err)
}
// ResumableUpload handles reumable uploads
func ResumableUpload(w http.ResponseWriter, r *http.Request) {
tempFolder := "/path/to/uploads/temp/"
switch r.Method {
case "GET":
resumableIdentifier, _ := r.URL.Query()["resumableIdentifier"]
resumableChunkNumber, _ := r.URL.Query()["resumableChunkNumber"]
path := fmt.Sprintf("%s%s", tempFolder, resumableIdentifier[0])

Problem

The go command line tool needs to be able to fetch dependencies from your private GitLab, but authenticaiton is required.

This assumes your private GitLab is hosted at privategitlab.company.com.

Environment variables

The following environment variables are recommended:

export GO111MODULE=on
export GOPRIVATE=privategitlab.company.com
@c-nv-s
c-nv-s / colorcat.bash
Created October 10, 2023 12:41 — forked from sebastiancarlos/colorcat.bash
Cross-app URL aliases (like shell aliases) powered by Nginx.
#!/usr/bin/env bash
# All my gist code is licensed under the MIT license.
# Video demo: https://www.youtube.com/watch?v=y542zPAPeG4¡™£
# colorcat
# - cats a file, but if any line contains N hex colors, it appends the colors
# (rendered as ansi escape sequences) to the end of the line.
# - input can be stdin, a file, or a hex color in plain text
@c-nv-s
c-nv-s / fonts.bash
Created September 25, 2023 05:28 — forked from sebastiancarlos/fonts.bash
Check your OS fonts from your terminal
#!/usr/bin/env bash
# Video demo: N/A (This script is so dank that YouTube took down my video without explanation)
# Add this to your ~/.bashrc
# custom fc-list
# - sort list
# - add color
# - format table output
@c-nv-s
c-nv-s / history_stuff.sql
Created September 22, 2023 15:32 — forked from slotrans/history_stuff.sql
Building blocks for generic history-keeping in Postgres.
/*
Replace "your_schema" with whatever schema is appropriate in your environment.
It is possible to use "public"... but you shouldn't!
*/
/*
Function to stamp a "modified" timestamp. Adjust the name to suit your environment,
but that name is hard-coded so it is assumed that you only use _one_ such name.
@c-nv-s
c-nv-s / tmsu_scim
Created September 21, 2023 11:36 — forked from nkh/tmsu_scim
tmsu sc-im interface for bash
L=({A..Z})
ToAA() { AA= ; local i=$1 ; (($i == 0)) && AA='@' ; while ((i)) ; do AA="${L[((--i % 26))]}$AA" ; ((i /= 26)) ; done ; }
st()
{
cat <<EOF
color "type=DEFAULT fg=WHITE bg=DEFAULT_COLOR"
color "type=HEADINGS fg=CYAN bg=BLACK bold=0"
color "type=HEADINGS_ODD fg=CYAN bg=BLACK bold=0"
@c-nv-s
c-nv-s / diffc-diffh.bash
Created September 17, 2023 00:27 — forked from sebastiancarlos/diffc-diffh.bash
Custom variations of diff: diffh (diff history) and diffc (diff commands)
#!/usr/bin/env bash
# All my gist code is licensed under the terms of the MIT license.
# Video demo: https://www.youtube.com/watch?v=nf3ddQniw-o
#!/usr/bin/env bash
# diffc - diff commands
# - allows to call as: diffc 'command one' 'command two'
@c-nv-s
c-nv-s / qrshot.sh
Created May 7, 2022 11:08
script to decode qr code from a screenshot
#!/usr/bin/env bash
#
# Siddharth Dushantha 2022
#
# https://github.com/sdushantha/bin
#
image_file="/tmp/ocr.png"
# Check if the needed dependencies are installed