Skip to content

Instantly share code, notes, and snippets.

@scovetta
scovetta / update-all.sh
Created March 24, 2024 13:10
Update all pip dependencies
#!/bin/bash
pip --disable-pip-version-check list --outdated --format=json | python -c "import json, sys; print('\n'.join([x['name'] for x in json.load(sys.stdin)]))" | xargs -n1 pip install -U
@scovetta
scovetta / LLM.md
Created March 29, 2023 04:28 — forked from rain-1/LLM.md
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

@scovetta
scovetta / compliments.json
Created August 11, 2022 05:18 — forked from ryck/compliments.json
MagicMirror compliments file
{
"anytime" : [
"Hey there sexy!",
"I hope your day is as nice as your face!",
"Have you been working out?",
"I'm lucky to be your mirror!",
"The Force is strong with you",
"If I could high five you... I would!",
"On a scale from 1 to 10, you're an 15!",
"Being awesome is hard, but you'll manage",
@scovetta
scovetta / compliments.json
Created August 11, 2022 04:51 — forked from E3V3A/compliments.json
MagicMirror compliments file
{
"anytime" : [
"Hey there sexy!",
"I hope your day is as nice as your face!",
"Have you been working out?",
"I'm lucky to be your mirror!",
"The Force is strong with you",
"If I could high five you... I would!",
"On a scale from 1 to 10, you're an 15!",
"Being awesome is hard, but you'll manage",
@scovetta
scovetta / npm-report-malware.py
Last active April 4, 2022 14:56
This script can be used to automate reporting of malware to the npm team, as a shortcut to npmjs.com/support.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This script will automate reporting malware to the npm team.
It automates reporting via https://npmjs.com/support.
Before using it, either ensure you have the Requests module installed, or install it with
`pip install requests`.
@scovetta
scovetta / update-to-https.py
Last active January 11, 2022 23:06
Basic script to scan a directory for .cmake and .json files and safely replace `http:` URLs with `https:`, where "safely" is defined as "making requests returns identical bytes".
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
The purpose of this script is to scan a directory (default: ports) for
port configuration files that contain http-based URLS, and convert
them to https if possible.
It only looks for files with an extension of .cmake or .json.
# Download JSON files for CVEs from https://nvd.nist.gov/vuln/data-feeds
# Extract JSON
# Fire up WSL or a Linux terminal. Make sure you have jq installed.
# Run this, send to a CSV file and then open/sort/whatever in Excel.
cat nvdcve-1.1-2021.json | jq '.CVE_Items[].cve | .CVE_data_meta.ID + ", " + .problemtype.problemtype_data[].description[].value' | cut -d\" -f2
#!/usr/bin/python
# License: MIT
# Author: Michael Scovetta <[email protected]>
import re
import sys
"""
Usage:
@scovetta
scovetta / create-sed-script
Last active September 28, 2019 17:10
Replacing HTTP with HTTPS links in a large repository
#!/bin/bash
# Takes a list of URLs (output from ishttps) and turns them into a massive sed replacement script.
FILENAME="$1"
echo "sed -i '"
while read -r url; do
ESC_IN=$(echo "$url" | sed -e 's/[]\/$*.^[]/\\&/g')
ESC_OUT=$(echo "$ESC_IN" | sed -e 's/http:/https:/')
@scovetta
scovetta / applicationHost.config
Created September 18, 2017 22:31
Enable TLS Protocol Logging in IIS
<!--
Source:
https://blogs.microsoft.com/microsoftsecure/2017/09/07/new-iis-functionality-to-help-identify-weak-tls-usage/
-->
<site name="Default Web Site" id="1" serverAutoStart="true">
<application path="/">
<virtualDirectory path="/" physicalPath="C:\inetpub\wwwroot" />
</application>
<bindings>