Skip to content

Instantly share code, notes, and snippets.

@gabhi
gabhi / gist:3be6e3d1ba49e78bcf81b349a78c34e8
Created December 29, 2020 19:24 — forked from rkuzsma/gist:b9a0e342c56479f5e58d654b1341f01e
Example Kubernetes yaml to pull a private DockerHub image
Step by step how to pull a private DockerHub hosted image in a Kubernetes YML.
export DOCKER_REGISTRY_SERVER=https://index.docker.io/v1/
export DOCKER_USER=Type your dockerhub username, same as when you `docker login`
export DOCKER_EMAIL=Type your dockerhub email, same as when you `docker login`
export DOCKER_PASSWORD=Type your dockerhub pw, same as when you `docker login`
kubectl create secret docker-registry myregistrykey \
--docker-server=$DOCKER_REGISTRY_SERVER \
--docker-username=$DOCKER_USER \
set global sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
set session sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
alias tomcat_home='cd /Users/abhijit_gaikwad/Downloads/apache-tomcat-9.0.36/bin;'
alias starttom='tomcat_home ./catalina.sh jpda start'
alias stoptom='tomcat_home ./catalina.sh jpda stop'
@gabhi
gabhi / CKAD.md
Created March 11, 2020 16:40 — forked from veggiemonk/CKAD.md
CKAD exam preparation
@gabhi
gabhi / CKAD.md
Created March 11, 2020 16:40 — forked from veggiemonk/CKAD.md
CKAD exam preparation
@gabhi
gabhi / The Technical Interview Cheat Sheet.md
Created October 10, 2019 05:03 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo since a gist is too difficult to maintain as an open source endevaor and there is no way to version it. I have updated below, but I will not be able to keep this one up to date so please checkout the repo instead. The below is just for some preservation for those who stumble across here.






\

@gabhi
gabhi / ERC20.sol
Created January 12, 2018 07:05 — forked from anonymous/ERC20.sol
Created using browser-solidity: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.19+commit.c4cbbb05.js&optimize=false&gist=
pragma solidity ^0.4.10;
interface ERC20 {
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
@gabhi
gabhi / gist:dc2f28bee6af35d55774f1c0cc17249a
Created March 20, 2017 03:55
The Buy and Forget Portfolio
The Buy and Forget Portfolio
20% domestic US stocks (NYSEARCA:SPY)
20% international stocks (NYSEARCA:IXUS)
10% emerging stock markets (NYSEARCA:EEM)
20% Real Estate Investment Trusts (NYSEARCA:VNQ)
15% long term US Treasury Bonds (NYSEARCA:TLT)
15% Treasury Inflation Protected Securities (NYSEARCA:TIP)
@gabhi
gabhi / Selenium upload file using java.java
Last active April 29, 2016 02:42
Selenium upload file using java
driver.findElement(By.className("fileclass")).click();
driver.switchTo()
.activeElement()
.sendKeys( "/user/agaikwad/test.pdf");
driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
//var aa = $(".bt-request-buffed"); for(i=0;i<aa.length;i++){console.log(aa[i].title); aa[i].click()}
//javascript:(function()%7Bfunction callback()%7B(function(%24)%7Bvar jQuery%3D%24%3Bvar aa %3D %24(".bt-request-buffed")%3B for(i%3D0%3Bi<aa.length%3Bi%2B%2B)%7Bconsole.log(aa%5Bi%5D.title)%3B aa%5Bi%5D.click()%7D%7D)(jQuery.noConflict(true))%7Dvar s%3Ddocument.createElement("script")%3Bs.src%3D"https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fjquery%2F1.7.1%2Fjquery.min.js"%3Bif(s.addEventListener)%7Bs.addEventListener("load"%2Ccallback%2Cfalse)%7Delse if(s.readyState)%7Bs.onreadystatechange%3Dcallback%7Ddocument.body.appendChild(s)%3B%7D)()
@gabhi
gabhi / crontab_every_30_min_script.md
Created April 20, 2016 06:08
sample crontab entry to run job every 30 min

0,30 * * * * cd ~/git/testingtwitter/ &amp;&amp; /usr/local/bin/mvn -Dtest=HelloWorld test &gt;&gt; ~/logs/cron.log

@gabhi
gabhi / alias to get yahoo stock quotes on command line.md
Created April 12, 2016 19:31
alias to get yahoo stock quotes on command line

stock_quotes () { curl -s "http://download.finance.yahoo.com/d/quotes.csv?s=$1&f=sl1c" }

stock_quotes aapl