Skip to main content

Posts

2020

Create Lightweight Docker Images With Multi Staged Build

·4 mins
Me Before # 1 2 3 4 5 6 7 8 9 10 11 12 FROM golang:alpine WORKDIR /go/src/github.com/santosh/qagine COPY . . RUN go get -d RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o app . EXPOSE 8080 CMD ["./app"] Me building the image. $ docker build -t sntshk/qagine . Sending build context to Docker daemon 259.6kB Step 1/7 : FROM golang:alpine ---> 760fdda71c8f Step 2/7 : WORKDIR /go/src/github.com/santosh/qagine ---> Running in e2cf75dd1655 Removing intermediate container e2cf75dd1655 ---> 8b4955b2e885 Step 3/7 : COPY . . ---> 43cd9a41efcb Step 4/7 : RUN go get -d ---> Running in 55c01f67fa99 go: downloading github.com/gorilla/mux v1.7.4 go: downloading go.mongodb.org/mongo-driver v1.3.2 go: downloading github.com/dgrijalva/jwt-go v3.2.0+incompatible go: downloading golang.org/x/crypto v0.0.0-20200420201142-3c4aac89819a go: downloading github.com/pkg/errors v0.8.1 go: downloading github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c go: downloading github.com/golang/snappy v0.0.1 go: downloading github.com/go-stack/stack v1.8.0 go: downloading github.com/klauspost/compress v1.9.5 go: downloading golang.org/x/sync v0.0.0-20190423024810-112230192c58 go: downloading github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc go: downloading golang.org/x/text v0.3.2 Removing intermediate container 55c01f67fa99 ---> 038b29b80653 Step 5/7 : RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o app . ---> Running in 122df20d3329 Removing intermediate container 122df20d3329 ---> f4616dc3fe1c Step 6/7 : EXPOSE 8080 ---> Running in 4258f9aac8c6 Removing intermediate container 4258f9aac8c6 ---> b643c7e16c0b Step 7/7 : CMD ["./app"] ---> Running in 948fa65b093b Removing intermediate container 948fa65b093b ---> 621b8e5396ad Successfully built 621b8e5396ad Successfully tagged sntshk/qagine:latest The sweet size of the image is 525MB.

2019 In a Review: Colemak, Code Reviews and More

·5 mins
This year was a transition period for me from a career perspective. I was hearing, understanding and practicing stuff like microservices, fault tolerance, cross-site deployment, REST APIs, software deployment system, agile development and attending meetings & training sessions with the people on the other side of the planet 😅 . 3 years back I never thought I would end up being some place like this. That version of me just wanted to be a compositor.

2019

Switching to Hugo This New Year

·8 mins
Finally I have decided to buy me a domain. But before that I must keep my content ready. Earlier on, I was decided on to giving my website a go backend, but I later thought it was an overkill to use golang as a backend for a personal website and I should keep that enthusiasm for a real app. Instead of manually creating a frontend for my site, I will be using already available Hugo theme. I will be migrating my blog which I’m maintaining at codicious.wordpress.com and fxcious.wordpress.com.

Run Unit Test Before Every Commit with pre-commit Hook

·3 mins
Introduction # Why wait for CI/CD services to run your test? And in case you’ve already submitted a pull request, you’ll have to push another commit to fix the cause of failed test held by CI provider. You can prevent that by running unit tests locally before every commit. I’m building my website using the golang. On every git push, Travis CI runs test and create a docker image and pushes it to DockerHub. My plan is to pull that image every time it is pushed and deploy it to some production server.

Cycles Rendering Checklist for Faster and Clear Renders

·4 mins
This is a textual version of Ways to Speed Up Blender Cycles Rendering, hope Andrew won’t mind me writing a textual version of his video. ;) This post is mostly for self-reference and does not contains all the methods shown by Andrew. We’ll see how we can create better renders and how render times can be reduced by merely changing some factory settings, and also what prices we might have to pay for that optimization.

Software Testing and Test Driven Development

·3 mins
In this post, I’ll show a glimpse of software testing and how test-driven development works in a nutshell. Why Do We Test # Every little software grows big, trying to solve more problem regarding its particular domain. It faces bugs in the way which also needs to be taken care of. As software grows big. It becomes harder to go and test if every part of the software is behaving the way it should. Take the example of a Django application. If the manual path is taken, one is supposed to test every layer of the application, including Model and Views against each if and else in the control flow.

2018

What I've Learnt as a Self Taught Programmer Till Now

·2 mins
I have been an independent programmer for a long time. Like 5-6 years? Recently been employed with Xentrix Studios, an animation studio based in Bengaluru, as a pipeline developer. Today I want to share what changes I’ve felt in these recent years. Please connect with on LinkedIn. Write Readable Code # The code is read much more often than it is written. In fact, source code is written for us, the humans. A source code to achieve a certain task to be done can be written in dozens, if not hundreds of ways. Computers will still interpret it no matter in which way it is written. So at the end of the day, it’s the human to whom flow of source code matter.

Making a Switch to KDE and zsh

·3 mins
It’s been a long time I’ve been fiddling around with Linux and Linux distros. The first Linux distro I ever used was Ubuntu. I like the beauty of Linux, its so customizable. One can change every aspect of interface and behaviour that end-user want. Like the desktop environments and shells, which you can’t really change on Windows operating systems. I myself belive in minimalism and not full of features products (which remains unused most of the time in my case). But I’m making this descision after using both of them for about a week.

Advance Interface Topics in Blender

·4 mins
This is kinda a manual for new Blender user which I compiled up when I was learning Blender. First of all, when you’re switching from Maya, you’ll find the interface a bit alien. Blender has an option to behave like Maya, but in long run, that’s not gonna be productive. Connect with on LinkedIn. The Basics # Right-click selects any object. MMB rotates the scene (we’ll se pivot point later in the post). Shift+MMB+mouse movement pans the scene. Ctrl+MMB up and down zooms and zooms out of the level.

How would you exclude all extension-less executable from your repo?

·2 mins
In last post, I expressed how we can export a single file from a git repo the its own repo, preserving their commit history. In this post, I will tell how I dealt with extension-less file to ignore them in my repo. I have recently started learning C++ from Udemy, it’s a free course. I encourage you to take it if you are willing to learn C++. I was following the instructions on Linux. And special thing about working with C or C++ in Linux is that the executable you get has no extensions in it, unlike Windows, which has .exe extension.

Extract a File from Git Repo to its own, Preserving the History

·1 min
Today I will walk through how you can take out a single file from a git repository and create its own repository with all the file commit history preserved. When I started working at my workplace I initialized Maya script directory to git. At that time one repo was looking enough for entire folder. But when I started working with a tool, I realized an entire repo would be good for that tool. But it was too late to create another repo because I had already made 12-15 commits on that tool and I don’t wanted to lose the changes I made.

Blending Modes Explained

·2 mins
Back in time when I used to see Photoshop’s layers section, there was a list of things named like Darken, Multiply, Screen and so on. They used to change the color when that particular layer was placed on some other layer. Later in my college days I came to know these were the well known blending modes. There are mathematical in nature and does maths on pixel by pixel basis.

2017

Nuke Optimization Tips

·2 mins
Nuke is a very powerful VFX tool in the industry. But at the time of learning, people often don’t pay attention to the optimization. Which leaves them with relatively longer render times. Note: Not every point can be followed. Do whatever is possible. Connect with on LinkedIn. Hardware Related # Get Two Hard Drive # When you read footage from the hard drive, and write/render to the same hard drive, you actually make hard drive do double the work. Keep another drive (maybe a small one?) to render/write stuff.