Tmux local setup

Background Recently I was tired of the resource usages especially cpu usages by iterm2 which has nice features like split pane and screen text copy. Also I have a Windows 10 machine at home running with WSL2 in Ubuntu. So I am more leaning towards a platform agnostic thing and iterm2 is MacOS only. I…

vim system clipboard setup

How vim interact with the system clipboard is something always tricky and debatable as vim carries its own register. Current Setting My previous way is using the vim register for operations like y, d, x etc and use a mapping of ctrl+c to copy the content to system clipboard like vmap <C-c> “+y to copy…

curl check url status

Recently we need to check our Route 53 accessibility before invalidating our cache in CDN. So need to add this logic into our Jenkins job. The command :

work with multiple files in vim

When working with multi files in vim, there are several options. Netrw Was first trying to use the netrw which comes with vim installation. However it is not quite easy to use. :e. is to open the file explore, or :Exp, or : Vex, or :Sex. NERDTree Nerdtree is the de facto file explore. After the frustration…

run scp in background

recently we need to migrate our church’s Drupal site from godaddy vps to aws. The php/mysql part is kind of straightforward. The last task is to transfer the video/audio files to EBS. Since the size is pretty big(30~GB), we do not want to download to local and upload again. So scp becomes the choice. The command…

base64 in shell

Used to go to some site when in need of en/de-code from/to base64. Turns out we can do that from the shell directly. Encode echo -n ‘My TextTo Encode’ | base64 The -n is to prevent the new line of the echo from being included in the result(by default echo outputs a trailing newline). Decode echo ‘My…

clipboard in terminal(copy/paste)

Was watching a CD video with Semaphore and saw the guy in the video manipulating clipboard with pipe directly in the terminal. Pretty cool! Did some research on that. OSX(MacOS) In Mac, it is pretty straightforward with the built in pbcopy and pbpaste. (pasteboard copy / paste). Some examples: cat my.key.pub | pbcopy pbpaste > my.otherKey.pub ps…

bitten by system case sensitivity twice today

Today i was bitten by system case insensitivity twice: Maven test does not pick up Spring boot test profile properties git commit does not get the file name change. Spring boot profile based config In spring boot, we can have different resource files(.properties or .yml ) to hold properties. More over, we could have profile specific ones,…

install ora2pg on mac osx

Recently we need to migrate our on prem oracle database into postgresql on aws RDS. Looks like ora2pg is a nice little tool to mitigate the problem though not perfect. I am running OS X 10.10.5 Yosemite. It already comes with perl v5.18.2 as well as cpan for installing packages. download/install Oracle client The official document…

Shebang/Hashbang #! in shell

In unix sh file, we usually see the first line start with #!. Like #!/bin/bash The shebang (#!) at the start means execute the script with what follows. In nodejs script, we usually see #!/bin/env node So this means the env command will try to find where the node has been installed from the $PATH, so…