Skip to content

Instantly share code, notes, and snippets.

View BoeJaker's full-sized avatar
💭
Completing CTFs

Boe Jaker BoeJaker

💭
Completing CTFs
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<title>My Repositories Wiki</title>
<style>
body {
margin: 0;
padding: 0;
height: 100vh;
display: flex;
@BoeJaker
BoeJaker / resize_swap.sh
Created May 31, 2023 14:52
resize_swap.sh
# Turn swap off
# This moves stuff in swap to the main memory and might take several minutes
sudo swapoff -a
# Create an empty swapfile
# Note that "1G" is basically just the unit and count is an integer.
# Together, they define the size. In this case 8GB.
sudo dd if=/dev/zero of=/swapfile bs=1G count=8
# Set the correct permissions
@BoeJaker
BoeJaker / index.py
Created May 13, 2023 14:17
Docker White Label Landing Page
import docker
import re
import yaml
from flask import Flask, render_template, redirect
import os, time
app = Flask(__name__)
stack_name="workbench"
import docker
import re
import yaml
from flask import Flask, render_template, redirect
import os, time
app = Flask(__name__)
stack_name="workbench"
@BoeJaker
BoeJaker / openAssist.py
Created May 13, 2023 14:17
Hugging Face Workbench
import gradio as gr
from transformers import pipeline
import time
import requests
model = "gpt2"
generator = pipeline("text-generation", model=model)
generator.model.config.temperature = 0.6
generator.model.config.repetition_penalty = 1.5
generator.model.config.length_penalty = 2
from googlesearch import search
import requests
from bs4 import BeautifulSoup
from transformers import BertForQuestionAnswering, BertTokenizer
import requests
from bs4 import BeautifulSoup
def read_website_context(url):
"""
@BoeJaker
BoeJaker / expert.py
Created May 13, 2023 14:15
qa_bot_v1
import random
import wikipediaapi
from transformers import BertForQuestionAnswering, BertTokenizer
# Load pre-trained BERT-QA model and tokenizer
model_name = 'bert-large-uncased-whole-word-masking-finetuned-squad'
tokenizer = BertTokenizer.from_pretrained(model_name)
model = BertForQuestionAnswering.from_pretrained(model_name)
# Example question
@BoeJaker
BoeJaker / Docker_Arg_Check.sh
Created April 26, 2023 05:39
Docker Compose Args Env Test
#!/bin/bash
# Set the path to the directory containing the Dockerfiles and docker-compose.yml file
DOCKER_DIR="path/to/docker/files"
# Get a list of Dockerfiles in the directory
DOCKERFILES=$(ls ${DOCKER_DIR}/*.dockerfile)
# Read the environment variables and arguments defined in docker-compose.yml
COMPOSE_VARS=$(docker-compose -f ${DOCKER_DIR}/docker-compose.yml config | grep -E '(environment:|args:)')
@BoeJaker
BoeJaker / Ouroboros.py
Created April 26, 2023 05:38
Ouroboros
class Ouroboros:
def __init__(self, val):
self.val = val
self.tail = self
def __repr__(self):
return f'Ouroboros({self.val})'
def eat_tail(self):
print(f"Eating tail... before: {self.tail}")
@BoeJaker
BoeJaker / circular_network.py
Created April 26, 2023 05:36
Circular Network
import socket
# Define some constants
PORT = 9000
MAX_CONNECTIONS = 10
# Create a circular list of nodes
nodes = ['node1', 'node2', 'node3']
num_nodes = len(nodes)
for i, node in enumerate(nodes):