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 / 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"
View docker-ps.ps1
# https://docs.docker.com/engine/reference/commandline/ps/#formatting
docker ps -a --format "table {{.ID}} \t {{.Image}} \t {{.Status}}"
View cidr-cheatsheet.txt
Netmask Netmask (binary) CIDR Notes
_____________________________________________________________________________
255.255.255.255 11111111.11111111.11111111.11111111 /32 Host (single addr)
255.255.255.254 11111111.11111111.11111111.11111110 /31 Unuseable
255.255.255.252 11111111.11111111.11111111.11111100 /30 2 useable
255.255.255.248 11111111.11111111.11111111.11111000 /29 6 useable
255.255.255.240 11111111.11111111.11111111.11110000 /28 14 useable
255.255.255.224 11111111.11111111.11111111.11100000 /27 30 useable
255.255.255.192 11111111.11111111.11111111.11000000 /26 62 useable
255.255.255.128 11111111.11111111.11111111.10000000 /25 126 useable
@yetanotherchris
yetanotherchris / powershell-rename
Created Apr 24, 2019
Bulk rename files using Powershell
View powershell-rename
get-childitem *.PNG | rename-item -NewName { $_.Name.Replace(".PNG", ".png") }
@yetanotherchris
yetanotherchris / roadkill-install.sh
Created Apr 8, 2019
Install .NET Core 2.2, Docker for Roadkill V3 on Ubuntu 18
View roadkill-install.sh
wget -q https://packages.microsoft.com/config/ubuntu/18.10/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get -y install apt-transport-https
sudo apt-get -y update
sudo apt-get -y install dotnet-sdk-2.2
sudo apt-get -y install git
sudo apt-get -y install docker.io
sudo usermod -aG docker $USER.
git clone https://github.com/roadkillwiki/roadkill_new/
sudo docker run -d -p 5432:5432 --name roadkill-postgres -e POSTGRES_USER=roadkill -e POSTGRES_PASSWORD=roadkill postgres
@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 / DynamoDbRepositoryTests.cs
Created Oct 17, 2018
Integration testing DynamoDB withamazon/dynamodb-local on Docker
View DynamoDbRepositoryTests.cs
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using Amazon.DynamoDBv2;
using Amazon.DynamoDBv2.Model;
using AutoFixture;
using Shouldly;
using Xunit;
namespace SomeTests
@yetanotherchris
yetanotherchris / replace-service-in-servicecollection.cs
Created Oct 9, 2018
Replace type in ServiceCollection for testing
View replace-service-in-servicecollection.cs
public static class ServiceExtensions
{
public static ServiceCollection ReplaceWithFake<T>(this ServiceCollection services) where T : class
{
T fake = Substitute.For<T>();
var descriptor = new ServiceDescriptor(typeof(T), fake.GetType(), ServiceLifetime.Scoped);
services.Replace(descriptor);
return services;
@yetanotherchris
yetanotherchris / travis-install.sh
Last active Sep 17, 2018
installing travis CLI on ubuntu for windows (linux subsystem)
View travis-install.sh
sudo apt update
sudo apt install build-essential
sudo apt install ruby-full
sudo gem install travis
# Example usage
travis encrypt-file travis-appsettings.config
# (Output will give you details of usage)
You can’t perform that action at this time.