diff --git a/_config.yml b/_config.yml index 58b9ab02719c..98b47bde43bf 100644 --- a/_config.yml +++ b/_config.yml @@ -1,28 +1,24 @@ # --- Basic options --- # # Name of website -title: My website +title: Jake Heo # Short description of your site -description: A virtual proof that I'm awesome +description: Information of Jake Heo # Your name to show in the footer -author: Some Person +author: Jake Heo # --- List of links in the navigation bar --- # navbar-links: About Me: "aboutme" - Resources: - - Beautiful Jekyll: "https://beautifuljekyll.com" - - Learn markdown: "https://www.markdowntutorial.com/" - Author's home: "https://deanattali.com" - + # --- Logo --- # # Image to show in the navigation bar - works best with a square image # Remove this parameter if you don't want an image in the navbar -avatar: "/assets/img/avatar-icon.png" +# avatar: "/assets/img/profile.png" # By default, the image is cut into a circle. You can disable this behaviour here. round-avatar: true @@ -31,6 +27,7 @@ round-avatar: true # then specify the following parameter #title-img: /path/to/image +cover-img: "/assets/img/profile.png" # --- Footer options --- # @@ -38,13 +35,12 @@ round-avatar: true # Uncomment the links you want to show and add your information to each one. # If you don't want to show a link to an RSS feed, set rss to "false". social-network-links: - email: "someone@example.com" - facebook: deanattali - github: daattali - twitter: daattali - rss: true + email: "gyucheon.heo@gmail.com" +# facebook: deanattali + github: gyucheonheo +# rss: true # reddit: yourname -# linkedin: daattali + linkedin: gyucheon-heo-07a007157 # xing: yourname # stackoverflow: "3943160/daattali" # snapchat: deanat78 @@ -62,13 +58,12 @@ social-network-links: # Select which social network share links to show in posts share-links-active: - twitter: true - facebook: true +# facebook: true linkedin: true # How to display the link to your website in the footer # Remove this if you don't want a link in the footer -url-pretty: "MyWebsite.com" +url-pretty: "gyucheonheo.github.io" # Create a "tags" index page and make tags on each post clickable link-tags: true @@ -80,14 +75,14 @@ excerpt_length: 50 # Personalize the colors in your website. Colour values can be any valid CSS colour -navbar-col: "#F5F5F5" -navbar-text-col: "#404040" +navbar-col: "#FFFFFF" +navbar-text-col: "#000000" navbar-border-col: "#EAEAEA" page-col: "#FFFFFF" link-col: "#008AFF" hover-col: "#0085A1" -footer-col: "#F5F5F5" -footer-text-col: "#777777" +footer-col: "#FFFFFF" +footer-text-col: "#FFFFFF" footer-link-col: "#404040" # Alternatively, the navbar, footer, and page background can be set to use background images diff --git a/_posts/2020-02-26-flake-it-till-you-make-it.md b/_posts/2020-02-26-flake-it-till-you-make-it.md deleted file mode 100644 index 80aef7541782..000000000000 --- a/_posts/2020-02-26-flake-it-till-you-make-it.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -layout: post -title: Flake it till you make it -subtitle: Excerpt from Soulshaping by Jeff Brown -cover-img: /assets/img/path.jpg -tags: [books, test] ---- - -Under what circumstances should we step off a path? When is it essential that we finish what we start? If I bought a bag of peanuts and had an allergic reaction, no one would fault me if I threw it out. If I ended a relationship with a woman who hit me, no one would say that I had a commitment problem. But if I walk away from a seemingly secure route because my soul has other ideas, I am a flake? - -The truth is that no one else can definitively know the path we are here to walk. It’s tempting to listen—many of us long for the omnipotent other—but unless they are genuine psychic intuitives, they can’t know. All others can know is their own truth, and if they’ve actually done the work to excavate it, they will have the good sense to know that they cannot genuinely know anyone else’s. Only soul knows the path it is here to walk. Since you are the only one living in your temple, only you can know its scriptures and interpretive structure. - -At the heart of the struggle are two very different ideas of success—survival-driven and soul-driven. For survivalists, success is security, pragmatism, power over others. Success is the absence of material suffering, the nourishing of the soul be damned. It is an odd and ironic thing that most of the material power in our world often resides in the hands of younger souls. Still working in the egoic and material realms, they love the sensations of power and focus most of their energy on accumulation. Older souls tend not to be as materially driven. They have already played the worldly game in previous lives and they search for more subtle shades of meaning in this one—authentication rather than accumulation. They are often ignored by the culture at large, although they really are the truest warriors. - -A soulful notion of success rests on the actualization of our innate image. Success is simply the completion of a soul step, however unsightly it may be. We have finished what we started when the lesson is learned. What a fear-based culture calls a wonderful opportunity may be fruitless and misguided for the soul. Staying in a passionless relationship may satisfy our need for comfort, but it may stifle the soul. Becoming a famous lawyer is only worthwhile if the soul demands it. It is an essential failure if you are called to be a monastic this time around. If you need to explore and abandon ten careers in order to stretch your soul toward its innate image, then so be it. Flake it till you make it. diff --git a/_posts/2020-02-28-test-markdown.md b/_posts/2020-02-28-test-markdown.md deleted file mode 100644 index 4ac869f47ead..000000000000 --- a/_posts/2020-02-28-test-markdown.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -layout: post -title: Sample blog post -subtitle: Each post also has a subtitle -gh-repo: daattali/beautiful-jekyll -gh-badge: [star, fork, follow] -tags: [test] -comments: true ---- - -This is a demo post to show you how to write blog posts with markdown. I strongly encourage you to [take 5 minutes to learn how to write in markdown](https://markdowntutorial.com/) - it'll teach you how to transform regular text into bold/italics/headings/tables/etc. - -**Here is some bold text** - -## Here is a secondary heading - -Here's a useless table: - -| Number | Next number | Previous number | -| :------ |:--- | :--- | -| Five | Six | Four | -| Ten | Eleven | Nine | -| Seven | Eight | Six | -| Two | Three | One | - - -How about a yummy crepe? - -![Crepe](https://s3-media3.fl.yelpcdn.com/bphoto/cQ1Yoa75m2yUFFbY2xwuqw/348s.jpg) - -It can also be centered! - -![Crepe](https://s3-media3.fl.yelpcdn.com/bphoto/cQ1Yoa75m2yUFFbY2xwuqw/348s.jpg){: .mx-auto.d-block :} - -Here's a code chunk: - -~~~ -var foo = function(x) { - return(x + 5); -} -foo(3) -~~~ - -And here is the same code with syntax highlighting: - -```javascript -var foo = function(x) { - return(x + 5); -} -foo(3) -``` - -And here is the same code yet again but with line numbers: - -{% highlight javascript linenos %} -var foo = function(x) { - return(x + 5); -} -foo(3) -{% endhighlight %} - -## Boxes -You can add notification, warning and error boxes like this: - -### Notification - -{: .box-note} -**Note:** This is a notification box. - -### Warning - -{: .box-warning} -**Warning:** This is a warning box. - -### Error - -{: .box-error} -**Error:** This is an error box. diff --git a/_posts/2020-05-18-Stay-Away-Commenting b/_posts/2020-05-18-Stay-Away-Commenting new file mode 100644 index 000000000000..d7e7eecce303 --- /dev/null +++ b/_posts/2020-05-18-Stay-Away-Commenting @@ -0,0 +1,7 @@ +--- +layout: post +title: Stay Away Commenting to Your Code +subtitle: Why do you need it? +tags: [clean code] +comments: true +--- diff --git a/_posts/2020-05-19-Polymorphism.md b/_posts/2020-05-19-Polymorphism.md new file mode 100644 index 000000000000..8b733e57742d --- /dev/null +++ b/_posts/2020-05-19-Polymorphism.md @@ -0,0 +1,16 @@ +--- +layout: post +title: If..Else..Switch..Polyporphism? +subtitle: What is good about it? +tags: [clean code, OOP, Polymorphism] +comments: true +--- + +I recently saw a nerd meme in Facebook. It gives me so many thought with respect to polymorphism. +![polymorphism](/assets/img/polymorphism.png) + +Can you see polymorhpism on the second code? So what could be advantages by doing so? + + + + diff --git a/_posts/2020-05-23-Mistake-On-Git.md b/_posts/2020-05-23-Mistake-On-Git.md new file mode 100644 index 000000000000..7c6f2f352962 --- /dev/null +++ b/_posts/2020-05-23-Mistake-On-Git.md @@ -0,0 +1,68 @@ +--- +layout: post +title: Did you mess up with git commit? No Worry! +subtitle: Let's go back to where it works +tags: [git] +comments: true +--- + +Everytime I learn about `git`, I frequently was likely to focus on adding/updating files. Because of that, I went through silly and stupid procedure or left those stupid whenever I did make mistakes. + +It is NOW time for us to learn smart ways to revert it! + +### Scenario 1; Wrong Commit Message? No Problem! +It it really common that you forget adding more files or put a bad message to a commit that you just made. +What would you do in this case? Are you going to leave it as it is or do you want to fix that? +I hope that you want to do the latter. Here are steps you need to follow to do so. + +``` bash +(master)[you@machine]$>git commit --amend -m "" +``` + +{: .box-warning} +**Warning:** This commint will create a new commit number. + +### Scenario 2; Made commit to a wrong branch? No Problem! +Imagine that you made a below commit to `master` branch. However, you figured out that this commit was supposed to belong to `foo` branch. + +``` bash +(master)[you@machine]$>git add test.c +(master)[you@machine]$>git commit -m "Completed new foo feature" +``` +Ouch! you noticed the branch name is `master` instead of `foo`. Don't worry. It will cover. + +``` bash +(master)[you@machine]$>git branch +``` +The above command will show you two branches; `master` and `foo`. Okay. `foo` is our final destination. In addition, we need a commit number that we want move to `foo`. + +``` bash +(master)[you@machine]$>git log +``` + +The above command will show you a bunch of commit log and copy/paste the commit number. + +``` bash +(master)[you@machine]$>git checkout foo +``` + +It enables you to switch your current branch to `foo`. + +``` bash +(foo)[you@machine]$>git cherry-pick +``` + +Okay. Here we go. `foo` branch, now, has that commit. + +But! we should fix our `master` branch as well. + +``` bash +(foo)[you@machine]$>git checkout master +``` + +``` bash +(master)[you@machine]$>git reset -- +``` +* `soft` : `soft` will reset the commit, but changes will remain in working stage. +* `mix` : `mix` is the default. `mix` will reset the commit, but changes will remain in working directory. +* `hard` : `hard` will reset the commit, but changes will NOT remain anywhere. diff --git a/_posts/2022-09-14-Sort-List-with-fixed-order.md b/_posts/2022-09-14-Sort-List-with-fixed-order.md new file mode 100644 index 000000000000..bc9f18468628 --- /dev/null +++ b/_posts/2022-09-14-Sort-List-with-fixed-order.md @@ -0,0 +1,65 @@ +--- +layout: post +title: Sort List with fixed start items +subtitle: +tags: [java, stream, sort] +comments: true +--- + +Recently, I needed to write a piece of code snippet to convert a list of strings into a list of strings that should start with 2 items. +I started it with being dumb. + +Let's say that your list should start with "Chicago" followed by "Illinois" and you don't care a rest of them once you meet "Chicago" followed by "Illinois". +Additionally, a given list may or may not have "Chicago" or "Illinois". + +The first code that I pumped out smells a lot. +1. Too many if-else : I'm lucky to have only 2 items requirement. What if it should starts with 10 items? Its complexity will grow exponentially. Error-prone. +2. I repeat myself +3. In general, it is vomit-causing code. I hate it. + +``` java +List newList = new ArrayList<>(); +List lst = List.of("San Fransisco", "California", "St Louis", "Missouri", "Washington", "Seattle", "Chicago", "Wisconsin", "Illinois"); + +if (lst.contains("Chicago") && lst.contains("Illinois")) { + for (String s : lst) { + if (s.equals("Chicago")) newList.add(0, s); + else if (s.equals("Illinois")) newList.add(1, s); + else newList.add(s); + } +} else if (lst.contains("Chicago") && !lst.contains("Illinois")) { + for (String s : lst) { + if (s.equals("Chicago")) newList.add(0, s); + else newList.add(s); + } +} else if (!lst.contains("Chicago") && lst.contains("Illinois")) { + for (String s : lst) { + if (s.equals("Illinois")) newList.add(0, s); + else newList.add(s); + } +} else { + for (String s : lst) { + newList.add(s); + } +} + +newList.forEach(System.out::println); +``` + +As a result of spending a few hours playing the code, I ended up sorting it based on fixed items. +It's pretty intuitive and there is nothing that I have to explain as extra. +Neat and simple. + +``` java +Map fixedItems = Map.of("Chicago", 0, "Illinois", 1); +List lst = List.of("San Fransisco", "California", "St Louis", "Missouri", "Washington", "Seattle", "Chicago", "Wisconsin", "Illinois"); + +List newList = lst.stream() + .distinct() + .sorted(Comparator.comparing( s -> { + int i = fixedItems.getOrDefault(s, -1); + return i >= 0 ? i : fixedItems.size(); + })) + .toList(); +``` +Although the number of fixed items increase, this code will be able to handle it in scale without any changes except for `fixedItems`. diff --git a/_posts/2023-06-01-asymmetric-encryption.md b/_posts/2023-06-01-asymmetric-encryption.md new file mode 100644 index 000000000000..3e7c1d04765d --- /dev/null +++ b/_posts/2023-06-01-asymmetric-encryption.md @@ -0,0 +1,47 @@ +--- +layout: post +title: How securely shares your secret with others? +subtitle: +tags: [encryption, decryption, openssl] +comments: false +--- + +Do you plan to share your secret, such as apikey, application secret, password, to your colleagues? But you don't want them to be stored in a persistant storage such as a messenger's database. +Then, let's follow it + +Let's make up a situation. +Alice asks me to renew an apikey because Alices needs one more for a new application domain. +She told me "Send it to me through Slack!". +However, Slack stores our conversation and it'd be security breach candidate while scanning! +You and Alice and follows this. +1. Alice generates her private key +``` bash +$>openssl genpkey -algorithm RSA -out private_key.pem +``` + +2. Alice extracts her public key out of her private key +``` bash +$>openssl rsa -pubout -in private_key.pem -out public_key.pem +``` + +3. Alice shares her *public* key + +4. You encrypts a file that includes a secret +``` bash +$>openssl rsautl -encrypt -pubin -inkey public_key.pem -in plaintext.txt -out encrypted.bin +``` + +5. You share an output file `encrypted.bin` to Alice + +6. Alice descrypts the file `encrypted.bin` using her *private* key +``` bash +$>openssl rsautl -decrypt -inkey private_key.pem -in encrypted.bin -out decrypted.txt +``` + +Asymmetric encryption is a powerful tool that can be used to protect sensitive information. It is often used in conjunction with other security measures, such as passwords and authentication tokens, to create a more secure system. + +Here are some additional benefits of using asymmetric encryption: + +Confidentiality: Asymmetric encryption can be used to protect sensitive information from unauthorized access. +Integrity: Asymmetric encryption can be used to ensure that the contents of a message have not been tampered with. +Non-repudiation: Asymmetric encryption can be used to prove that a message was sent by a specific person. diff --git a/_posts/2024-02-05-My-First-Zero-Day.md b/_posts/2024-02-05-My-First-Zero-Day.md new file mode 100644 index 000000000000..5225b0bd8bd8 --- /dev/null +++ b/_posts/2024-02-05-My-First-Zero-Day.md @@ -0,0 +1,9 @@ +--- +layout: post +title: 🚨 My Very First Zero Day 🚨 +subtitle: +tags: [security, zero-day, authentication, token] +comments: false +--- + +Sharing the news of encountering my first zero-day isn't a pleasant task. Nonehtelss, it's essential to document and make note of my experience and solutions. diff --git a/_posts/2024-03-27-Gmail-Image-Proxy-Not-Cache-Svg.md b/_posts/2024-03-27-Gmail-Image-Proxy-Not-Cache-Svg.md new file mode 100644 index 000000000000..9fcbabb90c88 --- /dev/null +++ b/_posts/2024-03-27-Gmail-Image-Proxy-Not-Cache-Svg.md @@ -0,0 +1,9 @@ +--- +layout: post +title: Gmail Image Proxy doesn't cache SVG +subtitle: +tags: [gmail, image, cache] +comments: false +--- + +test diff --git a/_posts/2024-11-03-How-to-customize-refresh-token-behavior-in-b2c-custom-policy b/_posts/2024-11-03-How-to-customize-refresh-token-behavior-in-b2c-custom-policy new file mode 100644 index 000000000000..5b119d57033d --- /dev/null +++ b/_posts/2024-11-03-How-to-customize-refresh-token-behavior-in-b2c-custom-policy @@ -0,0 +1,75 @@ +--- +layout: post +title: Let's change the behavior of refresh token in Azure AD B2C +subtitle: +tags: [b2c, custompolicy, oauth2, authorization] +comments: true +--- + +We will explore how to change the behavior of refresh tokens in Azure AD B2C to better suit your application's needs and enhance security. + + +## Why do we need a new behavior? + +I noticed that a newly generated access token didn't include claims that the previous old token had. It was surprising that original claims are not preserved! Therefore, a new behavior needs to call an endpoint to add the claim! Additionally, you are able to refresh tokens as long as you have it and refresh it regularly before it expires. However, one of security concerns that I have and I want to have is to disallow to refresh tokens if an account associated with the given userId is disabled in Azure portal. + +## Well, what should I do then? + +1. Open your relying party custom policy that you want to change your behavior +2. Go to `` element and add the following `` element + +``` + + + + ... + ... + + +... +... + +``` +3. Then, what is `My-RefreshToken-UserJourney`? This is a user journey how you want to change your refresh token behavior! Let's see it +``` + + false + + + + + + + + + + + + + + + + + + + + + + + + +``` + +4. Okay. It looks like that it's time to go deep into some technical profiles. Let's go to `ExtractClaimsFromRefreshToken` +``` + + ... + + + + + + + +``` +This technical profile will put `objectId` which is `b2cUserId` diff --git a/aboutme.md b/aboutme.md index acb3ac829a8f..db56f5c6fcc8 100644 --- a/aboutme.md +++ b/aboutme.md @@ -1,16 +1,10 @@ --- layout: page title: About me -subtitle: Why you'd want to go on a date with me +subtitle: Software Engineer --- -My name is Inigo Montoya. I have the following qualities: +Authentication/Authorization specialist. Interested in digital security, identity management, authentication/authorization and functional programming. -- I rock a great mustache -- I'm extremely loyal to my family -What else do you need? -### my history - -To be honest, I'm having some trouble remembering right now, so why don't you just watch [my movie](https://en.wikipedia.org/wiki/The_Princess_Bride_%28film%29) and it will answer **all** your questions. diff --git a/assets/css/os.jpg b/assets/css/os.jpg new file mode 100644 index 000000000000..bca8d7f457f7 Binary files /dev/null and b/assets/css/os.jpg differ diff --git a/assets/img/polymorphism.png b/assets/img/polymorphism.png new file mode 100644 index 000000000000..5fdd93b1c23b Binary files /dev/null and b/assets/img/polymorphism.png differ diff --git a/assets/img/profile.png b/assets/img/profile.png new file mode 100644 index 000000000000..d1a004cea42a Binary files /dev/null and b/assets/img/profile.png differ diff --git a/index.html b/index.html index 2f8866ee2abe..7419f9b14666 100644 --- a/index.html +++ b/index.html @@ -1,6 +1,6 @@ --- layout: home -title: My website -subtitle: This is where I will tell my friends way too much about me +title: What I think? +subtitle: Dig more about my thought. ---