Skip to content

Instantly share code, notes, and snippets.

View apilkarki's full-sized avatar
🏠
Working from home

Apil Karki apilkarki

🏠
Working from home
  • Kathmandu, Nepal
View GitHub Profile
@apilkarki
apilkarki / cheatsheet-elasticsearch.md
Created May 28, 2021 08:54 — forked from ruanbekker/cheatsheet-elasticsearch.md
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl
@apilkarki
apilkarki / gist:18effa14cd14ee4b634ed89b7387f778
Created May 1, 2018 10:27 — 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 \
@apilkarki
apilkarki / ansible_conditionals_examples.yaml
Last active April 30, 2018 08:35 — forked from marcusphi/ansible_conditionals_examples.yaml
Ansible 1.3 Conditional Execution
---
# This has been tested with ansible 1.3 with these commands:
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=false"
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=true"
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts"
# NB: The type of the variable is crucial!
- name: Ansible Conditionals Examples
hosts: $hosts
vars_files:
@apilkarki
apilkarki / curl.md
Created March 6, 2018 10:45 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@apilkarki
apilkarki / different rolling file appender
Last active September 29, 2017 14:26 — forked from bmaupin/log4j2.xml
Log4j2.xml for Tomcat
https://www.boraji.com/log4j-2-rollingfileappender-example
@apilkarki
apilkarki / 0_reuse_code.js
Created August 16, 2017 04:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@apilkarki
apilkarki / bash-cheatsheet.sh
Created August 4, 2017 12:52 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@apilkarki
apilkarki / .gitlab-ci.yml
Created July 7, 2017 06:01 — forked from thornbill/.gitlab-ci.yml
Example Node GitLab CI Yamlfile
# Official framework image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/node/tags/
image: node:6
before_script:
- npm install
# This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache: