Skip to content

Instantly share code, notes, and snippets.

View kordless's full-sized avatar
🦥
sloth mode

Коrd Campbell kordless

🦥
sloth mode
View GitHub Profile
#!/bin/bash
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 4 | head -n 1)
SERVER_NAME=ubuntu-dev-$NEW_UUID
gcloud compute instances create $SERVER_NAME \
--machine-type "n1-standard-1" \
--image "ubuntu-1604-xenial-v20170811" \
--image-project "ubuntu-os-cloud" \
--boot-disk-size "10" \
--boot-disk-type "pd-ssd" \
--boot-disk-device-name "$NEW_UUID" \
@kordless
kordless / start-fusion.sh
Last active August 18, 2021 18:44
Script to start Lucidworks Fusion from Google Cloud Console
#!/bin/bash
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 4 | head -n 1)
gcloud compute instances create fusion-server-$NEW_UUID \
--machine-type "n1-standard-8" \
--image "ubuntu-1604-xenial-v20170811" \
--image-project "ubuntu-os-cloud" \
--boot-disk-size "50" \
--boot-disk-type "pd-ssd" \
--boot-disk-device-name "$NEW_UUID" \
--zone us-west1-b \
@kordless
kordless / envoy.md
Last active July 3, 2018 10:31
Deploy an L7 Envoy Proxy on Google Container Engine

Note: This tutorial was created for a pull request on the community repo for Google Cloud Services. As of 7/6/17, it still hasn't been "approved" by Google, so I'm putting it here because I need it. Thanks to @kflynn at @datawire for the hard work.

Deploy an L7 Envoy Proxy on Google Container Engine

One of the recurring problems with using microservices is managing communications. Your clients need to be able to speak to your services, and in most cases services need to speak amongst themselves. When things go wrong, the system as a whole needs to be resilient, so that it degrades gracefully instead of catastrophically, but it also needs to be observable so that you can figure out what's wrong.

A useful pattern is to enlist a proxy, like Envoy to help make your application more resilient and observable. Envoy can be a bit daunting to set up, so this tutorial will walk you throu

@kordless
kordless / README.md
Last active June 19, 2023 15:50
Rust Server Deployment for Google Container Engine

Howdy Y'all! I'm @kordless on YouTube and I occasionally play and stream Rust, the game.

This repo is for deploying a Rust Server running on Google Container Engine. Google has a deal going where you can get $300 of free credits for a year on Google Cloud, so it's a good excuse to signup and run your own server. And no, I don't work for Google!

This deployment uses an image built by @dids, which is hosted on Docker Hub: https://hub.docker.com/r/didstopia/rust-server/

This deployment method can be used to start a small server to play with friends or practice building things. In a few days, I'll update the scripts to include a way to save the content you've created, in-game, with others who can then run their own servers and load your content in to explore it for themselves.

For now, start by navigating to Google Cloud and signup for an account. You'll need to enter some credit card details to get this going, but Google is giving you $300 in credits for the next year. Should be e

// This #include statement was automatically added by the Particle IDE.
#include "HttpClient/HttpClient.h"
#include "InternetButton/InternetButton.h"
#include "WebServer.h"
// network stuff
TCPClient webClient;
WebServer webserver("/", 80);
unsigned char httpProto[100];
String httpString = "";

The dataalchemy.js code requres a Particle Photon. Flash the code to the Photon using the Particle Web IDE.

Instructions for generating tokens are here: https://docs.particle.io/reference/api/#generate-an-access-token

Once you've flashed the code to the Photon, you can use this Python code to talk to the Photon directly by IP:

import requests, json

PARTICLE_URL = "https://api.particle.io/v1/devices"
@kordless
kordless / README.md
Last active August 29, 2015 14:21
StackMonkey Quick and Dirty APIs
@kordless
kordless / file.md
Last active August 29, 2015 14:17 — forked from MarcelMue/file.md

#Using the giantswarm CLI on Windows with boot2docker without a additional VM

####prerequisites:

  • Boot2docker should be running on your system and you should have access to it with boot2docker ssh
  • A filepath of your windows system should be mirrored in boot2docker (eg windows C:\\Users\Username should be boot2docker /c/Users/Username)
  • Have a decent console setup to make the following steps easier ( I use Console 2)

####Setup

  • Switch to your boot2docker with boot2docker ssh and download the swarm cli to a location mirrored by windows (eg your project folder) by executing curl -O http://downloads.giantswarm.io/swarm/clients/0.15.0/swarm-0.15.0-linux-amd64.tar.gz
  • run tar xzf swarm-0.15.0-linux-amd64.tar.gzat the same location
// if the input format is wrong
if(argCount != 2)
{
printf("usage: cd directoryName\n");
}
else // if the user input is valid
{
int i, index = -1;
for(i = 0; i < funix->currentDirectory->numSubdirectories; i++)
@kordless
kordless / README.md
Last active August 29, 2015 14:13
Utter.io Application Sample

Sample Project

Edit this file to show additional information to users launching an instance to demo your project. The filename must be README.md. The file will be shown to the user on a page during various stages of instance boot and provisioning. The page will be updated as the state of the instance is updated.

Templating

The following template variables are available for use in the README.md file:

{{ project_name }}
{{ project_url }}
{{ donation_address }}

{{ port }}