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>
@kyroskoh
kyroskoh / testcase.robot
Created November 9, 2022 08:25
testcase to create Webdriver as we need to set chrome_options and executable_path (path chromedriver).
*** Settings ***
Library SeleniumLibrary
Test Teardown Close Browser
*** Variables ***
${URL} https://www.google.com
${txtSearch} //*[@name="q"]
*** Test Cases ***
@kyroskoh
kyroskoh / Dockerfile
Created November 9, 2022 07:47
docker-robotframework (python3.9)
FROM python:3.9
# install google chrome
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
RUN apt-get -y update
RUN apt-get install -y google-chrome-stable
# install chromedriver
RUN apt-get install -yqq unzip
@kyroskoh
kyroskoh / ps4.html
Created December 16, 2021 05:16 — forked from sleirsgoevy/ps4.html
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)
@kyroskoh
kyroskoh / serve_img.sh
Created December 16, 2021 05:14 — forked from sleirsgoevy/serve_img.sh
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
@kyroskoh
kyroskoh / harden.sh
Created July 5, 2021 12:10 — forked from jumanjiman/harden.sh
hardening script for an alpine docker container
#!/bin/sh
# Copyright 2020 Paul Morgan
# License: GPLv2 (https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
set -x
set -e
#
# Docker build calls this script to harden the image during build.
#
# NOTE: To build on CircleCI, you must take care to keep the `find`
# command out of the /proc filesystem to avoid errors like:
@kyroskoh
kyroskoh / ABCToken.sol
Created May 7, 2021 06:54 — forked from abelliumnt/ABCToken.sol
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.
*
@kyroskoh
kyroskoh / main.c
Created April 22, 2021 13:57 — forked from parkerlreed/main.c
#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"
#!/bin/bash
# Copyright (C) 2012 Crowd9 Pty Ltd
usage ()
{
echo >&2 "usage: bash $0 'john@example.com' 'MyBox' 'MyProvider.com' [\\\$20/mth]"
}
if [ $# -lt 3 ]
then
@kyroskoh
kyroskoh / README.md
Created July 30, 2020 12:54 — forked from mrbar42/README.md
Secured HLS setup with Nginx as media server

Secured HLS setup with Nginx as media server

This example is part of this article.

This is an example for an HLS delivery with basic security. Nginx compiled with nginx-rtmp-module & secure-link is used as media server. Features:

  • Domain filtering
  • Referrer filtering
  • Embed buster