aws cli ProfileNotFound

I was trying to do some KMS encryption for some of our prod credentials with aws cli. After pulling down the temporary aws sts token for prod roles and run the aws –profile SOME_PROD_ROLE kms encrypt xxx, the  botocore.exceptions.ProfileNotFound: The config profile (SOME_DEV_ROLE) could not be found constantly pop up. I checked the ~/.aws/credentails file and make…

href # does not always do nothing

Today we were facing an issue that the angular universal generates an anchor element with href=”false” so before the js is loaded, the anchor would lead user to /false. My first thought is to just put a href=”#’ so that it does nothing. Our url is something like http://www.c1.com/local. After adding the #, the click always navigate…

package json bin field

We can define some executable js file in the bin section of the package json so that during installation, npm will symlink that file into prefix/bin for global installs, or ./node_modules/.bin/ for local installs. The file js need to start with the node flavor hash ban : #!/usr/bin/env node,  where the env will file the path of node in the system for us. And npm…

more understanding on css transition

A transition occurs when a CSS property changes from one value to another value over a period of time. You can create CSS Transitions with the transition property: .selector { transition: property duration transition-timing-function delay; } The transition property is a shorthand of four CSS properties, transition-property, transition-duration, transition-timing-function, transition-delay. .selector { transition-property: property; transition-duration: duration; transition-timing-function: timing-function; transition-delay: delay /* The transition…

Akamai CloudFront Certificate pinning

We recently took over a project that has some static angularJS code hosted in via standard Route 53 -> CloudFront -> S3. And domain CDN is using Akamai which has origin set to the R53 url. Akamai has a `Specific Certificates (pinning)` setting to pull certificate from a *.cloudfront.net.  Over the weekend something odd happened,…

macos system launch config

MacOS Config options MacOS boot service is mainly configured via three ways: 1.  the system preferences -> Users & Groups -> Login items 2. /System/Library/StartupItems and /Library/StartupItems/ 3. launchd system initialization process configuration. The first two are relatively simple, we will focus mainly on the third more complex launchd configuration optimization. launchd is a key…

polygon in svg and css

in svg we can create triangle like below turns out in css, we have similar stuff called clip-path which take similar parameter and draw the shape. For circle/ellipse, it has specific function, circle and ellipse. We can do something like clip-path: circle(50% at 50% 50%); Or clip-path: circle(50px at 50px 50px) means at(50px, 50px),clip a circle with…

debug hover item in chrome devtools

Chrome devtools is our friend, always. Today when I was developing an angular 4.x app with primeng library, i have to check the class set on the tooltip component. As we know the tooltip is hover event based, so if we hover on it to make it showup and then shift our focus to the…

LDAP notes on Forgerock OpenDJ

Forgerock has a good explanation on their openDJ, LDAP, DS etc… Below are some of my notes. LDAP directory data is organized into entries, similar to the entries for words in the dictionary, or for subscriber names in the phone book. dn: uid=bjensen,ou=People,dc=example,dc=com uid: bjensen cn: Babs Jensen cn: Barbara Jensen facsimileTelephoneNumber: +1 408 555…

各种license关系

GPL,以GPL为基础的软件也要用GPL,或者跟GPL兼容。有一个种方式可以做到不用GPL,把该软件版权持有者的公司,收购了,这是后话。目前GPL的主要流行版本是GPLv2 和GPLv3, 至于区别,可以理解为GPLv3有专利报复条款。 Apache License 比较宽松一些,简单可以理解为,在该授权软件基础上的软件可以不开源。 CDDL 可以理解为GPL 和Apache的折中,在一个软件中用不同几个包,在一个包里边,就是该比较完整的模块必须用CDDL,其他的可以用别的,甚至,不开源。 EPL则是因为后来IBM将Eclipse IDE交由名为“Eclipse基金会 (Eclipse Foundation)”来管理,对CPL为小部分修改为成的授权条款。EPL可以理解为在EPL授权的软件基础上的工作,如果新开的软件是源软件独立,就可以用其他的license,否则,只能用EPL。举个例子,你对EPL授权的软件,修正的bug,添加的性能提升,都不算独立的部分。

large file from hive to rdbms(oracle)

Recently we have a requirement of dumping a sizable file(4+G) to oracle from s3. The file itself is hive-compatiable. so instead of downloading the file and generate sql for it, we decided to transfer the content using hive jdbc and persist in via jpa/hiberante. Hive On the hive side, one important thing is to make…

serialize enum fields with gson

By default, Gson just serialize the ‘name’ of the Enum which might not be enough since we might need also want to carry all the fields during the serialization. To achieve this we need to has our own gson adaptor and make use of reflection. usage: Enum class: Test Code: Result: