atlas news
    
Echorand
21  septembre     00h00
Custom HTTP client with golang.org x oauth2 and GitHub Go SDK
   In this post, we are going to discuss an implementation detail about how we can use a custom HTTP client to use the Go GitHub SDK and the https: pkg.go.dev golang.org x oauth package. Introduction Using a custom HTTP client with golang.org x oauth Using the custom HTTP client with Go Github SDK...
19  septembre     00h00
Writing HTTP client middleware in Go
   In this post, I am going to share what I have learned about writing HTTP client middleware in Go. Let’s get started HTTP client and Transport Writing your own RoundTripper implementation Returning static responses Summary HTTP client and Transport Go’s http.Client defines a default value for the...
06  septembre     00h00
Kiwi PyCon XI Talk - Middleware Patterns for your Applications
   I delivered a talk at the recently concluded Kiwi PyCon XI. Checkout some photos of the event from Kristina DC Hoeppner here. I attended it virtually as I was unable to travel due to last minute interruptions from a certain virus. The organizers were of course very well prepared for that. Massive...
30  mai     00h00
PyCon US 2022 Talk - Implementing Shared Functionality Using Middleware
   I delivered a talk at the recently concluded PyCon US conference. Amazing conference, great work by the organizers and everybody involved. This was my third time at PyCon US and my first time participating in the post conference sprints. I contributed to the Pyodide project during the sprints,...
08  mai     00h00
Pyodide, PyScript - Monkey patching requests
   At PyCon US , Anaconda announced PyScript: Python in the Browser. So far my understanding is that it builds on Pyodide and makes it magically easy to bridge the world of the Browser the Document Object Model DOM and Python. It’s so magical that you can simply copy scripts that you were...
07  février     00h00
It’s hard to not become a computer user
   I saw a computer for the first time at school when I was years old . I failed horribly in the first few years to actually get programming. Then i had this teacher with whom i took group classes, who taught me computer programming, properly. GW Basic, then some Java, some C and C . I...
12  décembre     00h00
On my learning style and a new book
   I have finally gotten around to reading listening The Code Breaker: Jennifer Doudna, Gene Editing, and the Future of the Human Race by Walter Isaacson. And in one of the first chapters, the writer talks about Jennifer Doundna’s thoughts I think on how often it’s the practical application of...
21  novembre     00h00
Shallow copy and Deep copy in Go
   Update: Please note that my usage of Call by reference is not correct here as pointed out by a Reddit community member here. Read it as Call by passing pointer values . While trying to understand this a bit more, I came across a few more links to the topic. You can find them here in my reply. I...
13  novembre     00h00
Go - Append behavior in option values using flag package
   While working on the solutions to exercises for my soon to be published book Practical Go, I needed to implement a way to implement an option in my command line application which could be specified multiple times. The result would be that all the values specified would form a list of the values. To...
06  novembre     00h00
The go test command, os.Stdin and testing interactive input
   While working on the solutions to exercises for my soon to be published book Practical Go, I wanted to write a test function which would simulate a user not providing an interactive input when one was asked for. However, I noticed that the test function would not wait for me to provide the input...
18  septembre     00h00
Serialization
   I always get confused between serialization and deserialization . Perhaps, that is because I am trying to memorize what they are, and then trying to recall from memory. Of course, it’s sufficient to remember only one of them correctly. So, here’s my trick that I am going to use from now on. It...
15  septembre     00h00
Use of transparent in computing
   One word that has always baffled me in the context of software computing is transparency . This change is completely transparent to the application or some version of it is often used to tell consumers of an application library that a certain change won’t be noticeable by the consumer at all...
13  septembre     00h00
PyCon AU 2021 Talk - Planning for Failure using Chaos Engineering
   I delivered a talk at the recently concluded PyCon Australia conference. Amazing conference, great work by the organizers and everybody involved. Fantastic experience My talk My talk was in the DevOops track titled Planning for Failure using Chaos Engineering . Since I joined Atlassian, I have...
07  août     00h00
Using contexts in Go for everything
   This post will be written at some point of time in future.
05  juillet     00h00
Named return values in Go
   In Go, there are a couple of ways to return values from a function. Non named return values Until today, I had been exclusively using the following style of what i am going to refer to as Non named return values : func myFunc int, error return, errors.New ;An error ; You declare...
15  avril     00h00
Check Go Module Path Validity
   The Go module path enforces certain restrictions as expected on what constitutes a valid path. Try running go mod init https: foo.bar baz for example. Now, what if you as a Go programmer needed to run this check yourself That’s where the golang.org x mod package comes in. It has a number of...
18  janvier     00h00
Concurrency safe file access in Go
   Using a file for persistent storage and not a database datastore object store sounds like an academic exercise. For me, it brings back memories of writing a structure in C programming language to a file to simulate a student record database. However, there may be situations where you may just...
