Skip to content

Instantly share code, notes, and snippets.

View keithkim's full-sized avatar

Keith Kim keithkim

View GitHub Profile
@keithkim
keithkim / aliases.txt
Created November 5, 2023 03:38
alias for cmd
ca=conda activate $1
cde=conda deactivate
cda=conda deactivate
cel=conda env list
condals=conda list
cs=conda search $1
find=findstr /sin $*
..=..\$*
...=..\..\$*
@keithkim
keithkim / alias.bat
Created November 5, 2023 03:37
alias helper for cmd
@echo off
REM *** set up alias for DOS environment like Bash's alias
REM *** 2022-10-12
@doskey vlist=
@doskey /macrofile=C:\bin\aliases.txt
REM *** to display all defined aliases
REM doskey /macros:all
@keithkim
keithkim / graalenv.bat
Created November 5, 2023 03:33
cmd batch file to set graalvm environment variables
@echo off
set GRAALVM_BASE=D:\opt\graalvm
set GRAALVM_PATH_TMP=%GRAALVM_BASE%\graalpath.tmp
setlocal enabledelayedexpansion
echo.
echo =====================================
echo 🍵 Graalvm Environment Setting Helper
echo 🍵 Graalvm Base Path=%GRAALVM_BASE%
@keithkim
keithkim / merge_mp3.sh
Last active January 2, 2022 00:05
simple script to automate merging converted mp3 files into single mp3 and add cover image
#!/usr/bin/bash
# Keith Kim, 2021-06
# This is to automate merging mp3 files and add cover image for audible audio book files converted to mp3 using AAXtoMP3
OIFS="$IFS"
IFS=$'\n'
for authorpath in `find . -maxdepth 1 -type d -print`
do
if [ "." == "$authorpath" ]; then continue; fi
#!/bin/bash
# https://askubuntu.com/questions/1020692/terminal-splash-screen-with-weather-calendar-time-sysinfo
#
# NAME: now
# PATH: $HOME/bin
# DESC: Display current weather, calendar and time
# CALL: Called from terminal or ~/.bashrc
# DATE: Apr 6, 2017. Modified: May 24, 2019.
version: '2'
services:
zookeeper:
container_name: zookeeper
image: wurstmeister/zookeeper
ports:
- "2181:2181"
kafka:
build: .
container_name: kafka
@keithkim
keithkim / multimon-output.html
Created August 27, 2020 19:19
APC UPS CGI outputs
Content-Type: text/html; charset=utf-8
Content-Language: en
Pragma: no-cache
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Multimon: UPS Status Page</title>
# Reset
Color_Off='\e[0m' # Text Reset
# Regular Colors
Black='\e[0;30m' # Black
Red='\e[0;31m' # Red
Green='\e[0;32m' # Green
Yellow='\e[0;33m' # Yellow
Blue='\e[0;34m' # Blue
Purple='\e[0;35m' # Purple
@keithkim
keithkim / update_python_package_via_pip.txt
Created February 13, 2018 23:19
Update Python package using pip
# Windows
for /F "delims===" %i in ('pip freeze -l') do pip install -U %i
# or,
for /F "delims= " %i in ('pip list --outdated') do pip install -U %i
# Linux
sudo -H pip install pipdate
sudo -H pipdate
# or,
pip list --outdated --format=legacy | awk '{print $1;}' | xargs -n1 pip install -U
@keithkim
keithkim / colortest.bat
Created January 20, 2018 22:54
Colors in cmd console or batch file for Windows
REM ### credit: https://stackoverflow.com/users/4544905/nick-n-chicago
REM ### from: https://stackoverflow.com/questions/2048509/how-to-echo-with-different-colors-in-the-windows-command-line/8920789
@echo off
cls && color 08
rem .... the following line creates a [DEL] [ASCII 8] [Backspace] character to use later
rem .... All this to remove [:]
for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do (set "DEL=%%a")