Thursday, April 13, 2017

Quick Awk to remove weak Diffie Hellman moduli

I recently had an opportunity to quickly brush up on Awk, which I first learned during Freshman year for a small assignment and forgot about since. It was determined that a Diffie-Hellman modulus of 1024-bits or less is breakable nowadays and no longer secure. Your secure sessions can actually be eavesdropped if the attacker's machine is capable.

As horrifying as it sounds, the fix is simple: remove weak moduli. They can be found in /etc/ssh/moduli file, which should look like the following..


# Time Type Tests Tries Size Generator Modulus
20150520235007 2 6 100 2047 5 (some hex)
20150520235015 2 6 100 2047 5 (some hex)
20150520235039 2 6 100 2047 2 (some hex)
...
...


I could go into what they all mean, but lets focus on Awk and just say that I needed to remove from this file the lines where Size was 1024 or less. Because this file was already sorted by Size, my initial approach was to open it up in Nano and Ctrl + k each line until all of the weak moduli were gone. Coworker suggested that I use some more brain power and go with Awk and Ansible because we had about 20 servers to update (and also I can blog about it).

After an hour of re-learning, this line of shell command was forged:

  cat moduli | awk '{if((NR==1) || NR>1 && $5>2046)print}' > temp && mv temp moduli && chown root:root moduli
  (Assumes your cwd to be /etc/ssh)



Here is the Ansible task you can simply plug into your YAML and let it work its magic on your 9000+ servers while you grab a quick coffee.
  - name: Remove insecure SSH moduli
    shell: cat moduli | awk '{if((NR==1) || NR>1 && $5>2046)print}' > temp && mv temp moduli && chown root:root moduli
    args:
      chdir: /etc/ssh/

Friday, March 18, 2016

The Power Of D3


Log...

Friday, January 22, 2016

Neil Olshey's Office

*ring ring*
NO: This is Neil.



Bucks: Have you reconsidered our offer for CJ?

NO: I understand your need for a playmaker and a second go-to scorer next to Middleton, but OJ Mayo and Michael Carter Williams do not really fit our future vision nor do they match CJ's value even with your lottery-protected first round pick. We believe CJ is a leader of the core we have, and will not consider moving him for just any offer.
How do you feel about our last conversation?

Bucks: Jabari is the center piece of our franchise going forward. Losing him plus draft picks would cripple this franchise!

NO: Well you and Jason have a few weeks to talk things over before the deadline. I must call you back later. I have a call from my dentist.
*Hangs up*




NO: lol
Terry: lol
NO: like literally nobody on that team can shoot lol and mayo is a goner for them anyway
Terry: how am I gonna use mcw in any kind of my offense lol nobody double teams him ever
NO : I bet Monroe regrets not coming here.

*ring ring*
NO: This is Neil.


Utah: Hi Neil. You said you'd call us back.
NO: I apologize. We have too many calls coming in inquiring about CJ and our salary cap room.

Utah : Do we have a better price for CJ perhaps? We'd really like a point guard for the future and start moving forward.

NO: We are standing firm on Derrick Favors and Dante Exum, but decided to add Meyers Leonard to that offer. We really believe that CJ is a franchise player who is only just blossoming, and parting with him for anything less than that price would be devastating for us.

Utah: So I should take it as a "no" for Alec Burks and Trey Burke? I really think Alec has a great chance to be Portland's long term answer at your 2. Trey teamed with Lillard for the skills competition at last year's all star, and he would fit into the team seamlessly.

NO: Again, we don't see the values matching up. I also mentioned how Alec's injury history is a concern for us. Please, take your time and consider the options. We still have a few weeks.

Utah: You know Utah loves Derrick... I will have to call you back...
*Hangs up*




NO: man lol why don't they reset that team already
Terry: idk if I've ever seen that team healthy and going places since DW Memo and Boozer lol Hayward Favors Gobert/Kanter core can't even get to the 8 seed all these years
NO: like really good luck picking your pg between trey burke and those European kids smh

*ring ring*
NO: Terry stop making me laugh man lol its Pat Riley probably wanting to salary dump
Terry: lol

NO: This is Neil.


Pat: Mr Olshey, I'm making you an offer you cannot resist. Luol Deng and Josh McRoberts will help your young team learn and succeed, and we will take back Montero and ehh Cliff... that Kansas guy. I'll also add a future second round pick.

NO: Thanks for the inquiry, Pat. The veteran leadership is an underrated asset these days. I will have to talk with Paul until the deadline, but I will keep you posted. Have a nice day.
*Hangs up*

NO: lmao lol
Terry: how are they paying whiteside less than a million and still have a 90 million dollar roster
NO: I know dude they probably can't retain him either because of that Bird right thing and Wade re-sign.
Terry : if we make him keep McRoberts do we have a chance at whiteside?
NO: hmm we do have the money...


*ring ring*
Brooklyn Nets logo

NO: omg it's from Brooklyn lol
Terry: dude we robbed them so much over the years lol have they not learned
NO: yeah I'm not picking it up lol probably wanting to dump iso Joe since he won't buy out

