Skip to content

Instantly share code, notes, and snippets.

View AnowarCST's full-sized avatar

Anowar Hossain AnowarCST

  • Dhaka, Bangladesh
View GitHub Profile
@AnowarCST
AnowarCST / devsecops-ai-era.md
Created October 24, 2025 20:17
DevSecOps in the AI Era — Security Gates that Scale (Quickstart)

DevSecOps in the AI Era — Security Gates that Scale (Quickstart)

Promise: Ship fast and safe by embedding three gates in CI/CD: SAST/SCA (SonarCloud), AI-assisted peer review, and DAST (Playwright → OWASP ZAP).
Audience: Security specialists, architects, senior devs.
Outcome: A minimal, repeatable pattern you can enable on Monday.


TL;DR

  • Shift-left: SonarCloud Quality Gate on PRs (fail High/Critical).

DevSecOps Pipeline Checklist

Purpose: A practical, repo-ready checklist that mirrors the DevSecOps pipeline stages and their gates. Use it as your team’s working agreement.

Tip: Copy this file as DEVSECOPS_CHECKLIST.md in your repo. Create the PR template below at .github/pull_request_template.md.


How to use this checklist

@AnowarCST
AnowarCST / ProfileTest.php
Last active January 29, 2020 11:26
Test Case for ProfileController
<?php
namespace Tests\Feature;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;
use Faker\Generator as Faker;
@AnowarCST
AnowarCST / ProfileController.php
Last active January 29, 2020 14:06
Sample ProfileController for Medium Post
<?php
namespace App\Http\Controllers\API\V1;
use App\Http\Controllers\Controller;
use App\Http\Requests\Users\ChangePasswordRequest;
use App\Http\Requests\Users\ProfileUpdateRequest;
use App\Models\User;
use Illuminate\Support\Facades\Hash;
# Install these packages (use your favorite AUR tool here)
yay -S minikube-bin kubectl-bin docker-machine-driver-kvm2 libvirt qemu-headless docker-machine ebtables
# Get libvirt going
sudo systemctl enable libvirtd.service
sudo usermod -a -G libvirt $(whoami)
# This fix thanks to http://blog.programmableproduction.com/2018/03/08/Archlinux-Setup-Minikube-using-KVM/
sudo virsh net-autostart default
@AnowarCST
AnowarCST / MobileNumberValidator.php
Created October 10, 2018 09:34
Validate local and international mobile no. Extract local mobile no.
<?php
namespace App\Http\Requests;
class MobileNumberValidator
{
/**
* Validate local/international Mobile No
*
@AnowarCST
AnowarCST / motionSensor.cpp
Last active April 27, 2017 16:03
PIR Motion Sensor with Arduino
//the time we give the sensor to calibrate (10-60 secs according to the datasheet)
int calibrationTime = 30;
//the time when the sensor outputs a low impulse
long unsigned int lowIn;
//the amount of milliseconds the sensor has to be low
//before we assume all motion has stopped
long unsigned int pause = 5000;
@AnowarCST
AnowarCST / fish.html
Created August 14, 2016 18:21
just fun: javascript fish
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Fish</title>
<style>
*{
line-height: 15px;
}
.color{
@AnowarCST
AnowarCST / 01_Laravel 5 Simple ACL manager_Readme.md
Created August 2, 2016 10:08 — forked from amochohan/01_Laravel 5 Simple ACL manager_Readme.md
Laravel 5 Simple ACL - Protect routes by an account / role type

#Laravel 5 Simple ACL manager

Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.

If the user has a 'Root' role, then they can perform any actions.

Installation

Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php

@AnowarCST
AnowarCST / Convert.php
Last active July 28, 2016 11:58
convertUTF8
public static function convertUTF8($string)
{
//$sampleString = 'u0986u09a8u09c7u09beu09dfu09beu09b0 u09b9u09c7u09beu09b8u09beu0987u09a8';
$string = preg_replace('/u([0-9a-fA-F]+)/', '&#x$1;', $string);
return html_entity_decode($string, ENT_COMPAT, 'UTF-8');
}