Skip to content

Instantly share code, notes, and snippets.

View arya-oss's full-sized avatar
💭
I may be slow to respond.

Rajmani Arya arya-oss

💭
I may be slow to respond.
View GitHub Profile
@arya-oss
arya-oss / INSTALL.md
Last active November 18, 2023 13:58
Ubuntu 16.04 Developer Tools installation

Ubuntu 16.04 Developer Tools Installation

First things first !

sudo apt update
sudo apt upgrade

Standard Developer Tools

sudo apt-get install build-essential git
@arya-oss
arya-oss / prom-k8s-request-limits.md
Created July 4, 2023 05:36 — forked from max-rocket-internet/prom-k8s-request-limits.md
How to display Kubernetes request and limit in Grafana / Prometheus properly

CPU: percentage of limit

A lot of people land when trying to find out how to calculate CPU usage metric correctly in prometheus, myself included! So I'll post what I eventually ended up using as I think it's still a little difficult trying to tie together all the snippets of info here and elsewhere.

This is specific to k8s and containers that have CPU limits set.

To show CPU usage as a percentage of the limit given to the container, this is the Prometheus query we used to create nice graphs in Grafana:

sum(rate(container_cpu_usage_seconds_total{name!~".*prometheus.*", image!="", container_name!="POD"}[5m])) by (pod_name, container_name) /
[user]
name = rajmani1995
email = rajmani1995@gmail.com
[credential]
helper = cache --timeout=3600
[alias]
aliases = config --get-regexp '^alias\\.'
br = branch
branch-name = rev-parse --abbrev-ref HEAD
ci = commit -m
@arya-oss
arya-oss / config.json
Last active July 1, 2019 06:22
Automated script for Hadoop Installation
{
"hadoop_src":"hadoop-2.7.1.tar.gz",
"hadoop_folder": "hadoop-2.7.1",
"hadoop_path": "Softi/hadoop-2.7.1",
"__comment" : "hadoop_path with respect home folder",
"core": [
{
"name": "fs.default.name",
"value": "hdfs://localhost:54310"
}
@arya-oss
arya-oss / 2048.cpp
Created August 14, 2016 20:10
2048 puzzle game
#include <bits/stdc++.h>
#include <unistd.h>
using namespace std;
int USER = 1;
int COMPUTER = 0;
#define LEFT 0
#define RIGHT 1
#define UP 2
@arya-oss
arya-oss / DES.py
Last active July 3, 2018 08:52
Data Encryption Standard
#!/usr/bin/env python
p_table_1 = [
[57,49,41,33,25,17, 9],
[ 1,58,50,42,34,26,18],
[10, 2,59,51,43,35,27],
[19,11, 3,60,52,44,36],
[63,55,47,39,31,23,15],
[ 7,62,54,46,38,30,22],
[14, 6,61,53,45,37,29],
@arya-oss
arya-oss / nginxproxy.md
Created December 25, 2017 07:00 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@arya-oss
arya-oss / gcc.sublime-build
Created April 11, 2016 16:41
GCC build option for sublime. create new build system and add following lines
{
"cmd": ["gcc", "$file", "-o", "${file_path}/${file_base_name}"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c",
"variants":
[
{
"name": "Run",
"shell": true,
@arya-oss
arya-oss / Popular RegEx.md
Created April 1, 2018 15:12
RegExp Cheatsheet
@arya-oss
arya-oss / login-signup-tabpane-popup.php
Created January 15, 2016 15:14
Login and Sign Up tabs
<!DOCTYPE html>
<html>
<head>
<title>Modal Test</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</head>
<body>