Skip to content

Instantly share code, notes, and snippets.

View elchappo's full-sized avatar
🏴‍☠️

Pawel Zareba elchappo

🏴‍☠️
View GitHub Profile
@elchappo
elchappo / Dockerfile
Created February 9, 2024 21:35 — forked from adtac/Dockerfile
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3
@elchappo
elchappo / .tmux.conf
Created November 11, 2023 16:10 — forked from wenijinew/.tmux.conf
Tmux Configuration
set -g TMUX_PLUGIN_MANAGER_PATH "$GITHUB_REPO_ROOT"
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'wenijinew/glamour.tmux'
@elchappo
elchappo / openai_call.json
Created November 7, 2023 19:32 — forked from iceener/openai_call.json
OpenAI Function Calling (parameters)
{
"model": "gpt-3.5-turbo-0613",
"function_call": {
"name": "query_enrichment"
},
"messages": [
{
"role": "user",
"content": "Write a newsletter."
}
@elchappo
elchappo / encoder.js
Created April 28, 2023 17:38 — forked from iceener/encoder.js
gpt-3-encoder-netlify-function.js
const { encode } = require('@nem035/gpt-3-encoder')
exports.handler = async (event, context) => {
if (event.httpMethod === 'POST') {
try {
const payload = JSON.parse(event.body);
const text = payload.text;
return {
const API_URL = "https://api.openai.com/v1/chat/completions";
const MAX_TOKENS = 1500;
const TEMPERATURE = 0.5;
const SYSTEM_PROMPT = 'Act as assistant';
const MESSAGES = ["hello", "hi!", "how are you?"];
async function openAICompletion(msg) {
const options = {
method: "POST",
headers: {
@elchappo
elchappo / js-and-bat.bat
Created October 23, 2022 18:11 — forked from hasegawayosuke/js-and-bat.bat
Polyglot of node.js / window bat file
if(""==0) {/*
@echo off
echo "BAT"
node "%~f0" %*
goto :eof
*/
console.log( "js" );
}
@elchappo
elchappo / ezines.txt
Created October 23, 2022 17:27 — forked from helcaraxeals/ezines.txt
AppSec Ezines Url (https://github.com/Simpsonpt/AppSecEzine) from 1 to 309
https://gist.github.com/cure53/df34ea68c26441f3ae98f821ba1feb9c
http://goo.gl/ZIOZqG (+)
http://rol.im/asux/
https://bitbucket.org/decalage/oletools
https://goo.gl/fBEuSF (+)
https://intothesymmetry.blogspot.co.uk/2016/05/holy-redirecturi-batman.html
https://unlogic.co.uk/2016/04/12/binary-bomb-with-radare2-prelude/
http://www.oreilly.com/webops-perf/free/files/docker-security.pdf
http://goo.gl/QM0mZx (+)
#!/bin/python
# -*- coding: utf-8 -*-
from time import sleep
from random import randint
from selenium import webdriver
from pyvirtualdisplay import Display
class MuncherySpider():
def __init__(self):
@elchappo
elchappo / wordpress-change-domain-migration.sql
Created December 7, 2017 01:25 — forked from chuckreynolds/wordpress-change-domain-migration.sql
Use this SQL script when changing domains on a WordPress site. Whether you’re moving from an old domain to a new domain or you’re changing from a development domain to a production domain this will work. __STEP1: always backup your database. __STEP2: change the ‘oldsite.com’ and ‘newsite.com’ variables to your own. __STEP3: make sure your databa…
SET @oldsite='http://oldsite.com';
SET @newsite='http://newsite.com';
UPDATE wp_options SET option_value = replace(option_value, @oldsite, @newsite) WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = replace(post_content, @oldsite, @newsite);
UPDATE wp_links SET link_url = replace(link_url, @oldsite, @newsite);
UPDATE wp_postmeta SET meta_value = replace(meta_value, @oldsite, @newsite);
/* only uncomment next line if you want all your current posts to post to RSS again as new */
#UPDATE wp_posts SET guid = replace(guid, @oldsite, @newsite);