Skip to content

Instantly share code, notes, and snippets.

View giseongeom's full-sized avatar
💭
I may be slow to respond.

GiSeong Eom giseongeom

💭
I may be slow to respond.
View GitHub Profile
@giseongeom
giseongeom / install-context-open-with-cmd.reg
Last active April 2, 2024 17:22
Open shell with conhost (without Windows Terminal)
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\Directory\shell\Open with &CMD]
@="Open with &CMD"
"Icon"="C:\\Windows\\System32\\conhost.exe"
[HKEY_CURRENT_USER\Software\Classes\Directory\shell\Open with &CMD\command]
@="C:\\Windows\\System32\\conhost.exe cmd /s /k pushd \"%V\""
@giseongeom
giseongeom / update-mac-keyconfig.bash
Last active August 26, 2022 08:56
Change windows menu key as Mac option using hidutil
# hidutil property --set '{"UserKeyMapping":[ { "HIDKeyboardModifierMappingSrc": 0x700000065, "HIDKeyboardModifierMappingDst": 0x7000000E6 } ]}'
hidutil property --set '{"UserKeyMapping":[
{
"HIDKeyboardModifierMappingSrc": 0x700000065,
"HIDKeyboardModifierMappingDst": 0x7000000E6
},
]}'
@giseongeom
giseongeom / install-latest-golang.sh
Last active March 11, 2023 11:14
Download latest golang (linux-amd64)
#!/usr/bin/env bash
set -e
if [ "$(id -u)" -ne 0 ]; then
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
exit 1
fi
# go1.19.linux-amd64.tar.gz
export GO_DOWNLOAD_FILE=$(curl -L -Ss https://go.dev/dl/\?mode\=json | jq -r '.[0].files[] | select(.arch == "amd64") | select(.os == "linux") | .filename')
@giseongeom
giseongeom / install-curl-tcping-alpine.sh
Created February 22, 2022 13:25
Install curl/tcping on Alpine Linux
apk --no-cache add curl
curl -L -Ss "https://github.com/cloverstd/tcping/releases/download/v0.1.1/tcping-linux-amd64-v0.1.1.tar.gz" -o "/tmp/tcping-linux.tgz"
tar zxf /tmp/tcping-linux.tgz -C /usr/local/bin && cd /usr/local/bin/ && chown root.root tcping && chmod 755 tcping
@giseongeom
giseongeom / check-aws-iam-account.ps1
Created December 15, 2021 15:48
Check AWS IAM User last used and login date
#Requires -version 5.1
function Check-IAMUserLastUsed () {
param
(
[Parameter(Mandatory = $true)]
[string]$UserName,
[Parameter(Mandatory = $false)]
[int]$TargetDays = 180,
@giseongeom
giseongeom / update-git-repo-remote-url.ps1
Last active September 6, 2021 03:29
Update multiple git repository's remote-url
#Requires -version 5.1
cd C:\Users\giseong.eom\Source
$repolist1 = dir -Directory -Exclude archived C:\Users\giseong.eom\Source | % { $_.FullName }
$repolist2 = (
"c:\Users\giseong.eom\.dotfiles",
"c:\Users\giseong.eom\tools"
)
$repolist = $repolist1 + $repolist2
@giseongeom
giseongeom / install-linux-homebrew.sh
Last active August 3, 2022 08:21
Install (Linux) Homebrew non-interactively
#!/usr/bin/env bash
set -e
# Unattended install of homebrew
# https://docs.brew.sh/Installation#unattended-installation
export NONINTERACTIVE=1 && /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Adding Homebrew to your PATH
# https://docs.brew.sh/Homebrew-on-Linux
test -d ~/.linuxbrew && eval "$(~/.linuxbrew/bin/brew shellenv)"
@giseongeom
giseongeom / verify-cert-expire-date.ps1
Last active November 29, 2022 07:52
Check Cert status (openssl)
#Requires -version 5.1
[CmdletBinding()]
Param(
[Parameter(Mandatory = $false)]
[string]$list_file_path = 'list.txt'
)
# Tools
@giseongeom
giseongeom / enable-openssh-for-windows.ps1
Last active February 22, 2023 13:57
Enable OpenSSH for Windows (Windows 10/11)
#Requires -version 5
#Requires -RunAsAdministrator
# Enable tls1.2 from default (SSL3, TLS)
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Ssl3 -bor [Net.SecurityProtocolType]::Tls -bor [Net.SecurityProtocolType]::Tls11 -bor [Net.SecurityProtocolType]::Tls12
# Enable TLS1.2 permanently
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord -Force
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord -Force
@giseongeom
giseongeom / get-EC2TypeList.ps1
Last active August 4, 2020 06:27
Retrieve AWS EC2 instance types (Scope: region)
#Requires -version 5.1
Param ([string]$region = 'ap-northeast-2')
Import-Module AWS.Tools.Common
Import-Module aws.tools.ec2
Param ([string]$region = 'ap-northeast-2')
Set-AWSCredential -ProfileName default
Set-DefaultAWSRegion -Region $region