Skip to content

Instantly share code, notes, and snippets.

View hastarin's full-sized avatar

Jon Benson hastarin

  • Champion Data
  • Melbourne, Australia
View GitHub Profile
@guitarrapc
guitarrapc / GetSSOProfileCredentials.cs
Last active March 15, 2022 06:20
Reuse AWS SSO Credential in LinqPad or Any C# code. Make sure run `aws sso login` before run code. based on https://github.com/aws/aws-sdk-net/issues/1676
async Task Main()
{
var profile = "YOUR_PROFILE_NAME";
// make sure run `aws sso login` beforehand.
var credentials = await GetSSOProfileCredentials(profile);
// You can omit on local run. For Role credential fallback. Fargate/Lambda/EC2 Instance.
FallbackCredentialsFactory.CredentialsGenerators.Insert(0, () => credentials);
// any operation you want to do with sso credentials.
var s3client = new AmazonS3Client(credentials, RegionEndpoint.APNortheast1);
@tsmoreland
tsmoreland / windows-git-ssh.md
Last active March 20, 2022 23:49
Git/SSH Agent use

GIT/SSH Link

Run the following to set GIT_SSH required for git to use ssh-agent thus avoiding multiple prompts for password (which is less secure so take care)

[Environment]::SetEnvironmentVariable("GIT_SSH", "$((Get-Command ssh).Source)", [System.EnvironmentVariableTarget]::User)

SSH agent automatic startup

run the following to ensure automatic startup

@mimura1133
mimura1133 / install.sh
Last active January 29, 2023 21:24
Enhanced Session for Kali Linux.
#!/bin/bash
# Original : https://raw.githubusercontent.com/Microsoft/linux-vm-tools/master/arch/install-config.sh
###############################################################################
# Update our machine to the latest code if we need to.
#
if [ "$(id -u)" -ne 0 ]; then
echo 'This script must be run with root privileges' >&2
exit 1
@Ikalou
Ikalou / git_and_unity.md
Last active April 22, 2024 04:01
Git and Unity

EDIT: this is an old post and a lof the information in this document is outdated.

Using Git with Unity

Git logo

Git is a popular free and open source distributed version control system.

I am new to Unity, but as a long time git user, I wanted to use git for my

@meinside
meinside / smartctl_test.md
Last active March 20, 2024 21:26
For checking health of usb hdd on raspberry pi with smartctl.

for testing external hdd with smartctl,

install smartmontools

$ sudo apt-get install smartmontools

start test,

@rubensayshi
rubensayshi / 0.intro
Created September 20, 2012 15:09
FML I'm losing it
Somehow this query is 5seconds the first time I run it and 0.000smtsmall seconds the 2nd time, even if do SELECT SQL_NO_CACHE
I already tried optimizing / repairing the tables, even completely dropped and recreated the database ...