Skip to content

Instantly share code, notes, and snippets.

View bugcy013's full-sized avatar
🪄
Focusing

Dhanasekaran Anbalagan bugcy013

🪄
Focusing
View GitHub Profile
@bugcy013
bugcy013 / limit_asyncio_concurrency_example.py
Created August 16, 2024 06:18 — forked from benfasoli/limit_asyncio_concurrency_example.py
Limit concurrency with Python asyncio
import asyncio
from typing import Coroutine, List, Sequence
def _limit_concurrency(
coroutines: Sequence[Coroutine], concurrency: int
) -> List[Coroutine]:
"""Decorate coroutines to limit concurrency.
Enforces a limit on the number of coroutines that can run concurrently in higher

GitLab Security Pipeline Demo

This READMEexplains the whole process, from start to finish, on how to setup a custom Security Pipeline using GitLab. The starting point is a an already vulnerable application, for this example https://github.com/appsecco/dvna will be used.

The repo is cloned and pushed as-is in a new GitLab Project (empty). The first thing to do is enable a runner for our pipeline, this can be done in the Settings -> CI/CD section of the project

Table of Contents

  1. Add default SAST
  2. Customize Stages
@bugcy013
bugcy013 / 238-cue.sh
Created December 21, 2023 06:26 — forked from vfarcic/238-cue.sh
# Source: https://gist.github.com/vfarcic/a5cb2e8dcd1cf9c14194db3310d5c282
#########################################################
# Is CUE The Perfect Language For Kubernetes Manifests? #
# https://youtu.be/Z-fdFEvgNss #
#########################################################
# Additional Info:
# - Cue: https://cuelang.org
# - Helm vs Kustomize - The Fight Between Templating and Patching in Kubernetes: https://youtu.be/ZMFYSm0ldQ0
DemoHandler
---
def lambda_handler(event, context):
print(event)
return "hello, world!!"
DemoAuthorizer
---
@bugcy013
bugcy013 / gh_inactive_user.py
Created October 3, 2022 17:26 — forked from psa-jforestier/user.py
List all inactive user of a GitHub organization using GitHub API
'''
List all inactive user of a GitHub organization
See user.py --help for usage.
Partially inspired by https://gist.github.com/morido/9817399
'''
import sys # to use sys.stdout
import os
from datetime import datetime
from time import strftime
import datetime
@bugcy013
bugcy013 / Ansible-module-sample-bash.sh
Created March 7, 2022 05:56 — forked from devops-school/Ansible-module-sample-bash.sh
Ansible Module Sample Code using Linux Bash script Example 5
#touch.bash
#!/bin/bash
# import variables from ansible
source $1
state=${state:-present}
if [[ $state == "present" ]]; then
if [ ! -e $file ]; then
touch $file
echo { \"changed\": true }

Supported built-in functions

  • abs(float) - Returns the absolute value of a given float. Example: abs(1) returns 1, and abs(-1) would also return 1, whereas abs(-3.14) would return 3.14. See also the signum function.

  • basename(path) - Returns the last element of a path.

  • base64decode(string) - Given a base64-encoded string, decodes it and returns the original string.

@bugcy013
bugcy013 / tf_functions.tf
Created March 6, 2022 15:04 — forked from carlessanagustin/functions.tf
Terraform functions by example
##--------------------------
## Terraform: Functions ##
##--------------------------
## Open terraform console
terraform console
#######################
## Numeric Functions ##
#######################
@bugcy013
bugcy013 / Jenkins Ans
Created March 7, 2021 10:24 — forked from manuelta/Jenkins Ans
Jenkins QQ
QUESTIONS FROM PREVIOUS EXAM
Refer : https://www.tutorialspoint.com/jenkins/index.htm (Questions are asked from this site)
1. Which of the folowing ways can be used to schedule a build in jenkins?
-After completion of other builds
-Can be scheduled to run at specific time
-By souce code management commits
2. To set up slaves/nodes in Jenkins which of the following feature is used?
Manage Nodes