Docker Logo

Docker 101: A basic web-server displaying hello world

A basic webserver Docker containers are small OS images in themselves that one can deploy and run without worrying about dependencies or interoperability. All the dependencies are packed in the same container file. And the docker runtime takes care of the interoperability. You are not tied to using a single language or framework. You can write code in Python, Go, Java, Node.js, or any of your favorite languages and pack it in a container. Consider a simple example of a Go-based webserver

Consoles by Google

A single developer has to sometimes deal with 7 different consoles by the same company…

Android Logo

Troubleshooting Android Emulator: Process finished with exit code 1

Emulator: Process finished with exit code 1 You opened AVD Manager in Android Studio and tried to start an AVD, you got “Emulator: Process finished with exit code 1”. Following are the steps to debug this Find out the name of the emulator. Click the down arrow 🔽 which is to the right of play arrow ▶️, to find out the name of the AVD. Let’s say the name is “Nexus_5X_API_28_x86”. ...

Android: Using "Die with me" app without killing the phone's battery

Die with me is a chat app which can be used only when the phone’s battery is below 5%. Here is a fun way to use the app without draining your phone’s battery. Connect the phone via ADB or start Android emulator and fake the battery level to 4%. Bash 1 2 sudo pip3 install adb-enhanced adbe battery level 4 # Set battery level to 4% And now, you can use the app. After playing with the app, reset the battery level with, ...

The first two statements of your BASH script should be...

Sh 1 2 #!/usr/bin/env bash set -euo pipefail The first statement is a Mac, GNU/Linux, and BSD portable way of finding the location of the bash interpreter. The second statement combines ...

GitHub Actions Logo

Keep your dotfiles bug-free with Continuous Integration

Ultimate guide to setting up and maintaining CI of your dotfiles

Circle CI

Circle CI vs Travis CI

Update: As of Mar 2022, I recommend everyone to use GitHub Actions I maintain a somewhat popular Android developer tool ( adb-enhanced). The tool is written in Python, supporting both Python 2 and 3. Testing the tool requires both Python runtime as well a running Android emulator. I, initially, used Travis CI for setting up continuous testing of this tool. Later, I felt that Travis CI was too slow and when I came across Circle CI, I decided to give it a try. As of now, both Travis and Circle CI are used for testing. Here is what I learned from my experience.

Stanford CS251: Cryptocurrencies, blockchains, and smart contracts

Lectures Introduction Creating a Digital currency Bitcoin Overview Bitcoin Blockchain Bitcoin Mining Bitcoin Miner interactions and Game Theory Cryptocurrencies: Community, Economics, and Politics Alternative Consensus Wallet & Anonymity Anonymity on Blockchain Altcoins Ethereum Ethereum Ethereum Governance Bitcoin Side-chains (guest talk) Bitcoin Payment channel Guest talk on Legal by Ben Lawsky - does not seem worthy of transcribing Advanced Topics - Quantum Computing, Threshold Signatures, and storing secret state on public chains Advanced Topics - Smart property, publicly verifiable randomness, and prediction markets Guest talk by Adam Ludwin (CEO, chain.com) - does not seem worthy of transcribing The notes are based on the 2016 version of the course CS251 ...

Stanford CS251: Lecture 19

Lecture 19: Advanced Topics Topic 1: Smart Property Manage ownership of some property like stocks on the blockchain. Colored coins allow arbitrary properties on Smart Contract. Similar to Namecoin, there cannot be a light node/SPV for this. Another example is rental, car’s ownership goes from Alice to Carol in a 2-of-2 transaction from Alice to Carol and locked transaction to return the car’s possession after a fixed time. One still has to trust the car’s hardware and manufacturer. ...

Stanford CS251: Lecture 18

Lecture 18: Advanced Topics Three topics are chosen by students (another three for the next lecture) Topic 1: Quantum Computing An electron has two states top and bottom spins, represented as |1> and |0>. An electron is in a superposition of those two states with wave functions Ψ0 and Ψ1, so, the combined wave function is Ψ = Ψ0. |0> + Ψ1. |1> with |Ψ0|2 + Ψ12 = 1. |Ψ0|2 is the proability of seeing state |0> and Ψ12 is the probability of seeing state |1> respectively. Thus, Ψ = [Ψ0, Ψ1] is the overall state matrix. The state evolves using a 2X2 Hamiltonian matrix H, such that, second-degree norm won’t change, || H.V || = || V ||. This ensures |Ψ0|2 + Ψ12 = 1 always holds. ...