Skip to content

Instantly share code, notes, and snippets.

@avoidik
avoidik / 1-termux-adb.md
Last active July 7, 2024 19:07 — forked from kairusds/1-termux-adb.md
Instructions for connecting Termux's android-tools adb to the current device via Wireless debugging and fixing phantom process killing

Install android-tools if you haven't already:

$ pkg update ; pkg upgrade
$ pkg install android-tools

Pair with remote or local ADB

@avoidik
avoidik / openssl.cnf.diff
Created June 29, 2024 15:06 — forked from rdh27785/openssl.cnf.diff
diff -uN /etc/ssl/openssl.cnf\~original /etc/ssl/openssl.cnf for Nextcloud with OpenSSL 3
--- /etc/ssl/openssl.cnf~original 2022-03-16 08:35:51.000000000 +0000
+++ /etc/ssl/openssl.cnf 2022-05-04 02:37:30.336530711 +0000
@@ -56,6 +56,7 @@
# List of providers to load
[provider_sect]
default = default_sect
+legacy = legacy_sect
# The fips section name should match the section name inside the
# included fipsmodule.cnf.
# fips = fips_sect
@avoidik
avoidik / commit_jupyter_notebooks_code_to_git_and_keep_output_locally.md
Last active April 13, 2024 13:58 — forked from 33eyes/commit_jupyter_notebooks_code_to_git_and_keep_output_locally.md
How to commit jupyter notebooks without output to git while keeping the notebooks outputs intact locally
  1. Add a filter to git config by running the following command in bash inside the repo:
git config filter.strip-notebook-output.clean 'jupyter nbconvert --ClearOutputPreprocessor.enabled=True --to=notebook --stdin --stdout --log-level=ERROR'  

Or

git config --global filter.strip-notebook-output.clean 'docker run --rm -i -v \"${pwd}:/home/jovyan\" jupyter/datascience-notebook jupyter nbconvert --clear-output --to=notebook --stdin --stdout --log-level=ERROR'
  1. Create a .gitattributes file inside the directory with the notebooks
@avoidik
avoidik / useradd.sh
Created March 8, 2024 09:36 — forked from igorvoltaic/useradd.sh
Create new user using command line in Mac OS X. Do not forget to set correct permissions for the file.
#!/bin/sh
if [[ `id -u` != 0 ]]; then
echo "Must be root to run script"
exit
fi
read -p "Enter user name and press [ENTER]: " UserName
if [[ $UserName == `dscl . -list /Users UniqueID | awk '{print $1}' | grep -w $UserName` ]]; then
@avoidik
avoidik / check_vulnerabledrivers.ps1
Created May 21, 2023 13:39 — forked from api0cradle/check_vulnerabledrivers.ps1
A quick script to check for vulnerable drivers. Compares drivers on system with list from loldrivers.io
# Simple script to check drivers in C:\windows\system32\drivers against the loldrivers list
# Author: Oddvar Moe - @oddvar.moe
$drivers = get-childitem -Path c:\windows\system32\drivers
$web_client = new-object system.net.webclient
$loldrivers = $web_client.DownloadString(" https://www.loldrivers.io/api/drivers.json") | ConvertFrom-Json
Write-output("Checking {0} drivers in C:\windows\system32\drivers against loldrivers.io json file" -f $drivers.Count)
foreach ($lol in $loldrivers.KnownVulnerableSamples)
{
@avoidik
avoidik / cognito.yaml
Created May 2, 2022 18:14 — forked from singledigit/cognito.yaml
Create a Cognito Authentication Backend via CloudFormation
AWSTemplateFormatVersion: '2010-09-09'
Description: Cognito Stack
Parameters:
AuthName:
Type: String
Description: Unique Auth Name for Cognito Resources
Resources:
# Creates a role that allows Cognito to send SNS messages
SNSRole:
@avoidik
avoidik / aws_cognito_aes.md
Created May 2, 2022 18:14 — forked from asaphe/aws_cognito_aes.md
Amazon Elasticsearch - Kibana Access using AWS Cognito and Google Apps

Amazon Cognito for Amazon Elasticsearch Kibana access using SAML

That is a mouthful and the process could be clearer. doesn't help that there's a lot of outdated information and conflicting articles with links upon links pointing you in every which way but the right way.

I'll use Google Apps as a SAML provider for the purpose of this gist.

Overview of the steps

The process is triggered from the AES Console and required multiple steps to configure the IAM Roles and chosen IDP

@avoidik
avoidik / vault-agent-pki.md
Created April 14, 2022 14:34 — forked from kawsark/vault-agent-pki
Vault Agent with PKI certificate rendering

Configure variables

These variables will be used for this snippet. Please substitute accordingly.

export RootCAName="root_ca"
export InterCAName="inter_ca"
export CommonName="hashidemos.io"
export InterCommonName="inter.hashidemos.io"
export Root_CA_ttl="730h"
export Inter_CA_ttl="350h"
export Cert_ttl="8h"
@avoidik
avoidik / cloudtrail-template-elasticsearch.json
Created December 27, 2021 07:33 — forked from kesor/cloudtrail-template-elasticsearch.json
An ElasticSearch Index template for CloudTrail events
PUT _template/cloudtrail
{
"index_patterns": ["cloudtrail-*"],
"settings": {
"number_of_shards": 1,
"mapping": {
"total_fields": {
"limit": 10000
}
}
@avoidik
avoidik / 1_ecs_note.md
Created November 9, 2021 01:40 — forked from ejlp12/1_ecs_note.md
ECS Best Practices Notes