20  décembre     00h00
Embedding files in Go using the embed package
   Demo Embedding a template Demo Serving files from a directory Learn more The most exciting feature for me in the Go . release is the new embed package which allows you to embed a file contents as part of the Go application binary. This ability so far was most easily available via using...
13  décembre     00h00
Authentication between services using Kubernetes primitives
   In my latest article for the folks at learnk s, I write about establishing authentication between services deployed in Kubernetes. Specifically, we discuss how you can use the Kubernetes primitives Service accounts with a new feature Service Account Token Volume Projection to setup...
27  juillet     00h00
Static and dynamic checks for your Kubernetes workloads
   My two recent articles, Validating Kubernetes YAML for best practice and policies and Enforcing policies and governance for Kubernetes workloads looks at the topic of enforcing policies for your Kubernetes workloads. Check them out and let me know if you have any comments.
28  mai     00h00
Using Gatekeeper in Kubernetes
   Introduction Gatekeeper allows a Kubernetes administrator to implement policies for ensuring compliance and best practices in their cluster. It makes use of Open Policy Agent OPA and is a validating admission controller. The policies are written in the Rego language. Gatekeeper embraces...
26  mai     00h00
Getting started with Go plugin package
   Introduction In this post, I will share some of my learnings and explorations on plugins in Golang. We will write a driver program which will load two plugins and execute a certain function which are present in both of them. The driver program will feed an integer into the first plugin, which...
20  mai     00h00
Kubernetes pod security policies
   Welcome to this new blog post Introduction Enforcing policies Using kustomize to manage policies Rolling the policy changes out Multiple matching policies Conclusion Introduction Pod security policies are cluster level resources. The Google cloud docs has some basic human friendly docs. A psp is a...
07  mai     00h00
How to Set up Log Forwarding in a Kubernetes Cluster Using Fluent Bit
   Metadata I have posted this article on dev.to where I welcome comments and discussions. Introduction Log forwarding is an essential ingredient of a production logging pipeline in any organization. As an application author, you don’t want to be bothered with the responsibility of ensuring the...
05  mai     00h00
Sorting pages by last modified date in Hugo
   This blog is managed as a git repository and I use Hugo as the framework for managing it. I am using the Hugo classic theme which I have tweaked slightly and store it along with the blog source. I wanted to modify the sorting of the blog post titles on the index page so that the most recently...
28  avril     00h00
Using cloud custodian to ensure compliance across AWS resources
   Introduction In this post, I will describe my experiments with using Cloud Custodian to perform various tasks usually falling into the bucket of compliance and sometimes convention. I encourage you to take a look at some of the example policies. Some of the areas I will cover are resource tagging...
02  janvier     00h00
Restricting attributes that can be set in Python
   A reader of my book Doing Math with Python wrote to me a few weeks back about a strange problem they were having. They were trying to create an animated projectile motion from the code listing in the book. However, they were not seeing the expected results. Worse, there were no errors. They...
20  décembre     00h00
On managing Kubernetes YAML manifests
   Introduction There are two broad discussion points in this post: Managing the lifecycle of Kubernetes YAML manifests Static guarantees best practices enforcements around Kubernetes YAML files before they are applied to a cluster Prior art and background Please read this article to get a more...
12  décembre     00h00
Correlated error logging
   Please note this document is currently in progress. You may read this other post instead which illustrates what I wanted to discuss in this post with an implementation in Go. Introduction In a service oriented architecture, more popular these days as a microservice oriented architecture it’s...
07  décembre     00h00
Using Go for automating infrastructure and operations work
   Since around . years ago, I have been working in roles which has required to automate various things usually classified as infrastructure and operations work. Sometimes they have involved working with cloud infrastructure and at other times they have involved interacting with databases and...
26  novembre     00h00
Jenkins Docker Workflow plugin - A look at inside()
   Introduction The docker workflow plugin enables leveraging Docker containers for CI CD workflows in Jenkins. There are two broad patterns one would generally use containers in their CI CD environment. The first would be as side car containers these are containers which run alongside your tests...
18  octobre     00h00
Bash function and exiting early
   Monday was just beginning to roll on as Monday does, I had managed to work out the VPN issues and had just started to do some planned work. Then, slack tells me that new deployment had just been pushed out successfully, but the service was actually down. Now, we had HTTP healthchecks which was...
23  août     00h00
User access management on AWS Kubernetes cluster
   Introduction When implementing a solution for allowing users other than the cluster creator to access the cluster resources we are faced with two fairly old generic problems authentication and authorization. There are various ways one can solve these problems. I will discuss one such solution in...
07  août     00h00
Notes on Go
   Repeating the same argument to Printf If we wanted to repeat the same argument to a call to fmt.Printf, we can make use of indexed arguments. That is, instead of writing fmt.Printf quot; s s quot;, quot;Hello quot;, quot;Hello quot; , we can write fmt.Printf quot; s s quot;,...
