Skip to content

Instantly share code, notes, and snippets.

@simoncos
simoncos / golang_on_rpi.md
Last active March 30, 2024 17:56 — forked from konradko/golang_on_rpi.md
Install Golang 1.9 on Raspberry Pi

Install Golang 1.9:

wget https://storage.googleapis.com/golang/go1.9.linux-armv6l.tar.gz
sudo tar -C /usr/local -xzf go1.9.linux-armv6l.tar.gz
export PATH=$PATH:/usr/local/go/bin # put into ~/.profile

If already installed old golang with apt-get:

@Necroforger
Necroforger / embed.go
Last active April 6, 2024 02:22
Needs a fallthrough
//Embed ...
type Embed struct {
*discordgo.MessageEmbed
}
// Constants for message embed character limits
const (
EmbedLimitTitle = 256
EmbedLimitDescription = 2048
EmbedLimitFieldValue = 1024
@DerfOh
DerfOh / cygwin-colors-email.md
Last active December 21, 2016 17:42
Changing cygwin colors

ls --color scheme

From: "Robert Mark Bram"

To: "Cygwin"

Date: Wed, 12 Jun 2002 02:44:32 +1000

Subject: ls --color scheme

Howdy all!

For the record, this is what I have found out about changing ls color scheme.

@taoyuan
taoyuan / npm-using-https-for-git.sh
Last active April 27, 2024 01:22
Force git to use https:// instead of git://
# npm using https for git
git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://".insteadOf git://
# npm using git for https
git config --global url."git@github.com:".insteadOf https://github.com/
git config --global url."git://".insteadOf https://
@gbaman
gbaman / HowToOTG.md
Last active May 2, 2024 01:27
Simple guide for setting up OTG modes on the Raspberry Pi Zero

Raspberry Pi Zero OTG Mode

Simple guide for setting up OTG modes on the Raspberry Pi Zero - By Andrew Mulholland (gbaman).

The Raspberry Pi Zero (and model A and A+) support USB On The Go, given the processor is connected directly to the USB port, unlike on the B, B+ or Pi 2 B, which goes via a USB hub.
Because of this, if setup to, the Pi can act as a USB slave instead, providing virtual serial (a terminal), virtual ethernet, virtual mass storage device (pendrive) or even other virtual devices like HID, MIDI, or act as a virtual webcam!
It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.
It is also important to note, that a USB to UART serial adapter is not needed for any of these guides, as may be documented elsewhere across the int

@iamralch
iamralch / ssh_client.go
Last active April 16, 2023 03:09
SSH client in GO
package main
import (
"fmt"
"io"
"io/ioutil"
"net"
"os"
"strings"
@imbradbrown
imbradbrown / upload-ssec.sh
Last active November 30, 2022 06:20
Uploading to Amazon S3 from curl with Server Side Encrpytion - Customer Provided Key used. Note that this uses the Amazon Access Keys which should be used with care.
#!/bin/bash
## file to upload.
S3_UPLOAD_FILE=some/path/file.txt
## Specify the bucket name here. This can be found in the S3 console
S3_BUCKET=bucket name here
## The desired path relative to the root of the bucket. All folders must be forward slash '/' separated
S3_DESTINATION_FILE=folder/folder2/file.txt
@unicolet
unicolet / rd-clean.sh
Created April 8, 2015 10:40
Shell script to purge Rundeck execution history
#!/bin/sh
# setup ~/.pgpass to allow passwordless connection to postgres
# keep last 30 executions for each job
KEEP=30
cd /var/lib/rundeck/logs/rundeck
JOBS=`find . -maxdepth 3 -path "*/job/*" -type d`

Git Cheat Sheet

Commands

Getting Started

git init

or

@matschaffer
matschaffer / Vagrantfile
Last active January 25, 2017 18:07
An _almost_ working vagrant setup for rebuilding nginx to include ldap support
Vagrant.configure(2) do |config|
config.vm.box = 'ubuntu/trusty64'
config.vm.provider 'virtualbox' do |v|
v.memory = 4096
v.cpus = 8
end
config.vm.network 'private_network', ip: '192.168.33.10'
config.vm.hostname = 'build.vagrant.stellar-ops.com'