Skip to content

Instantly share code, notes, and snippets.

View jasonwbarnett's full-sized avatar

Jason Barnett jasonwbarnett

View GitHub Profile

How to migrate grandcentral user's desktop to network share

  1. Login to grandcentral as admindsalvo
  2. In a folder, go to C:\Users
  3. Click on the user you're trying to migrate (e.g. gcasebeer)
  4. Rename the Desktop directory to Desktop.old
  5. Drag
  6. (\\dc4\Users$\\Desktop)
#!/bin/bash
sudo -s
apt-get clean
apt-get update
apt-get install openssh-server -y
passwd kubuntu
# enter password: AllVideo123! -- it will ask you to enter it twice.
#!/bin/bash
PROJECT="win-lust"
ZONE="us-east1-b"
gcloud compute --project $PROJECT instances create --zone $ZONE --machine-type "n1-standard-1" --subnet "winlust" --metadata-from-file="startup-script=master_startup.sh" --maintenance-policy "MIGRATE" --image "ubuntu-1604-xenial-v20170125" --image-project "ubuntu-os-cloud" --no-scopes $(seq -s ' ' -f "saltmaster%03g" 3)
gcloud compute --project $PROJECT instances create --zone $ZONE --machine-type "f1-micro" --subnet "winlust" --metadata-from-file="startup-script=minion_startup.sh" --maintenance-policy "MIGRATE" --image "ubuntu-1604-xenial-v20170125" --image-project "ubuntu-os-cloud" --no-scopes $(seq -s ' ' -f "saltminion%03g" 20)

DELETE ME

@jasonwbarnett
jasonwbarnett / main.go
Created May 29, 2015 19:19
This is an example of how we might nest multiple mux.Routers. This is especially useful if we want to later wrap our nested router with Negroni.
package hello
import (
"fmt"
"net/http"
"github.com/gorilla/mux"
)
func init() {
def mad_based_outlier(points, thresh=3.5):
if len(points.shape) == 1:
points = points[:,None]
median = np.median(points, axis=0)
diff = np.sum((points - median)**2, axis=-1)
diff = np.sqrt(diff)
med_abs_deviation = np.median(diff)
modified_z_score = 0.6745 * diff / med_abs_deviation
@jasonwbarnett
jasonwbarnett / 0_reuse_code.js
Last active August 29, 2015 14:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
module HashConverter
class << self
def to_underscore hash
convert hash, :underscore
end
def to_camel_case hash
convert hash, :camelize
end
def convert obj, *method
case obj
#!/bin/bash
# Note: Works with bash 4.x and above only #
# STOLEN FROM: http://www.cyberciti.biz/tips/unix-linux-bash-shell-script-wrapper-examples.html
# curl -I http://cyberciti.biz/
# ping -v -c 2 !!:2
# host -t aaaa !!:4
# host -t mx !!:3
# host -t a ftp://nixcraft.com/
# host -a ftp://nixcraft.com/
# ping 8.8.8.8