Skip to content

Instantly share code, notes, and snippets.

View bscott's full-sized avatar
🏠
Working from home

Brian Scott bscott

🏠
Working from home
View GitHub Profile
@robconery
robconery / Book.md
Last active November 13, 2024 20:26
Obsidian Bujo Templates
title description author created updated
{{title}}
{{description}}
{{author}}
{"DATE:YYYY-MM-DD HH:mm:ss"=>nil}
{"DATE:YYYY-MM-DD HH:mm:ss"=>nil}

cover|150

@premek
premek / mv.sh
Last active March 5, 2024 17:43
Rename files in linux / bash using mv command without typing the full name two times
# Put this function to your .bashrc file.
# Usage: mv oldfilename
# If you call mv without the second parameter it will prompt you to edit the filename on command line.
# Original mv is called when it's called with more than one argument.
# It's useful when you want to change just a few letters in a long name.
#
# Also see:
# - imv from renameutils
# - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste)
#!/bin/bash
#upgrade chromeos debian stretch to buster (for python 3.7)
#https://www.reddit.com/r/Crostini/comments/9rhauo/upgrade_from_stretch_to_buster_compilation_of/
#Fresh Stretch install. Let's make sure everything is up to date.
sudo apt-get update
sudo apt-get -y --allow-downgrades upgrade
sudo apt-get -y dist-upgrade
#Update package repository to Buster
@npenkov
npenkov / golang.gitlab-ci.yml
Created December 29, 2017 12:57
gitlab-ci for Go projects using go dep.
# Replace "projectname" and "username"
image: golang:1.9
variables:
BIN_NAME: projectname
ARTIFACTS_DIR: artifacts
GO_PROJECT: gitlab.com/username/projectname
stages:
- build
@chluehr
chluehr / restic-backup.sh
Created November 5, 2017 10:57
Backup via restic to Backblaze
#!/bin/bash
#
# Setup:
# wget https://github.com/restic/restic/releases/download/v0.7.3/restic_0.7.3_linux_amd64.bz2
# bunzip2 restic_0.7.3_linux_amd64.bz2
# mv restic_0.7.3_linux_amd64 /usr/local/bin/restic
# chmod a+x /usr/local/bin/restic
#
# crontab -e
# 0 1 * * * /root/bin/restic-backup.sh 2>&1 >>/var/log/restic-backup.log
<%= f.InputTag("Title") %>
<%= f.TextArea("Body", {rows: 10}) %>
<div id="body-preview"></div>
<button class="btn btn-success" role="submit">Save</button>
@SanderTheDragon
SanderTheDragon / postman-deb.sh
Last active October 20, 2024 16:20
A shellscript to create a Postman .deb file, for simple installation on Debian-based Linux distro's. Also creates a .desktop file.
#!/bin/sh
# SPDX-FileCopyrightText: 2017-2024 SanderTheDragon <[email protected]>
#
# SPDX-License-Identifier: MIT
arch=$(dpkg --print-architecture)
echo "Detected architecture: $arch"
case "$arch" in
@jcloutz
jcloutz / .golang-example-gitlab-ci.yml
Last active December 6, 2022 11:20
Example Gitlab CI setup for Go using the official golang docker image
image: golang:1.7
stages:
- build
- test
before_script:
- go get github.com/tools/godep
- cp -r /builds/user /go/src/github.com/user/
- cd /go/src/github.com/user/repo
@welshstew
welshstew / kube-secret-to-file.sh
Last active July 7, 2024 08:40
use jq to pull base 64 things out of a secret and construct them to file
#pull a base64 encoded files out of a kubernetes json secret
oc get secrets/broker-client-secret -o json | jq -r '.data."client.ts"' | base64 -d > client.ts
oc get secrets/broker-server-secret -o json | jq -r '.data."broker.ks"' | base64 -d > broker.ks
oc get secrets/broker-server-secret -o json | jq -r '.data."broker.ts"' | base64 -d > broker.ts
#replace base64 content in a secret - and save to file
THINGY=$(base64 newbroker.ks)
oc get secrets/il3-broker-server-secret -o json | jq -r --arg THINGY $THINGY '.data."broker.ks" = $THINGY' > my-new-secret.json
@ehernandez-xk
ehernandez-xk / upload-file-s3.go
Last active January 31, 2021 00:56
Uploading a file to AWS S3 using aws-sdk-go
/*
https://www.youtube.com/watch?v=iOGIKG3EptI
https://github.com/awslabs/aws-go-wordfreq-sample/blob/master/cmd/uploads3/main.go
https://docs.aws.amazon.com/sdk-for-go/api/aws/
- first configure your aws credentials run: aws configure
- go get -u github.com/aws/aws-sdk-go/aws
- login to UI web aws s3 interface
- go to S3 service