.
.
Zzz
Zzz

*ding*
Terry : ??


NO: uhh just got a text from Phil Jackson. He wants CJ for Jose Calderon.
Terry: wow
NO: yeah but are you surprised tho
Terry: I swear the whole city is like this over there lol
NO: I might offer them Gerald Henderson for Porzingis and see what happens lol he'll publicly denounce me

*ring ring*
NO: restricted number? Wuuut...

NO: This is Neil.


LeBron: Neil this is LeBron what's good.
NO: Wut lol
LeBron: yeah I run this team now. Can I have CJ McCollum?
NO: dude he's a person not a property. What's your offer
LeBron: Mozgov and Shumpert.

NO: what about Love
LeBron: This whole beef between us thing is a smokescreen so we can catch Curry by surprise. We mad tight actually.
NO: oh so like Niccolo Machiavelli?
LeBron : nah like Tupac
NO: anyway
LeBron: good deal tho right?
NO: I want Love. Call me back when you wanna.
LeBron: fine
*LeBron hangs up*

NO: I thought they wanted to dump salary the most
Terry : I think Dan Gilbert doesn't want LeBron catching him trying to save money behind his back
.
.
.
Terry : hey
NO: what
Terry : we're probably gonna keep CJ though right?
NO: yeah. He keeps getting better so let's see how it goes
Terry : yeah the whole "playing Lillard and McCollum together is bad defense" thing is bs anyway.
NO: k I'm probably just gonna take some salary dump deal and then get back to scouting

Saturday, May 30, 2015

JavaScript Calculator

For source code visit: https://github.com/choonghuh/js_calculator


simple calculator
0

7
8
9
+
4
5
6
-
1
2
3
*
0
C
/
enter

Thursday, May 28, 2015

Fancy Resume

Choong Huh
choonghuh@gmail.com
github.com/choonghuh

A beginning software engineer ready to join a professional development team. Great team member and a leader with experience in agile development process. Looking for an entry position in software development.

Personal / Academic Projects

QuickPhysics
-Led a development team for a program to help students solve physics problems with Java UI
-3 rd place in Clark College project showcase
Miniature File Transfer Program
-Server / client command-line FTP program written in C
Proxy with Cache
- Python program to achieve faster web browsing by caching contents
- Inspects HTTP packets to check content up-to-date
Mock Fantasy Basketball Server with XAMPP
- Simple server that allows insert and search with different conditions, and shows results in a table
- HTML / CSS front end; back end with PHP and XAMPP server package

github.com/choonghuh
Academics

Clark College
- Computer Science transfer degree [June 2013]
- Courses: Objected Oriented Programming, Assembly, Microprocessors, Data Structures,HTML/CSS
Washington State University - Vancouver
- Bachelor of Science in Computer Science [May 2015]
- Courses: Operating System, Systems Programming, Database, Automata, Advanced Algorithms, Mobile Apps, Embedded System, Modern Algebra, Numerical Programming, Fundamentals of Software Engineering, Programming Language Development

Job Experience

Assistant Manager at Thurman Market
, Portland OR 2007 to present
- Focus on providing polite and enjoyable customer service
- Sales strategy, accounting and managerial roles in hiring, conflict resolution, inventory etc.
Skills
- Fluency in C, Java, experience in C++, Python, Shell scripts, SQL, PHP, assembly
- Experience in agile development process
- Familiar with Windows, Mac OS, Linux, Android, iOS
- iOS development in XCode
- Native Korean speaker; fluent in English; elementary business fluency in Japanese
Personal
- Teaching Korean to church youth groups
- Community service as a member of Tau Kappa Epsilon fraternity of WSU Pullman
- ACM chapter of WSU-Vancouver
- Translating Japanese news articles
- Blog: choongtalk.blogspot.com

Thursday, May 14, 2015

Dear Brooklyn, Fire Billy King Immediately

During his undeserving lengthy tenure since July 2010 as the general manager of Brooklyn Nets, Billy King has done a magnificent job improving multiple NBA teams. His employer, unfortunately, has not been one of those teams. Over many years, his incompetence has deceived and betrayed the enthusiasm of New Jersey, Brooklyn and Mikhail Prokhorov, one of the most financially invested NBA team owners of all time. With the rumors of his contract extension rumbling I cannot hide my disgust at the fact that King has not yet resigned from his position. Along with Sam Hinkie of Philadelphia 76ers, he is one of the people that must be banned from the NBA's GM role for life.

The disaster began when King, managing the then New Jersey Nets, failed to trade for Carmelo Anthony in 2011 and looked in the direction of an all-star Utah Jazz point guard at war with his legendary coach Jerry Sloan. With his team's losing record supplanting the Nets near the bottom of the Eastern conference, King was desperate to make a 'splash'. He began displaying one of the worst habits for a front office executive: paying heavy prices with future resources for instant gratifications.

[Feb 2011] NJN - UTA
Trade 1: Derrick Favors, Devin Harris and two future first-round picks for Deron Williams

