Skip to content

Instantly share code, notes, and snippets.

View dolphinotaku's full-sized avatar
🎯
Focusing

Keith POON dolphinotaku

🎯
Focusing
  • Freelance
  • Hong Kong
View GitHub Profile
@dolphinotaku
dolphinotaku / slack-notify-demo.yml
Created January 25, 2022 16:09
Slack Official Example - "Slack Notify - GitHub Action"
on: push
name: Slack Notification Demo
jobs:
slackNotification:
name: Slack Notification
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
@dolphinotaku
dolphinotaku / auto fill and login PDS.ahk
Created June 21, 2021 15:10
Focus on IE, input and login
^k::
; #IfWinExist, PDS - Product Development System
; WinActivate, PDS - Product Development System
; WinWaitActive, PDS - Product Development System
if WinExist("PDS - Product Development System") {
WinActivate
Send, {F5}
Sleep 1000
Send, ^a
Send, Keith_Poon
@dolphinotaku
dolphinotaku / autorun.ahk
Created June 20, 2021 13:25
minecraft timestamp_recorder
^r::
Run, "D:\minecraft\timestamp_recorder\print.cmd"
return
---------- Pre-execute command promtp script ----------
set PATH=%PATH%;"C:\Program Files\Java\jdk-10.0.2\bin\";
set PATH=%PATH%;"C:\Users\90474\Desktop\software\openssl-1.0.2d-x64_86-win64\openssl";
-------------------------------------------------------
this time was purchased a wildcard certificate (*.example.com) from Sectigo
I received the certificate request, private key, 4 certificate files (1 root certificate, 2 intermediate certificate, 1 wildcard certificate)
---------- Preparement (P.0) --------------
P.1). create certificate request (csr)
As the CSR was created by other people, first to do was extract the CSR info
---------- Pre-execute command promtp script ----------
set PATH=%PATH%;"C:\Program Files\Java\jdk-10.0.2\bin\";
set PATH=%PATH%;"C:\Users\90474\Desktop\software\openssl-1.0.2d-x64_86-win64\openssl";
-------------------------------------------------------
this time was purchased a wildcard certificate (*.example.com) from Sectigo
I received the certificate request, private key, 4 certificate files (1 root certificate, 2 intermediate certificate, 1 wildcard certificate)
---------- Preparement (P.0) --------------
P.1). create certificate request (csr)
As the CSR was created by other people, first to do was extract the CSR info
@dolphinotaku
dolphinotaku / custom json
Created September 2, 2020 16:18
Microsoft SharePoint - an example for how to customize SharePoint List Column
// change the text color
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField",
"attributes": {
"class": "=if([$Status] == 'Completed', 'ms-fontColor-greenLight ms-fontWeight-semibold', '')"
}
}
@dolphinotaku
dolphinotaku / 2020-06-19_174722.sql_alter_user.txt
Last active June 21, 2020 15:38
The call_gen_pwd.bat will update the oracle db pwd with an external oracle sql client, and send notification email at the end
SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jun 19 17:47:23 2020
Version 19.6.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Last Successful login time: Fri Jun 19 2020 17:34:18 +08:00
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
@dolphinotaku
dolphinotaku / ReplaceText.vbs
Created June 21, 2020 14:42
this routine shows how to replace text in particular file
'ReplaceText.vbs
Option Explicit
Const ForAppending = 8
Const TristateFalse = 0 ' the value for ASCII
Const Overwrite = True
Const WindowsFolder = 0
Const SystemFolder = 1
@dolphinotaku
dolphinotaku / changepwd.sql
Last active June 21, 2020 14:09
this will use external oracle sql client to update database account password, call update_pwd.bat %oldpwd% %newpwd%
--spool d:\sql_execuste.log
-- write sql here
-- if password complexity verification function has been enabled
alter user &1 identified by &2 replace &3
-- if password verification is disabled
-- alter user <user> identified by <password>;
-- execute the sql
@dolphinotaku
dolphinotaku / gen_pwd.bat
Created June 21, 2020 13:21
this batch script generate a password include at least 1 upper letter, 1 lower letter, 1 numeric
:: to generate a 10 length password use below in .bat
:: call gen_pwd.bat 10
@echo off
setlocal enableextensions enabledelayedexpansion
set "lower=abcdefghijklmnopqrstuvwxyz"
set "upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ"
set "numeric=0123456789"
set "alphanumeric=%lower%%upper%%numeric%"