Skip to content

Instantly share code, notes, and snippets.

View perryBunn's full-sized avatar
🤠

Perry Bunn perryBunn

🤠
View GitHub Profile
@perryBunn
perryBunn / eu4_cheeser.py
Last active April 16, 2022 16:07
Eu4_cheeser
#! /usr/bin/env python3
"""
Description: This will run at a regular interval to make copies of the EU4 save
specified. Creating backups of Ironman games to fall back to.
"""
from datetime import datetime
from logging import Logger
from pathlib import Path
from shutil import copyfile
@perryBunn
perryBunn / <project>.sublime-project
Last active February 17, 2022 14:44
Sublime Text Settings
{
"folders": [
{
"path": ".",
/*"name": "root",*/
"folder_exclude_patterns": ["__pycache__"]
},
],
"settings": {
"SublimeLinter.linters.flake8.disable": true,
@perryBunn
perryBunn / shakespeare.py
Created July 26, 2021 00:24
This is realated to a discussion that me and my girlfriend were having about the Infinite monkey theorem. Needless to say it devolved into us wondering what the average word length of all of shakespeare is. Text file is from Project Gutenberg and can be found on their website.
def main():
words = {
# word: [
# length,
# count
# ]
}
with open('t8.shakespeare.txt', 'r', encoding='utf-8') as file:
@perryBunn
perryBunn / assignment5.py
Created March 19, 2021 17:19
SQA Assignment 5
def main(x, y) -> str:
under = {
1000: .03,
5000: .04,
20000: .05
}
over = {
1000: .02,
5000: .03,
20000: .04
@perryBunn
perryBunn / Readme.md
Last active January 14, 2021 22:21
This will take a text file formatted from the example in the readme and then create an excel file and plot

Setup

You will need to make sure that matplotlib, pandas, and openpyxl are installed on your system. to do so run the following command in your command prompt or terminal:

pip3 install pandas matplotlib openpyxl

Collection

In your terminal you run ping for the servers you want for some amount of runs

@perryBunn
perryBunn / Bundled Notes OLED Theme.md
Last active December 24, 2020 07:41
Bundled Notes OLED Theme
# put file in /etc/systemd/system/
[Unit]
Description=Update DNS entry for this host to current IP
[Service]
Type=oneshot
ExecStart=/bin/sh /usr/local/bin/cloudflare-ddns.sh

Factorio gcloud server

I struggled setting up a server so i figured i write a gist to help me in the future/anyone wanting to set one up too. I do not recomend that you run the server as root. yes there are better ways to do this but this was what i did and it works.

create the vm

self explainatory.

update and grab dependancys

sudo passwd

enter what ever password you want for

@perryBunn
perryBunn / editDodecahedron.java
Last active March 19, 2017 20:39
edit dodecahedron example
public boolean editDodecahedron(String labelIn, String colorIn, double edgeIn) {
if (arrSize != 0) {
boolean result = false;
for (int i = 0; i < arrSize; i++) {
if (dodObjList[i].getLabel().equals(labelIn)) {
dodObjList[i].setColor(colorIn);
dodObjList[i].setEdge(edgeIn);
result = true;
break;
}