Science trip to Iceland

I know that many of you are already tapped out with donations because of the recent world events. I’ve held off making this post because of that, but the boys have asked if I’ve shared their letter on my social media to help them raise money for their trip next year. Below you will find Marco and Adan’s letter. Thanks for taking the time to look over their letter.


Hello everyone it’s Marco Rodriguez, hope everything is going well!

My brother, Adan, and I were given the opportunity to go to Iceland for a
week as a trip for our school. This is an amazing opportunity, but
unfortunately, we currently cannot afford to pay for the entire trip in the
time given without spending more money than we should. We humbly request
that anyone reading this would consider donating a little bit of money
towards the trip to allow us to go have the trip of a lifetime.

For anyone willing to donate (remember every dollar counts so no need to
donate lots of money if it is not convenient), you can donate on the
online donation site. We each have our own link to our trip.

Donate to Marco

Donate to Adan

Click the links above and it will take you to the donation site (*Note: all funds donated on the
website will go directly towards the payment for the trip).

This trip package includes:

* Round-trip flights on a major carrier
* Comfortable motorcoach
* 4 overnight stays in hotels with private bathrooms
* Breakfast and dinner daily
* Full-time Tour Director
* 1 sightseeing tour led by your Tour Director & 3 walking tours
* Entrances: National Museum * Skógarfoss Folk Museum * Blue Lagoon
* Experiential learning: Thingvellir National Park geology walk * Greenhouse visit * Thorvaldseyri Farm
* Optional: Glacier Walk

Any payments are due by February 2018. As you can probably tell this is a great opportunity for
me and my brother and we would love to go, and any donations would be much
appreciated. We would be departing on the trip in March 2018

Hope everyone has a great day!

Thank you,

Marco & Adan

/home dir cleaning

After a failed Fedora 26 upgrade on Friday, I spent the day trying to recover a corrupted rpm database, missing packages, not booting into gdm. I recovered it enough to boot, but it’s really in a weird state.

While preparing to backup my homedir, I was go through files I no longer needed. I’ve been cargo culting my homedir since I started working at Red Hat in 2004.

Here are the oldest files from day one:

[jesusr@transam ~]$ grep "Apr 19  2004" /tmp/2004files.tzt 
-rw-r-----. 1 jesusr jesusr 153 Apr 19  2004 ./.config/nautilus/first-time-flag
-rw-r-----. 1 jesusr jesusr 82 Apr 19  2004 ./.metacity/sessions/1082391428-6426-2821178921.ms
-rw-r-----. 1 jesusr jesusr 356 Apr 19  2004 ./.metacity/sessions/1082412707-4015-1328912501.ms
-rw-r-----. 1 jesusr jesusr 82 Apr 19  2004 ./.metacity/sessions/1082413316-4377-2885991371.ms
-rw-rw-r--. 1 jesusr jesusr 226 Apr 19  2004 ./cvs/rhn/ncsu-student-projects/message-bus/rhn/LoggerTest/.classpath
-rw-rw-r--. 1 jesusr jesusr 369 Apr 19  2004 ./cvs/rhn/ncsu-student-projects/message-bus/rhn/LoggerTest/.project
-rw-rw-r--. 1 jesusr jesusr 6377 Apr 19  2004 ./cvs/rhn/ncsu-student-projects/message-bus/rhn/SqlTest/src/TestDB.java
-rwxrwxr--. 1 jesusr jesusr 5441 Apr 19  2004 ./cvs/rhn/up2date/test/PyFontify.py
-rwxrwxr--. 1 jesusr jesusr 17900 Apr 19  2004 ./cvs/rhn/up2date/test/cov2html.py
-rw-rw-r--. 1 jesusr jesusr 23499 Apr 19  2004 ./cvs/rhn/up2date/test/coverage.py
-rwxrwxr--. 1 jesusr jesusr 2043 Apr 19  2004 ./cvs/rhn/up2date/test/testRhnChannel.py
-rwxrwxr--. 1 jesusr jesusr 4648 Apr 19  2004 ./cvs/rhn/up2date/test/testTransactions.py

Go through my homedir is like a digital archaeological dig 🙂

vij update

Vij is a bash function that makes editing specific files easier to find in a deeply nested directory structure. At the time I was working in Java which is notorious for having a deep directory structure. In 2008, I updated vij to be more powerful by offering a list of files matching the name, giving you the option to make a choice.

Our current project is in Golang and I’ve found a deficiency in vij. We have a vendor directory which contains our dependencies and sometimes vij will find files in the vendor directory which I don’t want to edit. It would be nice to exclude a directory from the find command used by vij.

