Skip to content

Instantly share code, notes, and snippets.

View peteralcock's full-sized avatar

Peter Alcock peteralcock

View GitHub Profile
@peteralcock
peteralcock / claude.txt
Created May 6, 2025 00:39
Clause System Prompt Leak
<citation_instructions>If the assistant's response is based on content returned by the web_search, drive_search, google_drive_search, or google_drive_fetch tool, the assistant must always appropriately cite its response. Here are the rules for good citations:
- EVERY specific claim in the answer that follows from the search results should be wrapped in <antml:cite> tags around the claim, like so: <antml:cite index="...">...</antml:cite>.
- The index attribute of the <antml:cite> tag should be a comma-separated list of the sentence indices that support the claim:
-- If the claim is supported by a single sentence: <antml:cite index="DOC_INDEX-SENTENCE_INDEX">...</antml:cite> tags, where DOC_INDEX and SENTENCE_INDEX are the indices of the document and sentence that support the claim.
-- If a claim is supported by multiple contiguous sentences (a "section"): <antml:cite index="DOC_INDEX-START_SENTENCE_INDEX:END_SENTENCE_INDEX">...</antml:cite> tags, where DOC_INDEX is the corresponding document index and START_S
#!/usr/bin/python3
import openai
import sys
openai.api_key = 'sk-xxx'
verbose = sys.argv[1] == '-v'
prompt = ' '.join(sys.argv[2 if verbose else 1:])
@peteralcock
peteralcock / configureAdfs.ps1
Created April 16, 2018 22:38
build ADFS RelyingParty
#####################################################################
# Script: configureAdfs.ps1
# Descrption: Add and remove a relying party to ADFS with rules
######################################################################
function AddRelyingParty
(
[string]$realm = $(throw "Realm for the application is required. E.g.: http://whatever.com or urn:whatever"),
[string]$webAppEndpoint = $(throw "Endpoint where the token will be POSTed is required")
)
@peteralcock
peteralcock / _README.md
Created July 27, 2017 17:33 — forked from oleq/_README.md
A2DP audio streaming using Raspberry PI (Raspbian Jessie)

What is this all about?

This tutorial will turn your Raspberry PI into a simple Bluetooth audio receiver, which plays music through connected speakers. It's like a regular car audio system, but it can be used anywhere and it's a good value.

   Audio source (i.e. smartphone) 
                |
                v
 (((  Wireless Bluetooth Channel  )))
 |
apt-get update -y
apt-get upgrade -y
apt-get install -y ntp
apt-get install -y build-essential
apt-get install -y g++ gcc
apt-get install -y make libqt4-dev libpq-dev cmake
apt-get install -y curl libcurl3 libcurl4-gnutls-dev
apt-get install -y zlib1g-dev unzip wget curl
apt-get install -y libssh2-php libicu-dev libkrb5-dev libreadline-dev libffi-dev
apt-get install -y bison mcrypt libssl-dev libyaml-dev libreadline-dev openssl zlib1g-dev libxml2-dev libxslt1-dev libcurl4-openssl-dev
@peteralcock
peteralcock / latency.txt
Created January 31, 2017 17:45 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD