Skip to content

Instantly share code, notes, and snippets.

@gcamp806
gcamp806 / initial-ubuntu-config.txt
Created May 9, 2018 14:20
Initial Ubuntu config
apt install vim
sudo update-alternatives --config editor (select vim.basic)
visudo - change %sudo line to this (adding NOPASSWD: in front of ALL)
%sudo ALL=(ALL:ALL) NOPASSWD:ALL
@gcamp806
gcamp806 / .bash_gcamp
Last active May 9, 2018 14:21
My custom bashrc script
#!/bin/bash
# Greg's custom bash stuff
# Executed by ~/.bashrc, e.g. source ~/.bash_gcamp
###export EDITOR='sublime'
# prompt helper functions
function parse_git_dirty
{
if [ -d .git ] || git rev-parse --git-dir > /dev/null 2>&1; then
#[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit, working directory clean" ]] && echo "✘ " || echo "✔ "
@gcamp806
gcamp806 / Constants.swift
Last active May 16, 2018 17:35
Swift constants
struct Const {
struct Mod {
static let job = 6
static let jobInfo = 1
static let jobPhase = 2
static let jobEquip = 3
static let equipment = 5
static let forms = 7
@gcamp806
gcamp806 / timestamp.md
Last active October 24, 2018 14:19
Script to add timestamp to every line of a log file

How to add a timestamp to every line of a log file

There are occasions where you would like to have a log file include a timestamp for each line. The following script will allow you to do just that.

timestamp.sh

#!/bin/bash
while read x; do
    echo -n `date +\[%Y-%m-%d\ %H:%M:%S.%3N]`;
    echo -n " ";
 echo $x;

Keybase proof

I hereby claim:

  • I am gcamp806 on github.
  • I am gcamp (https://keybase.io/gcamp) on keybase.
  • I have a public key ASBt8kErW3itXaSJjU4GGATTTY25OwBJYYG27zvn0FMFCwo

To claim this, I am signing this object:

@gcamp806
gcamp806 / Program.cs
Created June 26, 2019 03:04 — forked from marcel-valdez/Program.cs
Arris TM602A password of the day generator
/*
* Arris TM602A password of the day generator
*
* Author of Original JavaScript Version: Raul Pedro Fernandes Santos
* Author of this C# Code: Marcel Valdez Orozco
* Project homepage for JavaScript Version: http://www.borfast.com/projects/arrispwgen
*
* This software is distributed under the Simplified BSD License.
*
* Copyright 2012 Marcel Valdez Orozco. All rights reserved.
@gcamp806
gcamp806 / auth.dart
Created April 1, 2020 12:31 — forked from nikhilmufc7/auth.dart
Firebase Flutter Platform Exception Codes and example
// Error Codes for SignUp
ERROR_OPERATION_NOT_ALLOWED` - Indicates that Anonymous accounts are not enabled.
ERROR_WEAK_PASSWORD - If the password is not strong enough.
ERROR_INVALID_EMAIL` - If the email address is malformed.
ERROR_EMAIL_ALREADY_IN_USE - If the email is already in use by a different account.
ERROR_INVALID_CREDENTIAL` - If the [email] address is malformed.
// sending password reset email
ERROR_INVALID_EMAIL` - If the [email] address is malformed.
@gcamp806
gcamp806 / homebrew_install_macOS.txt
Last active April 10, 2020 01:35
Homebrew install on macOS
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install libdvdcss
**PRELIMINARY**
// Install Xcode Tools: xcode-select --install
// Install Homebrew: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
**CASK**
//Install Cask brew install cask