Static code check for a Gerrit refspec

  • Post Author:
  • Post Category:IT
  • Post Comments:0 Comments

I wanted to introduce static code check for our repo in Gerrit. Gerrit allows you to fetch the given refspec, then you may use git diff-tree to see what files are in the given change. The trouble is that you already need the repo cloned to do so, which is not that efficient for a larger repo. Fear not, the Gerrit ssh API is to the rescue. Let's how to make it work. Let's say you set up a Jenkins job to be triggered from Gerrit whenever a patchset is created. Gerrit sends a bunch of parameter about the given commit to Jenkins, eg. GERRIT_CHANGE_ID=I95e8231824c3d63d063b10c8a1d638cc42e3dd44 GERRIT_CHANGE_NUMBER=40175 GERRIT_PROJECT=myrepo GERRIT_REFSPEC=refs/changes/75/40175/4 Now let's get the files from the patchset using the Gerrit SSH API (you need the jq utility to process the json output): ssh -p $GERRIT_PORT $GERRIT_HOST gerrit query --files --format JSON change:$GERRIT_CHANGE_NUMBER --current-patch-set | jq -r "select(.project==\"$GERRIT_PROJECT\")|.currentPatchSet.files[].file" The above command produces the following output: /COMMIT_MSG aaa.sh bbb.groovy Now we have to filter /COMMIT_MSG, since it's not an actual file in the commit, rather the commit message which we are not interested in this time. So we have two files in the patchset: 'aaa.sh' and 'bbb.groovy'. Once we have the affected files…

Continue Reading Static code check for a Gerrit refspec

The perfect push up workout

  • Post Author:
  • Post Category:fitness
  • Post Comments:0 Comments

Do each variation to failure, and rest with a V-sit hold in between until you are ready for the next exercise. Upper chest: knee push away OR  prowler push away OR decline pushup Middle chest: standard pushup OR archer pushup Lower chest: incline pushup OR planch pushup OR hindu pushup Adduction: twisting pushup OR banded crossover pushup Explosive: knee plyo pushup OR plyo hand release pushup Rest 3-5 mins, then repeat 1-2 times more. https://www.youtube.com/watch?v=AhdtowFDKT0

Continue Reading The perfect push up workout

What lowers and what increases insulin

  • Post Author:
  • Post Category:health
  • Post Comments:0 Comments

Lowers: Keto IF ACV Minerals (Mg, K, Zn, Cr, ...) Vitamin D Excercise Lowering stress Sleep   Increases: Carbs Carbs + protein MSG Excess protein (low fat) Frequent eating Vegetable oils   https://www.youtube.com/watch?v=ek5F1mGq4-4

Continue Reading What lowers and what increases insulin

Optimizing SSD for a desktop

  • Post Author:
  • Post Category:IT
  • Post Comments:0 Comments

Some ideas from https://easylinuxtipsproject.blogspot.com/p/ssd.html Execute fstrim -v / once in a week or so Disable swapping Disable Firefox to write its cache to disk. It should store it in memory instead. Disable hibernation  

Continue Reading Optimizing SSD for a desktop

Nutrients vs longevity

  • Post Author:
  • Post Category:health
  • Post Comments:0 Comments

Dr Berg's theory about how nutrient deficiencies affect your longevity. The best nutrient dense foods you should consume on a daily basis: sea food (oyster, mussel, ...) fish egg dark leafy greens liver olives and olive oil pumpkin seed, sunflower seed organic cheese fermented vegetables https://www.youtube.com/watch?v=MP79H8npMG0  

Continue Reading Nutrients vs longevity

How many calories on keto?

  • Post Author:
  • Post Category:health
  • Post Comments:0 Comments

Start with: - keto - remove snacks - OMAD - OMEOD (1 meal every other day) How much? still hungry satisfied stuffed Additional exercise nutrients sleep reduce stress   https://www.youtube.com/watch?v=a-4GsqS99zc

Continue Reading How many calories on keto?

A journey to the end of the universe

  • Post Author:
  • Post Category:Fun
  • Post Comments:0 Comments

Just saw an amazing video whether it's possible to go to the end of the universe? Long story short: no. It's worth to watch prof. David Kipping's excellent performance on the topic. In a nutshell even travelling at the speed of light, the expansion of the universe outpaces you.  This expansion makes the distance between regions gradually grow, so you have to travel further than you thought you did. https://www.youtube.com/watch?v=b_TkFhj9mgk

Continue Reading A journey to the end of the universe