I always want to ignore the vendor directory. But I also want to allow arbitrary names to also be filtered out. The existing vij implementation results in the following crazy output.

$ vij util.go

Multiple matches found...
1: ./pkg/broker/util.go
2: ./pkg/fusortest/util.go
3: ./vendor/k8s.io/kubernetes/vendor/golang.org/x/crypto/ssh/terminal/util.go
4: ./vendor/k8s.io/kubernetes/vendor/github.com/vmware/photon-controller-go-sdk/photon/util.go
5: ./vendor/k8s.io/kubernetes/vendor/github.com/spf13/viper/util.go
6: ./vendor/k8s.io/kubernetes/vendor/github.com/spf13/cobra/doc/util.go
...
16: ./vendor/k8s.io/kubernetes/vendor/github.com/kr/pty/util.go
...
108: ./vendor/github.com/coreos/etcd/client/util.go
q: Quit

? 

I just want to see the util.go files in my code tree and ignore all of the ones in vendor. I changed the dafiles variable to have two more options. One is always ignore vendor from the normal use case, but also allow the user to pass in a string to filter on.

    if [ "$3" == "" ]; then
        dafiles=$(find . -type f -name "$2" -not -path "*/vendor/*")
    else 
        dafiles=$(find . -type f -name "$2" | grep -v $3)
    fi

Now when I run vij util.go, vij ignores the vendor directory.

$ vij util.go

Multiple matches found...
1: ./pkg/broker/util.go
2: ./pkg/fusortest/util.go
q: Quit

? 

Let’s say I want to find all files named User*.java but not the ones in the test directory. You can simply supply “test” as the second argument to vij.

BEFORE

$ vij User*.java

Multiple matches found...
1: ./src/main/java/org/candlepin/auth/permissions/UserUserPermission.java
2: ./src/main/java/org/candlepin/auth/permissions/UsernameConsumersPermission.java
3: ./src/main/java/org/candlepin/auth/UserAuth.java
4: ./src/main/java/org/candlepin/auth/UserPrincipal.java
5: ./src/main/java/org/candlepin/model/User.java
6: ./src/main/java/org/candlepin/model/UserCurator.java
7: ./src/main/java/org/candlepin/resource/UserResource.java
8: ./src/main/java/org/candlepin/service/UserServiceAdapter.java
9: ./src/test/java/org/candlepin/auth/UserPrincipalTest.java
10: ./src/test/java/org/candlepin/auth/permissions/UsernameConsumersPermissionTest.java
11: ./src/test/java/org/candlepin/model/UserTest.java
12: ./src/test/java/org/candlepin/resource/UserResourceTest.java
q: Quit

? 

AFTER

$ vij User*.java test

Multiple matches found...
1: ./src/main/java/org/candlepin/auth/permissions/UserUserPermission.java
2: ./src/main/java/org/candlepin/auth/permissions/UsernameConsumersPermission.java
3: ./src/main/java/org/candlepin/auth/UserAuth.java
4: ./src/main/java/org/candlepin/auth/UserPrincipal.java
5: ./src/main/java/org/candlepin/model/User.java
6: ./src/main/java/org/candlepin/model/UserCurator.java
7: ./src/main/java/org/candlepin/resource/UserResource.java
8: ./src/main/java/org/candlepin/service/UserServiceAdapter.java
q: Quit

? 

Here’s the full implementation of the updated vij:

# reused by other commands that require a filename
__dafiles ()
{
    cmd=$1
    if [ "$3" == "" ]; then
        dafiles=$(find . -type f -name "$2")
        #dafiles=$(find . -type f -name "$2" -not -path "*/vendor/*")
    else
        dafiles=$(find . -type f -name "$2" | grep -v $3)
    fi
    matches=$(echo $dafiles | gawk '{print NF}')

    case "$matches" in
        0)
           echo "No matches found"
           show=""
           ;;
        1)
           show=$dafiles
           ;;
        *)
           echo
           echo "Multiple matches found..."
           i=1
           for option in $dafiles
           do
              echo "$i: $option"
              i=`expr $i + 1`
           done
           echo "q: Quit"
           echo 
           read -p "? " ans
           if [ "q" == "$ans" ]; then
              show=""
           else
              show=$(echo $dafiles | gawk '{print $'$ans'}')
           fi
           ;;
    esac

    if [ "" != "$show" ]; then
       $cmd $show
    fi
}

vij ()
{
    __dafiles "vim" $1 $2
}

Charisma

