Skip to content

Instantly share code, notes, and snippets.

View Treebug842's full-sized avatar
🎯
Focusing

Treebug842

🎯
Focusing
  • Australia
View GitHub Profile
@Treebug842
Treebug842 / doesFileExist.cpp
Created March 21, 2022 10:05
Simple function to check if a file exists
#include <iostream>
#include <fstream>
#include <string>
bool doesFileExist(const char* path){
std::ifstream file(path);
if(!file.is_open()){
return false;
}
return true;
@Treebug842
Treebug842 / loadingBar.cpp
Created November 30, 2021 10:33
Simple Loading bar in c++
#define COUNTER_TIME_S 10
#define DELAY_MS 1000
#include <windows.h>
#include <iostream>
void clearScreen(int characterLength) {
for (int i=0; i<characterLength; i++) {
std::cout << "\b";
}
@Treebug842
Treebug842 / multiTasking.py
Created November 9, 2021 09:06
Some simple concept code for multithreading and multiprocessing in python
# %% MultiThreading for Tasks
import threading
def multiThread(function, threadcount, *args):
threads = []
for i in range(0, threadcount):
threads.append(threading.Thread(target=function, args=args))
for thread in threads:
thread.start()
@Treebug842
Treebug842 / request_to_tor.py
Created November 9, 2021 04:09
Simple code to make a request to .onion sites through tor
import requests
from bs4 import BeautifulSoup
url = input("Enter a URL: ")
url = "http://darkfailenbsdla5mal2mxn2uz66od5vtzd5qozslagrfzachha3f3id.onion/" if not url else url
def get_tor_session():
session = requests.session()
session.proxies = {'http': 'socks5h://127.0.0.1:9050',
'https': 'socks5h://127.0.0.1:9050'}
@Treebug842
Treebug842 / publickey.asc
Created October 23, 2020 02:10
My Public PGP Key
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBF+SN3YBEACbMJOBkhbliQY7QaA0sEGuKUD6AJB9RXIeiKWqWXUHr1ZLMwjQ
0GyaGUE0awfJwX9jh7GUouClsv18RXNL0jEAQzQKzk3F4KjJF/PIxaxUpEEwRahs
lLlUhsm+l9YNebn00n1iJON4LMc+uE4wVN7Cdwr6RrpCbddkiMzaZpTT5RBuqgf+
xBBS1SA9fwGt/8U0+6wB00nqr0r/dIvfH4iRBWhBe/NW21xtraEO/Y5rATeDCXpf
v/aAD8ngL6w4sxpopTTLGGL2Plx9MIenYi5dEVDo/k+AVvRr6vdyv9ICvX8SFSZ7
jc1EYuzhjV83s09YWLKV8xxhEh/rogFftrNaY4BjOVKSXC/fGIHIGt248Idw/Ls1
Q21S5P8fOK46X8ENbB0A9YPEzUMpoy/eU68rhRPA0q/MFnOoD9x4nxBYbTVbCJl2
Xm8nrfLQvTywKob6uchEFREFNJaKPtMQTX7bX5Jxz2OG0n+UC5M/c6Wozr09icX3
@Treebug842
Treebug842 / Sodoku-Solver.py
Created July 24, 2020 06:36
Simple code that solves a sodoku board using backtracking algorithm
#!/bin/env python3
# Written by Treebug842
board = [
[9, 0, 7, 0, 2, 1, 0, 0, 8],
[0, 1, 4, 0, 6, 0, 0, 9, 0],
[0, 0, 8, 5, 0, 7, 0, 0, 2],
[0, 4, 0, 9, 0, 0, 5, 1, 0],
[0, 2, 0, 0, 0, 0, 0, 6, 0],
[0, 7, 3, 0, 0, 5, 0, 2, 0],