Skip to content

Instantly share code, notes, and snippets.

📈
Focusing

Chris S. yetanotherchris

📈
Focusing
Block or report user

Report or block yetanotherchris

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@yetanotherchris
yetanotherchris / gist:4960171
Last active Aug 13, 2019
Double Linked List C# example
View gist:4960171
public static void Main()
{
DoubleLinkedList list = new DoubleLinkedList();
list.Insert("1");
list.Insert("2");
list.Insert("3");
DoubleLink link4 = list.Insert("4");
list.Insert("5");
Console.WriteLine("List: " + list);
@yetanotherchris
yetanotherchris / install-kops.sh
Last active Jul 26, 2019
Install Kops and prequisites on Ubuntu
View install-kops.sh
# Install AWS CLI, Kubectl, Kops
sudo apt update
sudo apt install -y awscli
sudo snap install kubectl --classic
curl -LO https://github.com/kubernetes/kops/releases/download/1.7.0/kops-linux-amd64
chmod +x kops-linux-amd64
mv ./kops-linux-amd64 /usr/local/bin/kops
# Setup the AWS profile
aws config
@yetanotherchris
yetanotherchris / install-rabbitmq.sh
Last active Jul 24, 2019
RabbitMQ on Docker with admin UI
View install-rabbitmq.sh
# AWS specific install of Docker
sudo yum update -y
sudo yum install -y docker
sudo service docker start
sudo usermod -a -G docker ec2-user
# exit the SSH session, login again
# Docker
docker run -d --hostname my-rabbit --name some-rabbit -p 4369:4369 -p 5671:5671 -p 5672:5672 -p 15672:15672 rabbitmq
@yetanotherchris
yetanotherchris / git-config.ps1
Created Apr 3, 2019
Set git to use a different email (per repository)
View git-config.ps1
git config --local user.email "chrisTHISPARTISFAKEsmall+github@gmail.com"
@yetanotherchris
yetanotherchris / google-cloud-pubsub-example.cs
Last active Jul 19, 2019
Google Cloud Pub/Sub C# example
View google-cloud-pubsub-example.cs
//
// Google Cloud Pub/Sub C# example
// NOTE: This is a .NET Core 1.1 console app.
// Use "dotnet run" to run it, run setup.ps1 first.
//
using System;
using System.Collections.Generic;
using Google.Cloud.PubSub.V1;
using Google.Protobuf;
@yetanotherchris
yetanotherchris / docker-automation.py
Created Sep 5, 2016
Automating Docker images and containers with Python ()
View docker-automation.py
'''
This script brings up the entire stack of Docker containers, removing the current ones.
Docker compose was tried for this task and it wasn't customisable enough.
Docker cloud was tried (with stack files) and was buggy (failed to launch, no logs returned).
Docker machine was tried, but it can't connect to existing servers only ones it created.
Rancher was too heavy weight for the task, as the containers are lightweight in DigitalOcean.
Kubernetes would've been too heavy weight for DigitalOcean.
It was written in Powershell and worked. But then converting it to Bash was too much effort.
Powershell for Linux is too much effort to install without a debian package (and none standard)
@yetanotherchris
yetanotherchris / install-mono-amazon-linux.sh
Last active Jul 12, 2019
Install Mono on Amazon Linux (CentOS too)
View install-mono-amazon-linux.sh
sudo yum update -y
echo "======= INSTALLING RPM FOR MONO ======="
sudo mkdir -p /tmp/mono_dependencies
cd /tmp/mono_dependencies
sudo wget https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/Packages/l/libpng15-1.5.27-1.fc25.x86_64.rpm
sudo yum install -y libpng15-1.5.27-1.fc25.x86_64.rpm
echo "======= INSTALLING MONO ============"
sudo yum install -y yum-utils
@yetanotherchris
yetanotherchris / gist:4953115
Last active Jul 7, 2019
Syntax highlighter for C#
View gist:4953115
/// <summary>
/// A basic implementation of a pretty-printer or syntax highlighter for C# soure code.
/// </summary>
public class SourceColorer
{
private string _commentCssClass;
private string _keywordCssClass;
private string _quotesCssClass;
private string _typeCssClass;
private bool _addStyleDefinition;
@yetanotherchris
yetanotherchris / git.sh
Created Jun 26, 2019
visualise github branch history
View git.sh
git log --oneline --graph --decorate --all
@yetanotherchris
yetanotherchris / gitlog.sh
Last active Jun 19, 2019
Git log prettier version
View gitlog.sh
git log -n2 --pretty="format:[%cD] %an : %s"
You can’t perform that action at this time.