I’ve been writing little machine learning and AI bits of code for a pretty long time and while I’m not very good at it, I feel like the one thing I’ve learned is not to look for what I want to see. “Lying with statistics” was one of the most impactful courses I took in college. The confirmation bias in my works before and after we’re substantially different. Turns out you can look at fatalities from driverless cars or put them in perspective when compared to fatalities for the same number of hours driven by humans. Or focus on the mean vs the average. The perspective a quant has shapes…
-
-
Detect Deepfakes and Hacked Audio Programmatically
Deepfakes are a type of synthetic media where a person replaces parts of an image or video with something else, like someone’s likeness. The act of creating deepfakes is known as deepfakery. Deepfakes can be used to create fake news, spread misinformation, or damage someone’s reputation. They can also be used by a service like JibJab just to be funny, although those are obviously cartoonish and not meant to actually fool anyone. There are a number of different approaches to detecting deepfakes. Some of these approaches are based on image forensics, which is the study of digital images to identify and extract hidden information. Other approaches are based on machine…
-
HTTP Success and Error Codes
When you make a request to a web server, the server will respond with a status code. The status code indicates whether the request was successful or not, and if not, what the error was. There are lots of different HTTP response codes, which are three digit codes that generally align with the following classes: Of these, some of the most common ones we run into include the following: HTTP response codes are typically more used by web developers (and web browser developers) to bettter understand the status of a request and to take appropriate action. For example, if a request returns a 404 Not Found status code, the web…
-
Google Cloud Function to convert JSON to YAML
This function takes JSON data as an input, uses the json and yaml modules to convert JSON data to YAML and then returns with the YAML. Deploy the function, as a Python 3.7 runtime, pasting the following code into the code field:
-
MacAD.UK Presentation (with notes) on Extensions
I’ve been working on this presentation for a long time, so it was awesome to get the first chunk of it out there. Then I saw Graham Pugh publish his with presenter notes included and was like “oh Graham’s really, really smart, so I’ll copy him!” so here’s mine: Just to put a little color on this (or colour if you’re in Brighton), some of my work on extensions has been in support of building https://www.secretchest.io – a new password manager that shards secrets like keys, passwords, and passkeys to make them quantum safe. There’s a sign-up to get access to our private beta on the site. That started with…
-
Detecting LLM-Generated Code
Large language models (LLMs) are a type of artificial intelligence that generates text, translates languages, writes different kinds of creative content, creates net-new artistic works, and answers questions in an informative way. They are trained on massive datasets of text and code, and can learn to produce human-quality output. Because of how they import massive troves of data and create similar content, they can then be fairly formulaic in their output. A few things to look for to help determine if code was written by an LLM: If you are suspicious that a piece of code was written by an LLM, you can use a number of tools to help…
-
Detecting AI-Generated (LLM) Content In Articles
We hear more and more about the pros and cons of AI. There is a movement to regulate the use, movies about dangers of sentient robots, and those who think AI will free humanity from any boring work, or work that involves a lot of repetitive tasks. Going back to the 1950s and 1960s, what they called AI (or what we might call small shell scripts these days) were supposed to “Augment Human Intellect” as the great Doug Englebart wrote about in his 1962 article https://www.dougengelbart.org/content/view/138 or Vannevar Bush’s “As We May Think” from 1945, available at https://www.theatlantic.com/magazine/archive/1945/07/as-we-may-think/303881/. What is an LLM? A large language model (LLM) is a type…
-
Google Cloud Function to convert JSON to a plist
The following is a Google Cloud Function that converts JSON to a property list. It uses the json and plistlib modules to return the property list data. Deploy the function as a Python 3.7 runtime with the following in the function code field:
-
Scripts To Show Browser Extensions In Windows
Posted scripts to return browser extensions installed in Firefox, Google Chrome, and Windows Edge at https://github.com/krypted/extensionsmanager/tree/main/Windows%20Extensions. There’s a python and a VBscript version of each. The VBScript uses a Set objShell = CreateObject(“WScript.Shell”) statement to create a new instance of the WScript.Shell object and the strExtensionsPath = objShell.ExpandEnvironmentStrings(“%APPDATA%\Mozilla\Firefox\Profiles\%USERNAME%\extensions”) statement gets the path to the extensions directory, so if it’s different for a given environment, make sure to change that per-script. The Set colExtensions = objShell.EnumFiles(strExtensionsPath, “*.xpi”) statement gets a collection of all the extensions in the extensions directory. The Chrome version looks for crx, etc. Might be a way to do these with custom extension types that I’m not aware…
-
Simple sqlite3 Fuzzer
One of my favorite ways to find escape defects in code is to employ a generic fuzzer. I typically have 5-10 laptops running fuzzers for various projects at a time. I was recently doing some research on sqlite3 and so started to fuzz the implementation built into macOS. The fuzzer generates random SQL statements and executes them against a SQLite database file. If any errors are encountered, they will be printed to the console: There’s not much logic here. Add more complex tests to improve it. Like SQL grammar to generate valid SQL statements, or a genetic algorithm to evolve SQL statements that are more likely to find bugs. Use…