Skip to content

Instantly share code, notes, and snippets.

View nedzhang's full-sized avatar

Ned Zhang nedzhang

View GitHub Profile
@nedzhang
nedzhang / bash_command_parsing.sh
Last active May 16, 2022 14:51
[Linux bash ninja] Bash Scripting skills #bash #linux #selinux
#!/bin/bash
usage() {
cat << EOF
NAME:
connect-ibmcloud - Connect cli to IBM Cloud
USAGE:
connect-ibmcloud [-r REGION] [-g (RESOURCE_GROUP_NAME | RESOURCE_GROUP_ID)]
@nedzhang
nedzhang / set-mac-os-high-sierra-vm-data.md
Last active November 28, 2018 20:09
[Mac OS VirtualBox] Install MacOS on virtualbox #macos #virtualbox

Follow installation guide from techsviewer.

Before starting the VM first time, need to setup some configuration values not exposed in VirtualBox UI. I used the script below. Run it with the VM's name as input parameter. Example: set-mac-os-high-sierra-vm-data.bat my_vm_name

set-mac-os-high-sierra-vm-data.bat


@nedzhang
nedzhang / check-sum.bat
Created November 24, 2018 17:21
[Windows Stuff] Windows stuff not scripting #Windows
certutil.exe -hashfile .\Downloads\VirtualBox-5.2.22-126460-Win.exe sha256
REM Result Below
REM SHA256 hash of .\Downloads\VirtualBox-5.2.22-126460-Win.exe:
REM 0c1a8f1de1c5bd18b00d81419f8190660ff36c9a5fddae4ed2c6a2216581d521
REM CertUtil: -hashfile command completed successfully.
@nedzhang
nedzhang / App.java
Last active November 24, 2018 16:45
[Java Console Application] Java Console Application - parameter check, usage, and interaction #Java #Console #display-usage #parameter
package com.nedzhang.util.jdbcverify;
//import java.nio.file.attribute.UserPrincipalLookupService;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Scanner;