Skip to content

Instantly share code, notes, and snippets.

@kchandan
kchandan / rke2-commands.md
Created March 9, 2024 03:04 — forked from superseb/rke2-commands.md
RKE2 commands

RKE2 commands

Install

curl -sL https://get.rke2.io | sh
systemctl daemon-reload
systemctl start rke2-server
@kchandan
kchandan / postgres-cheatsheet.md
Created May 31, 2020 21:27 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@kchandan
kchandan / Vagrantfile
Created January 21, 2018 19:37
Ambari Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "geerlingguy/centos7"
config.vm.network "forwarded_port", guest: 8080, host: 8080
config.vm.network "public_network"
from flask import Flask
from flask import request
import json
app = Flask(__name__)
@app.route('/')
def hello():
return "Check Code of countries"
hadoop jar /usr/lib/hadoop-0.20-mapreduce/contrib/streaming/hadoop-streaming-2.6.0-mr1-cdh5.12.0.jar \
-file /home/cloudera/mapper.py -mapper /home/cloudera/mapper.py \
-file /home/cloudera/reducer.py -reducer /home/cloudera/reducer.py \
-input /user/cloudera/*.py -output /user/cloudera/output
@kchandan
kchandan / gist:05d4a3884fb61f55e80f321839cde3f0
Created November 24, 2017 22:51
Prometheus example config
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
# Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
- targets:
- localhost:9093
@kchandan
kchandan / gist:9191435893d3e8c0a51c813c0b41f42a
Last active November 26, 2017 03:42
prometheus-startup
git clone https://github.com/becloudready/prometheus_monitoring.git
cd prometheus_monitoring
vagrant up
mkdir min_iso
cp -r cmin_iso/* min_iso/
cp cmin_iso/.discinfo min_iso/
mount -o loop CentOS-DVD1.iso dvd1/
mkdir cmin_iso
mount -o loop CentOS.iso cmin_iso/