02  août     00h00
Notes on Kubernetes
   Introduction This in progress page lists some of my findings while working with Kubernetes. EKS cluster setup You may also find this guide from spacelift.io useful. This section will have findings that are relevant when working with an AWS EKS cluster. Terraform configuration for master This is...
19  juillet     00h00
Nginx - redirecting non-www to www hostnames
   Introduction I wanted a Nginx configuration which would satisfy the following requirements: Any example.com requests should be redirected to www.example.com The above should happen for http and https http: example.com should redirect directly to https: www.example.com Solution We will need four...
03  juillet     00h00
Notes on Bash auto-completion on Linux
   Welcome to this new blog post Introduction Setting up DIY bash completion Data provided to completion handlers Single lt;TAB gt; and double lt;TAB gt; lt;TAB gt; Getting good old BASH completion back Magic of bash completion package compgen built in command Learning more Bash completion for...
27  juin     00h00
Notes on PostgreSQL
   Some notes on PostgreSQL which you may find useful. Thanks to all those numerous StackOverflow answers that helped me do my job at hand. Schemas and Database The database is the highest level of organization. A database can have one or more schemas. The public schema is present by default and all...
19  juin     00h00
Nginx strace
   I was debugging a issue where we were getting truncated logs in ElasticSearch in the context of a setup as follows: Application Logs gt; Fluentd logging gt; Nginx gt; ElasticSearch The original problem turned out to be on the application side, but my first point of investigation was what...
24  mai     00h00
Nginx and geoip lookup with geoip2 module
   I wanted to setup Nginx logging so that it would perform GeoIP lookup on the IPv address in the X Forwarded For header. Here’s how I went about doing it on CentOS . This nginx module integrates Maxmind GeoIP database with the RPMs being available by getpagespeed.com. Once I had installed the...
04  avril     00h00
Generate yourself some Terraform code from TOML
   In this post, we will see how we can use Golang to generate Terraform configuration from a TOML specification. That is, given a TOML file, like: subnet name ;SubnetA ; rules rule no , egress false, protocol ;tcp ;, rule action ;allow ;, cidr block ; . . ...
11  mars     00h00
Getting a docker container’s stdout logs into a variable on Linux
   docker logs by default shows the container’s stdout and stderr logs. However, what I discovered was that the stderr logs from the container are output to the host system’s stderr as well. I was expecting everything from the container to be on the host’s stdout. Let’s see a demo. Consider the...
05  mars     00h00
ASP.NET Compilation and other files don’t mix
   I love working in software. Mostly things work as expected, but at times no. I changed A, how can Z be affected after all they are all miles apart. Right Wrong. Z can be affected. Today’s story is the latest totally unexpected, but not surprising. Background We run ASP.NET compilation on our...
21  janvier     00h00
Poor man’s zero downtime deployment setup using Traefik
   Recently, I wrote two articles about using traefik as a reverse proxy. The first article discussed deploying a ASP.NET framework application and the second discussed deploying ASP.NET core applications. In both cases, I demonstrated the following: Docker native integration In built support for...
    00h00
Scheduled task to prune docker images on Windows server
   Windows docker images can be bulky and on a server that you are deploying your application as docker images, the free disk space becomes a metric to watch out for. The following script will setup a Scheduled tasks to be run at a . PM UTC which will prune all unused images: Scheduled tasks if ...
14  janvier     00h00
Ephemeral source port ranges and docker build
   TLDR; If you are having trouble with docker build and ephemeral port ranges, we can use iptables to solve the issue: sudo iptables t nat I POSTROUTING p tcp m tcp sport : j MASQUERADE to ports I have written previously about how things get interesting with ephemeral...
19  décembre     00h00
AWS CodeDeploy Deployment Group and Initial Auto Scaling lifecycle hook
   When we create an AWS Code Deploy deployment group via Terraform or CloudFormation and integrate with an Auto Scaling Group, it also by default creates an initial lifecycle hook which ensuresthat a new code deployment gets triggered when a scale out event occurs. It is all very magical and it is...
09  novembre     00h00
Hard Links and Soft Symbolic Links on Linux
   Much has been written and asked on the topic of hard links and soft links a.k.a symbolic links on Linux. I have read a few of those more than once. However, I end up getting confused between the two, specifically the differences between the two. So, here’s my post on the topic with the hope...
08  novembre     00h00
Let’s Encrypt, GoDadday DNS and IIS server
   I wanted to create a new SSL certificate for IIS hosted ASP.NET framework application. The key data that may make this post relevant to you are: Let’s Encrypt Challenge mode: DNS TXT record DNS provider: GoDaddy Target web server: IIS Target operating system: Windows Local operating environment...
01  novembre     00h00
Fedora Scientific Vagrant boxes are here
   Fedora Scientific brings together the most useful open source scientific and numerical tools atop the goodness of the KDE desktop environment. From the beginning, our focus has been to provide scientists, engineers and programmers in numerical scientific computing a Linux distribution which has...