Jekyll2022-08-19T15:00:17+00:00https://gabe.io/feed.xmlgabe.ioJust a small blog for a small site.
Debugging helm charts from terraform2022-07-18T00:00:00+00:002022-07-18T00:00:00+00:00https://gabe.io/2022/07/18/debugging-helm-charts-from-terraform<p>
The best way I've found to debug a helm chart from terraform, is to use the data helm_template terraform resource and to dump the full template out to files.
</p>
<pre>
data "helm_template" "this" {
name = "helm-chart"
namespace = kubernetes_namespace.this.0.metadata.0.name
version = local.version
repository = "https://charts.${your chart domain here}.com"
chart = local.chart
values = [
local.values
]
}
resource "local_file" "this" {
for_each = data.helm_template.this.manifests
filename = "./template_debug/${each.key}"
content = each.value
}
</pre>
<p>
Doing this with the "bad" and "good" helm chart installs will show you the full difference of the things that are about to be installed.
In my case I was switching from a values template file to set blocks within terraform, and had made a typo in my set blocks where one resources limit was being written twice instead of setting a request, and the app was crashing after eating up more memory than the base request asks for.
Admittedly now that I'm aware that the base request should be higher I will be raising the limit, but this was still a very effective way of seeing where I had went wrong.
Always go back to the basics, diffing changes has been one of the best ways for me to see where I've gone wrong.
</p>The best way I've found to debug a helm chart from terraform, is to use the data helm_template terraform resource and to dump the full template out to files.Fixing Corrupted git blobs2015-07-20T00:00:00+00:002015-07-20T00:00:00+00:00https://gabe.io/2015/07/20/fixing-corrupted-git-blobs<p>Git is an amazing tool.
It single handedly helps bring everyone better software by aiding developers in
keeping track of changes to their source code, and allow others to make change
suggestions. This being said like every software you can find a way to break it.
I managed to find a way, of course lol. The biggest thing I am going to stress
before continuing is the point behind keeping your git repo synced as often as
possible and with multiple locations (>1). When using git and an autimated
tool like syncthing or bittorrent sync to keep your repository synced between
multiple computers git+sync can make mistakes (mostly non-information). What I
mean by that is the user can push/pull at a time when sync is not finished,
syncing, and enevitably can corrupt your repositories. As I said keeping your
repository in multiple places really helps!</p>
<p>When I came across this the
hard way I remembered how I used to sync my repositories between the computer
and a usb I carry around with <code>rsync</code>. This tool is beautiful also,
though I think most software is, it finds the differences between two folders
and adds the required files. If a file differs it overwrites the file (this can
be dangerous if you want both versions). But the way I am going to show you how
to fix git both files should be identical, and therefore rsync is perfect. If
you manage to corrupt the <i>bare</i> repository on the usb but the repository
on the coputer is fine this is for you.
<code>rsync -avz <from(good repo)> <to(bad repo)></code>
is the syntax for <code>rsync</code>.
The <code>-a</code> flag literally means archive.
The <code>-v</code> is standard verbose.
The <code>-z</code> is compress which can help with speed.</p>
<h2>Please read this it's imporant</h2>
<p>A git repo which you can see your files is a normal git repository which git
stores it’s bare repository in the .git directory (so you don’t have to see git
do its magic). A bare repo is essentially just the .git without any of your
files showing, there are more differences but that is what you need to know to
continue.</p>
<p>Now for the fix:
<h4>Normal(good) to Bare(bad)</h4>
<code>rsync -avz /path/to/repo/.git/objects /path/to/bad/repo/objects</code>
<h4>Normal(good) to Normal(bad)</h4>
<code>rsync -avz /path/to/repo/.git/objects /path/to/bad/repo/.git/objects</code>
<h4>Bare(good) to Normal(bad)</h4>
<code>rsync -avz /path/to/repo/objects /path/to/bad/repo/.git/objects</code>
<h4>Bare(good) to Bare(bad)</h4>
<code>rsync -avz /path/to/repo/objects /path/to/bad/repo/objects</code>.</p>
<p>
To understand what I did you have to understand a little more of how git works.
When you make changes git stores your files within a file, the file name is the
hash of your file. Those hashes are stored under the objects directory within a
git repository, and are usually called blobs. If you look into the objects
directory you will see 244 directories which have names starting with
00, 01, 02 and running until ff. This is the start of the file's hash when you
dive into one of these directories you might (depending on your luck & size of
the repo) will see files named with the rest of the hash. Thusly, 00(directory)
+ 18d2628a050251b51fa7dbbc125b667a466a43(file) is the full hash. If you know
hashes the likely hood of a collition is very small though with the nature of
hashes it's unavoidable. Hashes take a file or string and in essence add up the
bits and give you back a string that 99.9999% uniquely identifies it from any
other string/file. Git uses this to do it's magic.
Allowing a user to modify & share a file and "never" have that modification
collide with any other user's modifications even to the same file.
</p>Git is an amazing tool. It single handedly helps bring everyone better software by aiding developers in keeping track of changes to their source code, and allow others to make change suggestions. This being said like every software you can find a way to break it. I managed to find a way, of course lol. The biggest thing I am going to stress before continuing is the point behind keeping your git repo synced as often as possible and with multiple locations (>1). When using git and an autimated tool like syncthing or bittorrent sync to keep your repository synced between multiple computers git+sync can make mistakes (mostly non-information). What I mean by that is the user can push/pull at a time when sync is not finished, syncing, and enevitably can corrupt your repositories. As I said keeping your repository in multiple places really helps! When I came across this the hard way I remembered how I used to sync my repositories between the computer and a usb I carry around with rsync. This tool is beautiful also, though I think most software is, it finds the differences between two folders and adds the required files. If a file differs it overwrites the file (this can be dangerous if you want both versions). But the way I am going to show you how to fix git both files should be identical, and therefore rsync is perfect. If you manage to corrupt the bare repository on the usb but the repository on the coputer is fine this is for you. rsync -avz <from(good repo)> <to(bad repo)> is the syntax for rsync. The -a flag literally means archive. The -v is standard verbose. The -z is compress which can help with speed. Please read this it's imporant A git repo which you can see your files is a normal git repository which git stores it’s bare repository in the .git directory (so you don’t have to see git do its magic). A bare repo is essentially just the .git without any of your files showing, there are more differences but that is what you need to know to continue. Now for the fix: Normal(good) to Bare(bad) rsync -avz /path/to/repo/.git/objects /path/to/bad/repo/objects Normal(good) to Normal(bad) rsync -avz /path/to/repo/.git/objects /path/to/bad/repo/.git/objects Bare(good) to Normal(bad) rsync -avz /path/to/repo/objects /path/to/bad/repo/.git/objects Bare(good) to Bare(bad) rsync -avz /path/to/repo/objects /path/to/bad/repo/objects. To understand what I did you have to understand a little more of how git works. When you make changes git stores your files within a file, the file name is the hash of your file. Those hashes are stored under the objects directory within a git repository, and are usually called blobs. If you look into the objects directory you will see 244 directories which have names starting with 00, 01, 02 and running until ff. This is the start of the file's hash when you dive into one of these directories you might (depending on your luck & size of the repo) will see files named with the rest of the hash. Thusly, 00(directory) + 18d2628a050251b51fa7dbbc125b667a466a43(file) is the full hash. If you know hashes the likely hood of a collition is very small though with the nature of hashes it's unavoidable. Hashes take a file or string and in essence add up the bits and give you back a string that 99.9999% uniquely identifies it from any other string/file. Git uses this to do it's magic. Allowing a user to modify & share a file and "never" have that modification collide with any other user's modifications even to the same file.An Education Platform2015-07-17T00:00:00+00:002015-07-17T00:00:00+00:00https://gabe.io/2015/07/17/an-education-platform<p>I have slowly been working on improving a small app I built for my senior
project class though it was as much for the class as it was for me. It is my
attempt to replace Blackboard which has been my most loathed education platform
(and only one I have had the misfortune of using). I, being a student
personally, think I would be a better candidate for creating an education
platform. Though I haven’t had input from any teachers yet but will absolutely
enjoy their oppinions. It will include many things like push notifications for
updates to courses you are presently taking, direct messaging so teachers can
talk directly to students outside the class room and faster than email,
a forum area (one level) allowing students to ask questions and have other
students or teachers answer, a blog area for teachers to directly push
updates/info to students without extra clutter like comments from other
students which should be addressed withing the forum area and so much more!</p>I have slowly been working on improving a small app I built for my senior project class though it was as much for the class as it was for me. It is my attempt to replace Blackboard which has been my most loathed education platform (and only one I have had the misfortune of using). I, being a student personally, think I would be a better candidate for creating an education platform. Though I haven’t had input from any teachers yet but will absolutely enjoy their oppinions. It will include many things like push notifications for updates to courses you are presently taking, direct messaging so teachers can talk directly to students outside the class room and faster than email, a forum area (one level) allowing students to ask questions and have other students or teachers answer, a blog area for teachers to directly push updates/info to students without extra clutter like comments from other students which should be addressed withing the forum area and so much more!Camp Fatima of NJ2014-08-16T00:00:00+00:002014-08-16T00:00:00+00:00https://gabe.io/2014/08/16/camp-fatima-of-nj<p>I have been helping out at this organization for a very long time (14 years). In
that time I have seen a ton of people come and go, and not even close to as many
people stay. I have to say that I am thankful that my parents were the ones to
bring me here, and I have continued the tradition and expanded on it by not only
attending the weekends but also attending the summer camp. When I heard how much
it was to run camp each year I was astonished, and how much they were collecting
was a scary difference. Which is why I have come to the internet to ask for help
from anyone who uses amazon. Amazon Smile is Amazon’s way of giving back to
organizations like ours and really helping make it happen. If anyone is
interested in helping please go
<a href="http://smile.amazon.com/gp/charity/about.html/ref=smi_se_uds_learn_saas">here to Amazon Smile</a>
and choose Camp Fatima of NJ. And when ever you shop on Amazon go to Amazon
Smile and when you purchase anything it will be helping us keep camp
up and running.</p>I have been helping out at this organization for a very long time (14 years). In that time I have seen a ton of people come and go, and not even close to as many people stay. I have to say that I am thankful that my parents were the ones to bring me here, and I have continued the tradition and expanded on it by not only attending the weekends but also attending the summer camp. When I heard how much it was to run camp each year I was astonished, and how much they were collecting was a scary difference. Which is why I have come to the internet to ask for help from anyone who uses amazon. Amazon Smile is Amazon’s way of giving back to organizations like ours and really helping make it happen. If anyone is interested in helping please go here to Amazon Smile and choose Camp Fatima of NJ. And when ever you shop on Amazon go to Amazon Smile and when you purchase anything it will be helping us keep camp up and running.Sometimes you think it won’t work2014-08-14T00:00:00+00:002014-08-14T00:00:00+00:00https://gabe.io/2014/08/14/sometimes-you-think-it-wont-work<p>I don’t know about the rest of the coders out there but, I am still trying to
improve my understanding of computer languages as a whole. With this comes
understanding, of corse, and these weird moments when I stop writing a line for
a second and go “is this really going to work”, then continue on to think when
it does, “it actually was that simple.”. I guess after years of coding it’s
nice to be able to actually get things done you want to get done instead of
having to keep tinkering with it continuously until it finally works. This blog
for example just amazed me in many different ways. It’s amazing how small the
code for this blog actually is. And the speed potential behind it is quite
amazing also.</p>
<p>UPDATE: This blog has been moved to <a href="https://pages.github.com">github pages</a></p>I don’t know about the rest of the coders out there but, I am still trying to improve my understanding of computer languages as a whole. With this comes understanding, of corse, and these weird moments when I stop writing a line for a second and go “is this really going to work”, then continue on to think when it does, “it actually was that simple.”. I guess after years of coding it’s nice to be able to actually get things done you want to get done instead of having to keep tinkering with it continuously until it finally works. This blog for example just amazed me in many different ways. It’s amazing how small the code for this blog actually is. And the speed potential behind it is quite amazing also.LiveScript my new Coffeescript2014-08-13T00:00:00+00:002014-08-13T00:00:00+00:00https://gabe.io/2014/08/13/liveScript-my-new-coffeescript<p>Wrote a small tutorial of LiveScript + Expressjs on runnable (link removed).
Just incase you didn’t know what
<a href="http://LiveScript.net" data-ignore="push">LiveScript</a> was, it’s a
beautifully designed language which allows for so much more elegance than
either javascript or coffeescript could manage. It allows for backcalls,
<code>for</code> loops <code>of</code> lists, objects, and only run the loop
<code>when</code> x is true. Just a simply amazing language I just have fallen
in love with.</p>Wrote a small tutorial of LiveScript + Expressjs on runnable (link removed). Just incase you didn’t know what LiveScript was, it’s a beautifully designed language which allows for so much more elegance than either javascript or coffeescript could manage. It allows for backcalls, for loops of lists, objects, and only run the loop when x is true. Just a simply amazing language I just have fallen in love with.The Beginning2014-08-12T00:00:00+00:002014-08-12T00:00:00+00:00https://gabe.io/2014/08/12/the-beginning<p>Just a quick entry to say hi again to my friends who actually visit my little site here. I am happy to say that I have had enough time to put together a really quick and dirty blog. It’s not really anything serious just trying to get some traffic again.</p>Just a quick entry to say hi again to my friends who actually visit my little site here. I am happy to say that I have had enough time to put together a really quick and dirty blog. It’s not really anything serious just trying to get some traffic again.