Skip to content

Instantly share code, notes, and snippets.

View teeppiphat's full-sized avatar
🏠
Working from home

Nothing here! teeppiphat

🏠
Working from home
  • 22 Lab Co.,Ltd.
  • Bangkok, Thailand
View GitHub Profile
+--------------+---------------+----------------------------------------+
| ตัวดำเนินการ | อธิบาย | ตัวอย่าง |
+--------------+---------------+----------------------------------------+
| + | บวก | a + b มีค่า 30 |
| – | ลบ | a – b มีค่า -10 |
| * | คูณ | a * b มีค่า 200 |
| / | หาร | b / a มีค่า 2 |
| % | เศษของการหาร | b % a มีค่า 0 |
| ** | ยกกำลัง | a**b หมายถึง 10 ยกกำลัง 20 |
| // | หารปัดเศษทิ้ง | 9//2 is มีค่า 4 และ 9.0//2.0 มีค่า 4.0 |
void WiFiManager::resetSettings() {
DEBUG_WM(F("settings invalidated"));
DEBUG_WM(F("THIS MAY CAUSE AP NOT TO START UP PROPERLY. YOU NEED TO COMMENT IT OUT AFTER ERASING THE DATA."));
WiFi.persistent(true);
WiFi.disconnect(true);
WiFi.persistent(false);
}
// find and replace resetSettings function in WiFiManager.cpp
@teeppiphat
teeppiphat / gist:6b44105a0fd62e1e754bd5e12aa56d30
Created March 19, 2020 03:43
Oracle 11g r2 Switching to a Different Schema
https://docs.oracle.com/cd/B28359_01/server.111/b28310/general009.htm#ADMIN02101
CONNECT scott
ALTER SESSION SET CURRENT_SCHEMA = joe;
SELECT * FROM emp;
@teeppiphat
teeppiphat / gist:691bb1b3af2e47db4c8545a66d08de6d
Created March 19, 2020 03:25
Oracle 11g r2 DROP TABLE BIN$
http://www.dba-oracle.com/t_purge_oracle_recyclebin.htm
PURGE RECYCLEBIN;
@teeppiphat
teeppiphat / gist:733128067481ba248ea169dc0973eea6
Created March 19, 2020 03:05
Oracle 11g r2 Way to unlock the user
Way to unlock the user :
$ sqlplus /nolog
SQL > conn sys as sysdba
SQL > ALTER USER USER_NAME ACCOUNT UNLOCK;
and open new terminal
SQL > sqlplus / as sysdba
connected
SQL > conn username/password //which username u gave before unlock
@teeppiphat
teeppiphat / gist:b61be23a25a326a86b886cd74546a0cd
Created March 19, 2020 02:53
Check type for fix Oracle Error: ORA-12717
select owner, table_name, column_name from dba_tab_columns where (data_type = 'NCHAR' or data_type = 'NVARCHAR2' or data_type = 'NCLOB') and owner != 'SYS' and owner != 'SYSTEM';
Oracle Error: ORA-12717
Error Description:
Cannot issue ALTER DATABASE NATIONAL CHARACTER SET when NCLOB, NCHAR or NVARCHAR2 data exists
Error Cause:
@teeppiphat
teeppiphat / gist:64a1a53b3cf7329c4e9328fe1f38a07f
Created March 19, 2020 02:50
Oracle 11g r2 set NLS_NCHAR_CHARACTERSET to UTF8
select value from NLS_DATABASE_PARAMETERS where parameter='NLS_NCHAR_CHARACTERSET';
SQL> SHUTDOWN IMMEDIATE
SQL> STARTUP MOUNT
SQL> ALTER SYSTEM ENABLE RESTRICTED SESSION;
SQL> ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0 SCOPE = MEMORY;
SQL> ALTER SYSTEM SET AQ_TM_PROCESSES=0 SCOPE = MEMORY;
SQL> ALTER DATABASE OPEN;
SQL> ALTER DATABASE NATIONAL CHARACTER SET UTF8;
@teeppiphat
teeppiphat / gist:41a05a1a85be0079e287c78242b039e9
Created March 19, 2020 02:49
Oracle 11g r2 set NLS_CHARACTERSET to TH8TISASCII
# set NLS_CHARACTERSET to TH8TISASCII
SQL> shutdown immediate;
SQL> startup restrict;
SQL> select name from v$database;
SQL> ALTER DATABASE CHARACTER SET INTERNAL_USE TH8TISASCII;
SQL> select value from NLS_DATABASE_PARAMETERS where parameter='NLS_CHARACTERSET';
SQL> shutdown immediate;
SQL> startup
@teeppiphat
teeppiphat / gist:a51cec7c1210a8a76aa9f9a9ba9fd126
Last active March 19, 2020 03:30
Oracle 11g r2 Change Password
https://docs.oracle.com/cd/E23903_01/doc.41/e21673/trouble.htm#HTMIG265
$ sqlplus /nolog
SQL> CONNECT SYS as SYSDBA
Enter password: SYS_password
SQL> ALTER USER APEX_040000 IDENTIFIED BY new_password;
EKSCTL_EXPERIMENTAL=true eksctl enable repo \
--cluster=eksworkshop-eksctl --region=eu-west-1 \
--git-url=https://github.com/teeppiphat/k8s-config \
--git-email=teeppiphat@gmail.com
helm upgrade -i helm-operator fluxcd/helm-operator \
--namespace flux \
--set configureRepositories.enable=true \
--set 'configureRepositories.repositories[0].name=stable' \
--set 'configureRepositories.repositories[0].url=https://kubernetes-charts.storage.googleapis.com' \