Looking back through the past elections going back to the 1980 election of Reagan, I noticed something about the winners. All but one had charisma. Despite some candidates being more capable and experienced. The charismatic candidates were better able to rile up their voters to get them to come out and vote, coupled with particular pains felt by those particular voters.

Let’s take a look at the elections:

1980: Reagan vs Carter (incumbent)

We had an oil shortage, inflation was high, coupled with high unemployment. Trouble abroad with Iran (hostages), and some other factors. Reagan was a masterful orator and could communicate with the masses. He gains the nickname, “Great Communicator“. He is able to get everyone on his side, wins in a landslide 489-49 electoral votes. Charisma wins.

1984: Reagan (incumbent) vs Mondale 

The economy is doing better for some, I still heard rumblings of tough times from the lower middle class. AIDS epidemic is front and center in the news. The First Lady, Nancy, is out and about with say no to drugs campaign. Mondale is not a very exciting candidate and things weren’t “feeling” so bad for the incumbent president. But it is hard for Mondale to compete with the charisma of Ronald Reagan, being obliterated in the general election 525-13.  Charisma crushes it.

1988: Bush (HW) vs Dukakis

Ok this is the one election that I felt wasn’t really affected by charisma of the candidates. I mean Dukakis was short and didn’t have the “look” people wanted in a president. Bush is actually quite boring but he gets to ride on the coat tails of a hugely successful and charismatic Reagan. I used to say the Republicans screwed themselves when they passed the two-term limit amendment to prevent another FDR. I think Reagan would’ve easily won a third term. I guess they were protecting themselves from a possible third Clinton or Obama term in the future 🙂 I digress, Bush goes on to win 426-111. We have two pretty boring candidates, for this argument I will give Bush the charisma points. Charisma wins again.

1992: Clinton vs Bush (HW) (incumbent)

Ah my first election, I missed being able to vote in 1988 by a measly one year. So I was excited to begin the process of being able to vote. We’ve entered a new decade. Just coming off the Gulf War, some folks are upset that we went to war. Oil prices spiked in 1990 still fresh in minds. People are still talking about trickle down and supply side economics from the 80s not working for them. A charismatic southern democrat, Bill Clinton. He found a way to engage the young voters. He’s able to charm folks to a win over the incumbent President Bush. Clinton wins 370-168 even with a third party candidate in the mix. Charisma for the win.

1996: Clinton (incumbent) vs Dole

The economy is booming, the internet is opening to public, and gas prices were low, good ole $1 for a gallon. The Dow Jones was hovering in the 5000, by election time it had risen above 6000. Personally, just graduated college in 1995, got a good paying job as a software engineer. The administration wasn’t doing as well publicly though. Despite the scandals happening at the time, like the Lewinsky scandal, Clinton marches to a decisive 379-159 win over the experienced but less charismatic, Dole. Charisma 5 for 5 so far.

2000: Bush (Dubya) vs Gore

The new millennium. We survived the doom and gloom of the Y2K bug where the entire internet was going to just shutdown because of storing years as 2 digits instead of four, nothing happened 🙂 The Dow Jones is well into 10000.  Tech is moving a faster pace: Google, founded in 1998 and  Amazon, founded in 1994, are both thriving. This is the year I got married, relocated to North Carolina, got a new job, and bought our first house all in the span of 4 months. So the Clinton/Gore administration policies were serving me just fine. The rest of the country didn’t seem to agree with me, well they kind of did.  This would’ve been another case where the 22nd amendment hindered a possible third term, Clinton was still quite popular, with an approval rating of low to mid 60s. Despite his approval ratings, Gore was very boring. He was intelligent and a statesman but just bleh. In comes a cowboy, a president you could have a beer with, but has the rough and tough charisma people think we need. This was a devastating election because it was so hotly contested when CNN announces it for Gore only to retract it because of discrepancies in Florida. Ultimately, Bush wins the election 271-266. Cowboy charisma wins over boring statesman.

2004: Bush (incumbent) vs Kerry

Just 3 years after the worst attack on American soil, we are at war in Afghanistan and Iraq. The economy isn’t fairing very well, after the dot com bust. Gas prices are rising, finally hitting $2. Bush has a pretty high approval rating, in the 60s, coming off his first term and his handling of September 11th. Remember, Bush was the cowboy. We put up John Kerry to be the opposing candidate. Kerry was a skilled politician, but not charismatic at all. He added John Edwards to his ticket which helped a little, but not enough to overcome the cowboy charisma of Bush. Bush wins 286-251. Charisma 7, boring 0.

