Skip to content

Instantly share code, notes, and snippets.

@DarrenSem
DarrenSem / chatgpt-lite.js.cs.md
Last active April 20, 2024 14:23
chatgpt-lite.js equivalent in Csharp is... not nearly as minimal (ChatGPT results, MarkDown) (1st comment = final C# version)

SYSTEM:

You are an expert at JavaScript and C#

. You must format indents using 2 spaces, and you must wrap strings using doublequotes " instead of '.

Let's think step by step.

@martijnvermaat
martijnvermaat / ssh-agent-forwarding-screen.md
Created December 21, 2013 15:06
SSH agent forwarding and screen

SSH agent forwarding and screen

When connecting to a remote server via SSH it is often convenient to use SSH agent forwarding so that you don't need a separate keypair on that server for connecting to further servers.

This is enabled by adding the

ForwardAgent yes

option to any of your Host entries in ~/.ssh/config (or alternatively with the -A option). Don't set this option in a wildcard Host * section since any user on the remote server that can bypass file permissions can now als use keys loaded in your SSH agent. So only use this with hosts you trust.

@hiteshchoudhary
hiteshchoudhary / authors.json
Created November 24, 2023 05:54
Random data to learn aggregation pipelines in MongoDB
[
{
"_id": 100,
"name": "F. Scott Fitzgerald",
"birth_year": 1896
},
{
"_id": 101,
"name": "George Orwell",
"birth_year": 1903
@gangefors
gangefors / Install FreeNAS SCALE on a partition and create a mirror.md
Last active April 20, 2024 14:19
How to install TrueNAS SCALE on a partition instead of the full disk

Install TrueNAS SCALE on a partition instead of the full disk

The TrueNAS installer doesn't have a way to use anything less than the full device. This is usually a waste of resources when installing to a modern NVMe which is usually several hundred of GB. TrueNAS SCALE will use only a few GB for its system files so installing to a 16GB partition would be helpful.

The easiest way to solve this is to modify the installer script before starting the installation process.

@throwaway96
throwaway96 / crashd.md
Last active April 20, 2024 14:16
crashd instructions

News

Important: Dev Mode app patch and alternatives (2024-04-14)

Since approximately 2024-04-02, the latest LG Dev Mode app (2.1.2 in the Content Store) copies and resets the permissions of jail_app.conf/jail_app.conf.sig on every boot. Therefore, jailpatch.sh etc. will no longer work.

If you have webOS 5+ and old enough firmware, WTA (which does not require Dev Mode) will still work.

If you have webOS 4.x, you can try CVE-2023-6319. It is unpatched on the latest (final?) firmware for webOS 4.0 (2018) models.

@CCob
CCob / patchless_amsi.h
Created April 17, 2022 16:18
In-Process Patchless AMSI Bypass
#ifndef PATCHLESS_AMSI_H
#define PATCHLESS_AMSI_H
#include <windows.h>
static const int AMSI_RESULT_CLEAN = 0;
PVOID g_amsiScanBufferPtr = nullptr;
unsigned long long setBits(unsigned long long dw, int lowBit, int bits, unsigned long long newValue) {
@benspaulding
benspaulding / appfiles.py
Last active April 20, 2024 14:11
Script to assign a bunch of file types to a particular macOS app
#!/usr/bin/env python3
"""
Assign file types to be opened by a particular application.
Requires the ``duti`` program::
> brew install duti
> ./appfiles.py --help
TODO
@n0mi1k
n0mi1k / ipagrabber.py
Last active April 20, 2024 14:09
.IPA file extracter for Apple Configurator
import os
import shutil
"""
Steps to retrieve the IPA file from the Configurator app:
1. Install Apple Configurator from the Mac App Store and sign in
2. Connect your iOS device to your Mac
3. Select "Add > Apps..." and search for the app you want to install, click "Add"
4. The newer Apple Configurator deletes the IPA after installing it, so you'll need to use this tool to grab it
@benspaulding
benspaulding / Application.applicationWillSwitchOut.applescript
Created October 14, 2011 17:56
AppleScript that will save all documents with unsaved changes when BBEdit loses focus.
(*
File:
Application.applicationWillSwitchOut.scpt
Abstract:
This script will automatically save all on-disk text documents with unsaved
changes when BBEdit loses focus.
Version:
@chris-lesage
chris-lesage / calculate_pole_vector.py
Last active April 20, 2024 14:07
Autodesk Maya script to calculate pole vector position based on 3 input objects
import pymel.core as pm
'''
An Autodesk Maya PyMEL script that calculates a pole vector position
based on 3 input PyNode objects. example: leg, knee, ankle bones.
Chris Lesage chris@rigmarolestudio.com
'''
def calculate_pole_vector(p1, p2, p3, poleDistance=1):
"""