Bootstrapping Debian package

Debian packages depend on a “Debian” directory. While you could create this by hand, there is a faster way: you can use dh_make. Here is what I used to get started:

create_debian_directory()
{
pushd $1
dh_make -y -s -e ${MAINTAINER_EMAIL} -f ../package-0.0.21.orig.tar.gz

cat > debian/rules <<EOF
#!/usr/bin/make -f
%:
dh \$@

override_dh_auto_configure:
./configure

override_dh_usrlocal:
echo “Skipping dh_usrlocal”

override_dh_shlibdeps:
echo “Skipping dh_shlibdeps”

EOF

sed -e “s/^Build-Depends: /Build-Depends: ${BUILD_DEPENDS}, /” -i debian/control
popd

Things to what’d out for :

  • You have to have the tar.gz file named a certain WAY.
  • The debian/control and debian/rules are what controls everything
  • A good resource is Here
Posted in Uncategorized | Tagged , , , , | Leave a comment

icecc needs not to be in “native” mode

RocksDB was taking a bit too much time to compile so I decided to try out icecc. When I executed it I noticed on the icecream-sundae monitor that my “second” machine was not being used. After a lengthy debugging I realized that RocksDB compiles with -march=native, which in turn forces icecc to compile local only. The solution to this was simple enough:

PORTABLE=1 make -j${BIG_NUMBER}

Hope this helps whoever is trying to use icecc as a cluster for building

Posted in Uncategorized | Tagged , , , , , | Leave a comment

Add included files to your ctags file

To add the headers to the ctags file I found this little gem. And I ended up using it like this:

#!/bin/bash
if [ ! -z $1 ];then
  root_path=$1
else
  root_path="."
fi

gcc -M ${root_path}/* 2> /dev/null | \
  sed -e 's/^ //' -e 's/ \\$//g' | \
  sed -e '/^$/d' -e '/\.o:[ \t]*$/d' | \
  sed -e 's/^.*\.o: //' -e 's/ /\n/g' | \
  cat - <(ls -d ${root_path}/*) | \
  ctags-universal -R -L - --c-kinds=+p --fields=+iaS --extras=+q


# -e 's/^ //'         -> Remove the first space
# -e 's/ \\&//g       -> Remove the training '\'
# -e '/^$/d'          -> Remove empty lines
# -e '/\.o:[ \t]*$/d' -> Remove the lines that have object file paths
# -e 's/^.*\.o: //'   -> Remove the object path from the line
# -e 's/ /\n/g' | \   -> Separate several source files with a return
# cat - <(ls -d ${root_path}/*) -> Append the root_path files

I’m still missing the implementation of the header files though. for another day…

Posted in Uncategorized | Tagged , , , , | Leave a comment

Deoplete works well for latest vim

Neocomplete does not work with my current version of VIM. so I had to install an alternative. Deoplete is writen by Shougo and does the simple autocompletion that I expected to start with. Easy install with Bundles https://github.com/Shougo/deoplete.nvim

Posted in Uncategorized | Leave a comment

GPG links/tutorials/FAQ

Will not write yet another tutorial about how to setup GPG. I will link to the ones that I used to do several things.

Settup up GPG

https://oguya.ch/posts/2016-04-01-gpg-subkeys/

https://blog.tinned-software.net/create-gnupg-key-with-sub-keys-to-sign-encrypt-authenticate/

Setting up subkeys

https://oguya.ch/posts/2016-04-01-gpg-subkeys/

https://wiki.debian.org/Subkeys

Setting up GPG for SSH authentication

https://gregrs-uk.github.io/2018-08-06/gpg-key-ssh-mac-debian/

https://ryanlue.com/posts/2017-06-29-gpg-for-ssh-auth

https://opensource.com/article/19/4/gpg-subkeys-ssh

FAQ

https://security.stackexchange.com/questions/206072/how-do-i-interpret-output-that-produces-gpg-listing-keys

https://superuser.com/questions/1371088/what-do-ssb-and-sec-mean-in-gpgs-output

Posted in Uncategorized | Tagged , , , | Leave a comment

GPG does not output the key IDs by default

Wanted to start signing my mails and my git commits with my newly minted sub key. But when I did a

gpg2 --list-keys

I could not see the key ids to add to my git nor to my muttrc. After some searching around I found this nifty gpg argument that gave me what I wanted.

gpg2 --keyid-format LONG --list-keys

The LONG stands for the 16 character ID. And alternatively you can also define short for the 8 character one.

Posted in Uncategorized | Tagged , , , | Leave a comment

Always remember the clockwise/spiral rule

From time to time I need to go back and see how to “read” the const pointer order when declaring in C++. Here is a good reminder/link for it.

And try to always append a const in order for it to be less confusing.

Posted in Uncategorized | Leave a comment

Simple git commit auto fill

Back in the days when I worked for RedHat I remember having a neat autocomplete git hook that filled in my git commit message. I liked the way it was formatted and I remember it being something similar to this.

* /Path/To/Changed/File0 (Method0):
(Method1)
(Method2)
(Struct)
* /Path/To/Changed/File1 (Method0):
...

Here I try to reproduce this effect by having a very simple script that uses the git diff. Here is the script:

git diff HEAD | \
grep -e '^@@.*@@.*(.' -e '^@@.*@@.*.struct.*{' -e '^diff ..git' | \ 
sed 's/^@@.*@@ /@@ /' | \
sed 'sed 's/ \(int\|double\) / /
sed 's/(./ /' | \
sed 's/^@@.*@@.*struct.*{/@@@ struct/' | uniq | \
awk -F " " '/^diff --git/{gsub(/^./,"",$3);print "#*"$3" :"} /^@@@ struct/{gsub(/{/,"", $3);print "#("$3") :"} /^@@ /{print "#("$2") :"}'

The `grep` line selects the relevant git diff lines. The `sed` lines remote the text that goes around the lines containing the “@@” string. And finally the awk line formats three types of lines: 1. the file change, 2. the method change, and 3. the struct change.

This script has some shortcomings:

  1. New methods, structs do not show up
  2. Sometimes the diff will have a method, struct name that is not actually changed.

Still I’ll make this post as a reminder to myself and a place where I can start next time I want to “give this a shot”

Posted in Uncategorized | Tagged , , , | Leave a comment

Phenology Detection At IBIMET

I was a visiting researcher at the Institute of BIoMETeorology (IBIMET) in Sassari Italy in the month of July 2013. My work there was directed at applying known research from the Richardson lab for using color responses to characterize phenological behavior. You can find the relevant research in this paper.

Research at IBIMET centers on monitoring phenological behavior of the different plant species in the north-west of Sardinia in the Porto Conte – Capo Caccia Nature reserve. The people at IBIMET-Sassari have installed a pan-tilt-zoom camera in a location of interest and have collected images during several months of the species growing in the natural reserve. I have compiled these images in a this movie which shows, among other things, the flowering of a species (around the 8th second). This is picked up by the excess green signal calculated with the Richardson paper concepts.

The gist of my work in Sassari can be summarized in the following figure:

The blue line represents the "raw" signal from the Excess Green Color space on the image series. The red represents the fitted Sigmoid signal. The date is calculated using the inflection point of the sigmoid and is when the flowering occurred.

The blue line represents the “raw” signal from the Excess Green Color space on the image series. The red represents the fitted Sigmoid signal. The date is calculated using the inflection point of the Sigmoid and is when the flowering occurred.

We see how the color signal can pick up relevant phenological variations. The idea is to automate the whole process and have an automata go through large amounts of image databases trying to detect these types of behavior.

Posted in Uncategorized | Tagged , , | Leave a comment

Leaf Counting and Identification.

Automating plant phenotyping. We have added an initial approximation to leaf counting and identification. This will detect the leaf centers and give the number of leafs of a plant. Inspiration came from a paper presented at CVPPP20143-D Histogram-Based Segmentation and Leaf Detection for Rosette Plants. Jean-Michel Pape et. al. 2014. And while there is still some false negatives that need to be addressed, I think the use of a simple distance map, together with local maximum is a pretty good starting point. Here is an example image from our data set:

The circles mark the places where we detect a leaf.

The circles mark the places where we detect a leaf. Notice how the plants in the right did not get detected, this is due to segmentation errors.

The circles mark the detected leaf centers. Some of the leafs of these plants are not detected because they don't translate into a detectable maximum in the distance transformation.

The circles mark the detected leaf centers. Some of the leafs of these plants are not detected because they don’t translate into a detectable maximum in the distance transformation.

Posted in Uncategorized | Tagged , , , , , , , | Leave a comment