2008: Obama vs McCain

In 2008, we are all annoyed at the high gas prices rising well past $3/gallon. Ravaged New Orleans by Hurricane Katrina which was hugely mismanaged, and Bush was blamed for it. The economy is doing poorly still reeling from the dot com bust and in the midst of what folks termed, The Great Recession. A young charismatic African-American, Barack Obama, rises from the Democratic party to round up millennials and minority groups with an easy to remember slogan: Yes We Can. Contrast this to McCain which many liberals seemed to like except when he was running for president, he became a different person to appeal to his base. He wasn’t very charismatic, which he tried to offset with his running mate, Palin. These two could not be more opposite. Obama wins 365-173 to become the first African-American president.

2012: Obama (incumbent) vs Romney

Two years after the Patient Protection and Affordable Care Act passes, people are upset at being forced to get health care. The administration bailed out the auto industry, bailed out Wall Street, gas prices are still in the upper $3. But the economy has survived, the Dow Jones hit a low of 6627 in 2009. By 2012, it had rebounded back to 13000. Romney was a capable candidate, especially compared to Bush from 2000. He was a successful governor, he would’ve been a capable president. Romney was missing one thing, charisma. He was no match for Obama’s charismatic speeches. Obama wins the 2012 election, 332-206.

2016: Trump vs Clinton (Hillary)

We finally hit the present. Gas prices are back into the low $2 range. The Dow Jones has climbed above 18000. This was an election purely based on charisma. Donald Trump is able to rile up his base to get people voting. He did it in a different manner, a pretty nasty bully but behind all the nasty things he said, he did have a message that many folks heard. But the Democrats thought that an experienced candidate that could maneuver the intricacies of the presidencies would be enough to win. We missed one aspect, Hillary Clinton was a dud from a personality point of view. She always seemed fake, tried to hard to empathize and I believe that was truly her undoing. Trump wins 306-232. Charisma wins yet again.

I’m extremely disappointed in the outcome of this years election. I still believe that Hillary Clinton was a more qualified candidate. I think she would’ve been tougher than any man could ever hope to be. She would’ve been a hawk in the Oval Office. She just couldn’t convince the people of that, which is equally important.

I firmly believe it doesn’t matter how much you know and how capable a leader you could be, if you lack personality you will NOT win the presidency. You need to have the charisma to be able to rile up your voters in order to increase your turn out. That’s really all it takes now, in this age of social media.

Looking forward to 2018 mid-terms and 2020! I just pray to God that Trump doesn’t destroy everything before then.

Pretty Print directory of .json files

I had a bunch of compressed json files that I needed to pretty print to make them more readable. This little snippet will create a new pretty printed json file prefixed with pp:

ls *.json | xargs -I {} sh -c "cat {} | python -mjson.tool > pp{}"

Instead of having to look at files that look like this:

{ "attributes": [ { "name": "type", "value": "PKT" }, { "name": "arch", "value": "x86_64,x86" }, { "name": "name", "value": "Awesome OS" } ], "dependentProductIds": [], "href": "/products/00", "id": "00", "multiplier": 1, "name": "Awesome OS", "productContent": [ { "content": { "arches": null, "contentUrl": "/content/6/$releasever/$basearch/debug", "gpgUrl": "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-awesome-os", "id": "FFFF", "label": "awesome-os-debug-rpms", "metadataExpire": 86400, "modifiedProductIds": [ "0A" ], "name": "Awesome OS (Debug RPMs)", "releaseVer": null, "requiredTags": "awesome-os-server", "type": "yum", "vendor": "Candlepin" }, "enabled": false } ] }

You get a bunch of files that look like this:

{
    "attributes": [
        {
            "name": "type",
            "value": "PKT"
        },
        {
            "name": "arch",
            "value": "x86_64,x86"
        },
        {
            "name": "name",
            "value": "Awesome OS"
        }
    ],
    "dependentProductIds": [],
    "href": "/products/00",
    "id": "00",
    "multiplier": 1,
    "name": "Awesome OS",
    "productContent": [
        {
            "content": {
                "arches": null,
                "contentUrl": "/content/6/$releasever/$basearch/debug",
                "gpgUrl": "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-awesome-os",
                "id": "FFFF",
                "label": "awesome-os-debug-rpms",
                "metadataExpire": 86400,
                "modifiedProductIds": [
                    "0A"
                ],
                "name": "Awesome OS (Debug RPMs)",
                "releaseVer": null,
                "requiredTags": "awesome-os-server",
                "type": "yum",
                "vendor": "Candlepin"
            },
            "enabled": false
        }
    ]
}

