Skip to content

Instantly share code, notes, and snippets.

:octocat:

Ikiru Yoshizaki guitarrapc

:octocat:
Block or report user

Report or block guitarrapc

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
@guitarrapc
guitarrapc / modify_draining.sh
Created Dec 11, 2019
Modify NLB Draining manually.
View modify_draining.sh
#!/bin/bash
name=your_lb_svc
draining=30
lb=$(kubectl get service $name -o jsonpath="{.status.loadBalancer.ingress[*].hostname}")
arn=$(aws elbv2 describe-load-balancers --query "LoadBalancers[?DNSName=='$lb'].[LoadBalancerArn]" | jq -r '.[][]')
aws elbv2 describe-target-groups --load-balancer-arn $arn | jq -r ".TargetGroups[].TargetGroupArn" | \
xargs -I {} aws elbv2 modify-target-group-attributes --target-group-arn "{}" --attributes Key=deregistration_delay.timeout_seconds,Value=$draining
@guitarrapc
guitarrapc / UnitTest1.cs
Created Nov 29, 2019
dotnet test / dotnet vstest and console output on success. https://github.com/xunit/xunit/issues/1141
View UnitTest1.cs
public class UnitTest1
{
public UnitTest1(ITestOutputHelper output)
{
var listener = new TestTraceListener(output);
Trace.Listeners.Add(listener);
_output = listener;
}
class TestTraceListener : TraceListener
@guitarrapc
guitarrapc / Install-Scoop.ps1
Last active Nov 29, 2019
In case your DockerNAT Network adaptor always reset network profile to public.
View Install-Scoop.ps1
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
scoop update
scoop install sudo
@guitarrapc
guitarrapc / SolutionFileLanguageGUID.md
Created Nov 29, 2019
Visual Studio GUID List to identify Project type.
View SolutionFileLanguageGUID.md
  • VB : 778DAE3C-4631-46EA-AA77-85C1314464D9
  • C# : 9A19103F-16F7-4668-BE54-9A1E7A4F7556
  • F#: F2A71F9B-5D33-465A-A702-920D77279786
  • Solution Folder: 2150E333-8FDC-42A3-9474-1A3956D46DE8
View linqpad.json
{
"version": "6.3",
"homepage": "https://www.linqpad.net",
"description": "The .NET programmer’s playground.",
"license": {
"identifier": "Freeware",
"url": "https://www.linqpad.net/eula.txt"
},
"url": "http://download.linqpad.net/public/LINQPad6.zip",
"hash": "78ae277876f48e594fe4a3ecc8145a29d7ff8439fe43dcf2af537871961aee72",
View macos_psversiontable.ps1
Name Value
---- -----
PSVersion 6.2.3
PSEdition Core
GitCommitId 6.2.3
OS Darwin 18.7.0 Darwin Kernel Version 18.7.0: Tue…
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
View agones-deploy.yaml
apiVersion: "agones.dev/v1"
kind: GameServer
metadata:
name: udp-server
generateName: "simple-udp-"
spec:
ports:
- name: default
portPolicy: Dynamic
containerPort: 7654
@guitarrapc
guitarrapc / ToUpperSnake.cs
Last active Sep 18, 2019
UpperCamel (Pascal) / smallCamel / smallcase to UPPER_SNAKE case.
View ToUpperSnake.cs
void Main()
{
ToUpperSnake("HogeMoge").Dump();
ToUpperSnake("fugafuga").Dump();
ToUpperSnake("hogeMoge").Dump();
ToUpperSnake("PIYOPIYO").Dump();
ToUpperSnake("PIYO_PIYO").Dump();
ToUpperSnake("PIYO_PIYxO").Dump();
ToUpperSnake("piyo_piyo").Dump();
ToUpperSnake("piyo_piYo").Dump();
@guitarrapc
guitarrapc / ArraySizeChange.cs
Created Sep 11, 2019
array size change in C#
View ArraySizeChange.cs
void Main()
{
// resize
var a = new[] { 1, 2, 3 };
Array.Resize(ref a, a.Length + 1); // 突然のref
a[a.Length - 1] = 4;
a.Dump();
// copy
var b = new[] { 1, 2, 3 };
You can’t perform that action at this time.