Skip to content

Instantly share code, notes, and snippets.

View mengjiann's full-sized avatar
🤔
code. code.

MJ mengjiann

🤔
code. code.
  • Illumina
  • Singapore
View GitHub Profile
# Install Brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install Software from Brew
- switchaudio-osx
- springboot
- maven
# Install Software from Brew Cask
- iterm2
@mengjiann
mengjiann / gist:5e3346d99a5df280e6858974bd0cb8ed
Created February 16, 2020 05:42
Command Line Shortcuts
Ctrl + a – go to the start of the command line
Ctrl + e – go to the end of the command line
Ctrl + k – delete from cursor to the end of the command line
Ctrl + u – delete from cursor to the start of the command line
Ctrl + w – delete from cursor to start of word (i.e. delete backwards one word)
Ctrl + y – paste word or text that was cut using one of the deletion shortcuts (such as the one above) after the cursor
Ctrl + xx – move between start of command line and current cursor position (and back again)
Alt + b – move backward one word (or go to start of word the cursor is currently on)
Alt + f – move forward one word (or go to end of word the cursor is currently on)
Alt + d – delete to end of word starting at cursor (whole word if cursor is at the beginning of word)
# Set recursive in file
svn propset svn:ignore -F svnignore .
# Remove all svnignore command recursively
svn propdel svn:ignore -R .
# Set global ignore in $HOME/.subversion/config
[miscellany]
global-ignores = *.o *.so *.so.[0-9]* .DS_Store [Tt]humbs.db
@mengjiann
mengjiann / gist:a9140445d41cc05c5b71cb9e8e62028c
Created May 26, 2020 11:57
Upload large file using Apache HttpClient
HttpClientContext clientContext = HttpClientContext.create();
// clientContext.setCredentialsProvider(credentialsProvider);
// clientContext.setAuthCache(authCache);
HttpPost post = new HttpPost(endpointUri);
HttpEntity entity = MultipartEntityBuilder.create()
.addBinaryBody("file", inputStream, ContentType.create("application/octet-stream"), fileName)
.build();
post.setEntity(entity);
@mengjiann
mengjiann / gist:c38be8a21377cd002fa6bf5aac8ea3f3
Last active September 24, 2020 03:27
Useful OracleDB Command
/* Sqlplus */
`ORACLE_SID=<SID> ORACLE_HOME=/oracle/CWDB01/product/12.1.0 /oracle/CWDB01/product/12.1.0/bin/sqlplus "sys as SYSDBA"`
/* Setting up directory for using import/export datapump */
CREATE DIRECTORY db_restore AS '<MOUNT FOLDER IN CONTAINER>';
GRANT read, write ON DIRECTORY db_restore TO sys;
GRANT DATAPUMP_EXP_FULL_DATABASE,DATAPUMP_IMP_FULL_DATABASE TO sys;
/* Import using data pump */
expdp \"sys/passwd@localhost/ORCLCDB as sysdba\" full=Y DIRECTORY=db_restore dumpfile=export-db.dmp