Skip to content

Instantly share code, notes, and snippets.

import openai
openai.api_key = "YOUR API KEY HERE"
model_engine = "text-davinci-003"
chatbot_prompt = """
As an advanced chatbot, your primary goal is to assist users to the best of your ability. This may involve answering questions, providing helpful information, or completing tasks based on user input. In order to effectively assist users, it is important to be detailed and thorough in your responses. Use examples and evidence to support your points and justify your recommendations or solutions.
<conversation_history>
User: <user input>
@sleirsgoevy
sleirsgoevy / serve_img.sh
Created December 14, 2021 15:42
Script for enabling mass storage emulation on rooted Samsung phones
A=/sys/class/android_usb/android0
set -x
killall -STOP adbd
sleep 1
echo 0 > $A/enable
echo mass_storage > $A/functions
echo disk > $A/f_mass_storage/luns
echo 1 > $A/enable
sleep 1
@sleirsgoevy
sleirsgoevy / ps4.html
Created October 27, 2021 16:06
PS4 WebKit exploit on 9.00
<script>
var PAGE_SIZE = 16384;
var SIZEOF_CSS_FONT_FACE = 0xb8;
var HASHMAP_BUCKET = 208;
var STRING_OFFSET = 20;
var SPRAY_FONTS = 0x1000;
var GUESS_FONT = 0x200430000;
var NPAGES = 20;
var INVALID_POINTER = 0;
var HAMMER_FONT_NAME = "font8"; //must take bucket 3 of 8 (counting from zero)
#include "util.h"
#include "screen.h"
#include "idt.h"
#include "isr.h"
#include "irq.h"
#include "timer.h"
#include "font.h"
#include "system.h"
#include "keyboard.h"
#include "speaker.h"
@abelliumnt
abelliumnt / ABCToken.sol
Last active November 9, 2022 16:27
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.4+commit.1dca32f3.js&optimize=true&gist=
pragma solidity 0.6.4;
import "./Context.sol";
import "./IERC20.sol";
import "./SafeMath.sol";
import "./Ownable.sol";
/**
* @dev Implementation of the {IERC20} interface.
*
StopInstances:
Type: Task
Resource: ${self:custom.function-arn}-StopInstances
Next: WaitForInstancesStop
WaitForInstancesStop:
Type: Wait
Seconds: 15
Next: CheckInstancesStopped
CheckInstancesStopped:
Type: Task
CheckEC2TargetStatus:
Type: Task
Resource: ${self:custom.function-arn}-CheckEC2TargetStatus
Next: EvaluateEC2TargetStatus
ResultPath: '$.onEC2TargetStatus'
Retry:
- ErrorEquals:
- RequestLimitExceeded
- ThrottlingException
- SnapshotCreationPerVolumeRateExceeded
@chadjvw
chadjvw / step-function-iterator.yml
Last active March 16, 2020 18:55
Example AWS Step Function Iterator Pattern
CreateSnapshot:
Type: Task
Resource: ${self:custom.function-arn}-CreateSnapshot
Next: CreateSnapshotIterator
Retry: ${file(common.yml):reqLimitRetry}
CreateSnapshotIterator:
Type: Task
Resource: ${self:custom.function-arn}-Iterate
InputPath: '$.snapshotCreateIterator'
ResultPath: '$.snapshotCreateIterator'
import time
import random
import re
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import NoSuchElementException, StaleElementReferenceException
from chatterbot.trainers import ListTrainer
from chatterbot import ChatBot
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
import random
import sys
def print_same_line(text):
sys.stdout.write('\r')
sys.stdout.flush()