Skip to content

Instantly share code, notes, and snippets.

Amber Jain amberj

Block or report user

Report or block amberj

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@amberj
amberj / rgb-colored-echo.sh
Last active Apr 27, 2019
A bash pretty print script that provides following red/green/blue colored echo functions.
View rgb-colored-echo.sh
#!/bin/bash
#
## @file rgb-colored-echo.sh
## @author Amber Jain
## @section DESCRIPTION A bash pretty print script which provides red/green/blue colored echo functions
## @section LICENSE ISC
#################
# Documentation #
View fizzbuzz.py
# fizzbuzz.py
# Python implementation of FizzBuzz (http://imranontech.com/2007/01/24/using-fizzbuzz-to-find-developers-who-grok-coding/)
#
# Author: Amber Jain (http://amberj.devio.us/)
# Problem description:
# Write a program that prints the numbers from 1 to 100.
# But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz".
# For numbers which are multiples of both three and five print "FizzBuzz".
# Problem source: http://imranontech.com/2007/01/24/using-fizzbuzz-to-find-developers-who-grok-coding/
@amberj
amberj / initial-vps-setup.sh
Last active Mar 9, 2019
Initial setup of hosted VPS (which comes with 'root' access by default)
View initial-vps-setup.sh
#!/bin/bash
# ABOUT:
#
# Use this set of commands to:
# - Change password of root account
# - Create a new user account, set it's password and grant sudo privileges
# on Ubuntu Linux.
# Change password of currently logged in 'root' account:
@amberj
amberj / setup-headless-selenium-xvfb.sh
Created Sep 25, 2013
Bash script to install/setup headless Selenium (uses Xvfb and Chrome)
View setup-headless-selenium-xvfb.sh
#!/bin/bash
#
# Bash script to setup headless Selenium (uses Xvfb and Chrome)
# (Tested on Ubuntu 12.04)
# Add Google Chrome's repo to sources.list
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list
# Install Google's public key used for signing packages (e.g. Chrome)
# (Source: http://www.google.com/linuxrepositories/)
View limeshop
{"shop_id":84644,
"vendor_id":62414,
"img_URL":null,
"user_preferred_domain":null,
"shipping_cost":0,
"shop_description":"my test shop",
"domain_identifier":"test59",
"shop_name":"Test",
"shop_logo_URL":null,
"shop_contact_number":"9769110914",
@amberj
amberj / rev-youtube-playlist-urls.sh
Created May 7, 2012
This (bash) script takes a youtube playlist URL as argument and outputs title and URL of each video (in playlist) in reverse order
View rev-youtube-playlist-urls.sh
#!/bin/bash
#
# File: rev-youtube-playlist-urls.sh
# Description: This (bash) script takes a youtube playlist URL as argument and outputs title and URL of each video (in playlist) in reverse order (i.e. starting from last video in playlist)
# Author: Amber Jain
# Check if "only one" argument (playlist_url) passed as input:
if [ "$#" -lt "1" ]
then
echo "Invalid! You must pass playlist_url as argument"
@amberj
amberj / setup-local-replit.sh
Created Mar 14, 2013
A bash script to automate the installation/setup of repl.it on local system.
View setup-local-replit.sh
#!/bin/bash
#
## @file setup-local-replit.sh
## @author Amber Jain
## @section DESCRIPTION A bash script to automate the installation/setup of repl.it on local system
## @section LICENSE ISC
#################
# Documentation #
@amberj
amberj / latency.txt
Created Jun 8, 2012 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
View latency.txt
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms
You can’t perform that action at this time.