Cold but fun day

Today was a cold but fun day. We started the day with Iliana’s 8:30am softball game (they won 8-5). Adan had a pitching lesson at 10:45am where he has improved his fastball and change up pitches. He worked on his curve and some pickoff move all while battling cold, wind and what felt like a sandstorm from the field. Home for about 2 hours to eat lunch and warm up before heading out again, this time for Marco’s 2:30 soccer game. The won that game 5-1 with some outstanding ball movement. Still frozen, we weren’t done yet. Off to Marco’s baseball game. His team won that game, but the best part was Marco hit a SOLO HOME RUN over the centerfield fence. It was AWESOME! We finished the evening with dinner at Chipotle and watched Star Wars the Force Awakens when we got home.

Installed rear shocks on Mazdaspeed

We had a rare free day this weekend, usually they’re filled up with softball, baseball and/or soccer games. I took the free day to do some car maintenance. I’m in desperate need of new shocks and struts, already ate through one set of tires. Saturday I replaced the rear shocks. It took me 4 hours, taking pictures and reading instructions that came with the parts.

It’s pretty difficult finding parts for the Mazdaspeed version of the Mazda 3, it’s either OEM parts from the Mazda dealer which is clearly $$$, or it’s some performance parts. I was trying to balance price with performance, so I ended up with the Corksport adjustable shocks and struts. They are the cheapest yet still offer some level of performance. I really wanted to get the spring combo but that was another $200.

 

Why not take it to a shop? Well the last 2 quotes I got were about $250+ in labor for the rear shocks. That’s too rich for my blood especially for removing 4 bolts. Here’s a high level description of what I had to do, see the Corksport site for detailed instructions and be sure to checkout the Mazdaspeed forums for advice as well.

  1. Raise vehicle onto jack stands, since you’ll need the jack for a later step IMG_0691
  2. Use the floor jack on the lower control arm to compress the rear spring, and to alleviate pressure on the shocks.IMG_0701
  3. Use a 17mm socket to remove the lower bolt of shock  IMG_0693
  4. Use a 12mm deep socket to remove the two nuts holding the top mount in place.IMG_0697
  5. Now you need to manually compress the shock to allow it to clear the lower bracket in order to be removed from the vehicle.
  6. Once removed, used a 13mm socket to remove the nut holding the aluminum mount to the shock. I had to use a pair of vise grips to hold the shock bolt from moving while removing the nut. The stock bump stops were shot.IMG_0704

That is the standard removal steps. Now the rest are Corksport specific. For the Corksport shocks you only need to keep the aluminum mount.

  1. Retain the stock aluminum mounts, remove the stock bump stops (they’re probably trash anyway), and the stock dust cover.
  2. Place the aluminum mount onto the Corksport shock. You will notice there isn’t much bolt that comes through the mount. This took me a while to figure out. Press the mount down onto the shock, you might have to compress the shock, then put the nut on the bolt and start turning until it latches. This took a bit of pressure and patience. Tighten the nut to 18 lb-ft of torque.
  3. The bump stops pre-installed on the Corksport shocks will compress to allow you to properly torque down the nut and install the mount.

At this point the old shocks will have been removed, the new ones have the mounts installed, and you are ready to install the new ones on the vechicle.

  1. Manually compress the shocks so you can get the shocks into the wheel well.
  2. Insert the top mount onto the 2 mounting bolts.
  3. Align the bottom to the lower bracket. You have 2 options here.
    1. Let the bottom go through the bracket to be compressed by hand later
    2. Keep the shock compressed while you insert the 17mm bolt to hold the bottom of the shock in place.IMG_0702
  4. Install the 12mm nuts on the top mounting bolts. Torque them down to 18 lb-ft.
  5. Now install the 17mm bolt on the bottom and torque it down to 50 lb-ft.
  6. Lower the floor jack to relieve the pressure on the spring.
  7. Re-install the tire and you’re DONE! IMG_0699 IMG_0698
  8. Repeat for the other side.

Now I need to replace the front struts. Those are not as trivial since they involve compressing the springs on the strut, and lot’s of penetrating oil. We’ll see if $250+ is worth it for the front or if I feel inspired to do this myself.

Happy 14th Birthday Adan!

Today we celebrate Adan’s 14th birthday. He’s grown a lot both physically and mentally 🙂 He’s becoming quite a wonderful young man.

Here he is having fun with some sunglasses I got from work.

21292971852_ab3a3e0e9a_k

His baseball jersey.

21803625642_430849b916_k