Skip to content

Instantly share code, notes, and snippets.

@mao-kt
mao-kt / multiple-ssh-authkeys.md
Created June 22, 2021 16:44 — forked from otkrsk/multiple-ssh-authkeys.md
Add multiple SSH keys to the authorized_keys file to enable SSH authentication when connecting to a server.

Step 1: Generate first ssh key Type the following command to generate your first public and private key on a local workstation. Next provide the required input or accept the defaults. Please do not change the filename and directory location.

workstation 1 $ ssh-keygen -t rsa

Finally, copy your public key to your remote server using scp

@mao-kt
mao-kt / aws-sns-example.js
Created December 17, 2020 02:45 — forked from tmarshall/aws-sns-example.js
aws-sdk sns example, in Node.js
var AWS = require('aws-sdk');
AWS.config.update({
accessKeyId: '{AWS_KEY}',
secretAccessKey: '{AWS_SECRET}',
region: '{SNS_REGION}'
});
var sns = new AWS.SNS();
@mao-kt
mao-kt / multiple_ssh_setting.md
Created November 7, 2020 09:23 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@mao-kt
mao-kt / osx_bootstrap.sh
Created July 7, 2020 10:06 — forked from codeinthehole/osx_bootstrap.sh
Script to install stuff I want on a new OSX machine
#!/usr/bin/env bash
#
# Bootstrap script for setting up a new OSX machine
#
# This should be idempotent so it can be run multiple times.
#
# Some apps don't have a cask and so still need to be installed by hand. These
# include:
#
# - Twitter (app store)
@mao-kt
mao-kt / brew-install-script.sh
Created July 7, 2020 10:06 — forked from CliffordAnderson/brew-install-script.sh
Brew script for installing packages and applications on OSX
#!/bin/sh
# Homebrew Script for OSX
# To execute: save and `chmod +x ./brew-install-script.sh` then `./brew-install-script.sh`
echo "Installing brew..."
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo "Installing brew cask..."
brew tap caskroom/cask
@mao-kt
mao-kt / build.gradle
Created June 5, 2020 02:52
Dynamic versioning of Android application using Gradle and Grgit plugin. Updated for Gradle 5.+
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'jacoco-android'
apply from: "$project.rootDir/scripts/script-git-version.gradle"
Properties props = new Properties()
def keystoreProperties = file("keystore.properties")
if (keystoreProperties.exists()) {
@mao-kt
mao-kt / adbwificonnect.sh
Last active April 29, 2020 15:36 — forked from amanshuraikwar/adbwificonnect.sh
Shell script to connect a USB connected device via adb over WiFi
# Purpose: Shell script to connect a USB connected device via adb over WiFi
#
# Author: Amanshu Raikwar
#
# Assumptions:
# 1. USB debugging is enabled in the Android device
# 2. The Android device is connected to the computer via USB
# 3. The Android device is connected to the same wifi as the computer
# 4. The Android device is accessible through port 5555 over the wifi network
#