Skip to content

Instantly share code, notes, and snippets.

View Olaw2jr's full-sized avatar
🏠
Working from home

Oscar Olotu Olaw2jr

🏠
Working from home
View GitHub Profile
#!/usr/bin/env bash
# Output file name
timestamp=$(date +"%Y%m%d%H%M%S")
output_file="password_policy_audit_$(md5hash $timestamp).csv"
# Header for the CSV file
echo "Timestamp,User,Password Length,Password Expiry,Password Complexity,Password History,Password Auto Lock,Session Timeout,Root Enforcement" > "$output_file"
# Check if sudo is available
@Olaw2jr
Olaw2jr / cissp_notes.md
Created March 25, 2024 17:03 — forked from penafieljlm/cissp_notes.md
Personal CISSP Study Notes

CISSP Notes

CIA Triad

  • Confidentiality
    • Resources should be protected from unauthorized access
    • Prioritized by governments
    • Concepts
      • Sensitivity
        • How harmful is disclosure
  • Discretion
@Olaw2jr
Olaw2jr / useDynamicTextareaSize.ts
Created February 12, 2024 19:59 — forked from tomasz-stefaniak/useDynamicTextareaSize.ts
Custom hook for dynamically resizing a textarea to fit its content.
/**
* Custom hook for dynamically resizing a textarea to fit its content.
* @param {React.RefObject<HTMLTextAreaElement>} textareaRef - Reference to the textarea element.
* @param {string} textContent - Current text content of the textarea.
* @param {number} maxHeight - Optional: maxHeight of the textarea in pixels.
*/
import { useEffect } from "react";
export const useDynamicTextareaSize = (
@Olaw2jr
Olaw2jr / pysyslog.py
Created February 3, 2024 19:25 — forked from marcelom/pysyslog.py
Tiny Python Syslog Server
#!/usr/bin/env python
## Tiny Syslog Server in Python.
##
## This is a tiny syslog server that is able to receive UDP based syslog
## entries on a specified port and save them to a file.
## That's it... it does nothing else...
## There are a few configuration parameters.
LOG_FILE = 'youlogfile.log'
@Olaw2jr
Olaw2jr / service.js
Created February 2, 2024 17:25 — forked from santospatrick/service.js
An example Service class wrapper for Axios
import axios from "axios";
class HttpService {
constructor() {
const token = window.localStorage.getItem("token");
const service = axios.create({
baseURL: process.env.REACT_APP_API_URL,
headers: token
? {
Authorization: `Bearer ${token}`,
@Olaw2jr
Olaw2jr / use-copy-to-clipboard.ts
Created January 24, 2024 18:07 — forked from KristofferEriksson/use-copy-to-clipboard.ts
Custom React hook for effortless text copying to clipboard! It handles copy status with a customizable timer and error management.
import { useCallback, useState } from "react";
// Custom hook to copy text to clipboard
const useCopyToClipboard = (timeoutDuration: number = 1000) => {
const [copied, setCopied] = useState(false);
const [error, setError] = useState<Error | null>(null);
const copyToClipboard = useCallback(
async (text: string) => {
try {
@Olaw2jr
Olaw2jr / useConfirmation.ts
Created January 24, 2024 18:04 — forked from KristofferEriksson/useConfirmation.ts
Custom React hook for double-click confirmation for critical actions
import { useCallback, useEffect, useRef, useState } from "react";
/**
* Custom React hook for double-click confirmation for critical actions.
*
* @param action - The action to be executed on the second click.
* @param timeout - Time in milliseconds to reset the unlocked state.
* @returns The current unlocked state and the trigger function.
*/
const useConfirmation = (action: () => void, timeout: number = 5000) => {
@Olaw2jr
Olaw2jr / useLongPress.ts
Created January 24, 2024 17:53 — forked from KristofferEriksson/useLongPress.ts
A simple useLongPress hook for React
import { useCallback, useEffect, useRef } from "react";
export function useLongPress({
delay,
onLongPress,
onClick,
onCancel,
onFinish,
onStart,
}: {
@Olaw2jr
Olaw2jr / setupiisforsslperfectforwardsecrecy_v17.ps1
Created May 29, 2023 13:51 — forked from jbratu/setupiisforsslperfectforwardsecrecy_v17.ps1
Great powershell script for tightening HTTPS security on IIS and disabling insecure protocols and ciphers. Very useful on core installations.
# Copyright 2019, Alexander Hass
# https://www.hass.de/content/setup-microsoft-windows-or-iis-ssl-perfect-forward-secrecy-and-tls-12
#
# After running this script the computer only supports:
# - TLS 1.2
#
# Version 3.0.1, see CHANGELOG.txt for changes.
Write-Host 'Configuring IIS with SSL/TLS Deployment Best Practices...'
Write-Host '--------------------------------------------------------------------------------'
<div class="bg-white border-slate-100 dark:bg-slate-800 dark:border-slate-500 border-b rounded-t-xl p-4 pb-6 sm:p-10 sm:pb-8 lg:p-6 xl:p-10 xl:pb-8 space-y-6 sm:space-y-8 lg:space-y-6 xl:space-y-8">
<div class="flex items-center space-x-4">
<img src="/full-stack-radio.png" alt="" width="88" height="88" class="flex-none rounded-lg bg-slate-100" />
<div class="min-w-0 flex-auto space-y-1 font-semibold">
<p class="text-cyan-500 dark:text-cyan-400 text-sm leading-6">
<abbr title="Episode">Ep.</abbr> 128
</p>
<h2 class="text-slate-500 dark:text-slate-400 text-sm leading-6 truncate">
Scaling CSS at Heroku with Utility Classes