Heroics of Williams, who was a prolific player back then, proved insufficient in turning around a broken franchise as the New Jersey Nets finished the season with 24-58 record. The lockout-shortened season that followed returned only a slightly better 22-44 mark. Today, Williams is battling nagging injuries and considered one of the most inconsistent former all-stars. On the other hand, Jazz were given some players that were starters this season. Although Harris is no longer with the team, Derrick Favors forms the best defensive two-big combination in the league alongside the emerging Rudy Gobert. One of the first-round picks that King surrendered to Utah hit top-3 lottery and became Enes Kanter. This is already making an awful resume for King, but lets call it a mistake for now.

Going through another disappointing season, it was widely questioned whether Williams, an unrestricted free agent, would return to the Nets. King made another desperation move on the trade deadline of 2011-2012 season to acquire a player just good enough.

[Mar 2012] NJN - POR
Trade 2: Shawne Williams, Mehmet Okur and a top 3 protected first round pick for Gerald Wallace

Billy found Gerald Wallace, a productive former all-star forward with injury history that was just about to turn 30. King defended the weak pick protection saying that he saw only three worthy players: Anthony Davis, Michael Kidd-Gilchrist and Thomas Robinson. He went on to give Wallace a 4 year - 40 million dollars extension, which is now considered one of the league's worst contracts and cost the Nets more draft picks to rid of. The Portland Trailblazers went on to draft Damian Lillard who would become the Rookie of the Year and All-Star selection for all seasons after. Billy King saved the Blazers.

Remember that 2011-2012 season ended 22-44 despite the acquisition of Gerald Wallace. Only four months after the Wallace trade, King convinced poor Mikhail Prokhorov to undertake the NBA's absolute worst contract: Joe Johnson's deal that would pay him 89 million dollars over the next four seasons. He handed over another future first-round pick in that process.

[July 2012] BKN - ATL
Trade 3: Deshawn Stevenson, Jordan Farmar, Anthony Murrow, Jordan Williams, Johan Petro, first-round pick 2013 and second-round pick 2017 for Joe Johnson.

To be fair, the pick did not turn into another all-star; It was a Shane Larkin. In the same draft, Nets picked Mason Plumlee who panned out much better as a player than Larkin. Williams re-signed with the Nets, reasoning that the Johnson trade showed the team's will to win now. However, rookie scale contracts are absolute must in order to run a team while staying under the salary cap. King kept trading away future picks for old, fading stars and would eventually pay the price. On the other hand, Atlanta was able to remove bad contracts and re-tool the team with Paul Millsap while wisely re-signing Jeff Teague and Kyle Korver. Atlanta has a pick-swap option in 2015 with Brooklyn, which they will certainly take advantage of. Billy King saved the Hawks.

The following season, Nets had a winning record and defeated Toronto Nets to advance to the second round of playoff. The core of Williams, Johnson and Brook Lopez was looking upward. People were excited in Brooklyn and so was Billy King. Entering the absolute 'win-now' mode, he made one of the biggest head-scratching trades in our recent memories.

[July 2013] BKN - BOS
Trade 4: Gerald Wallace, Kris Humphries, Keith Bogans, Marshon Brooks, Kris Joseph and 2014, 2016, 2018 first-round picks and the right to swap 2017-first round picks for Jason Terry, Paul Pierce and Kevin Garnett

3 first-round picks for players who were already pondering retirement must have seemed like a great deal to King. Celtics, who were preparing for the life after their Big 3, happily accepted the deal. The Nets of Brooklyn entered the 2014 season with the historic 80 million dollars luxury tax bill, and finished in mediocrity. It was only a year later when Paul Pierce became a veteran leader on the Washington Wizards. Kevin Garnett is preparing for retirement in Minnesota. With its young and inexperienced players, Celtics still ended the 2014-15 season with a better record than the Nets did. With the draft picks, rising coach Brad Stevens and its young core, Boston has prepared trade assets to jump into title contention again.

Brooklyn still owes two more picks to the Celtics. In this coming draft, Brooklyn is forced to swap its 15th overall pick with Atlanta's 29th because of Joe Johnson trade. Of course, Atlanta is picking 29 because King helped the Hawks achieve NBA's second-best record. After first-round exit from the playoff, Nets are hoping that Brook Lopez does not leave as an unrestricted free agent. This organization of misery is Billy King's latest resume. He needs to go.

P.S.

Dear Mr. Prokhorov,

if you read this blog please remove this cancer and hire me as your general manager. I will dedicate my life and do it for free for two years if you let me sleep in the team's practice facilities and pay for my Uber rides. You deserve better. Brooklyn deserves better.

Sincerely,

Choong

Tuesday, May 12, 2015

Simple JavaScript practice

Freefall
A still object (initial velocity = 0 m/s) is dropped from a certain height 'h'.
The object falls for a period of time 't' until it hits the ground.
Choose Height option if the time is known, and enter the time in the square box
Choose Time option if the initial height is known, and enter the value.