Skip to content

Instantly share code, notes, and snippets.

View grimley517's full-sized avatar

Brian Jones grimley517

View GitHub Profile
@grimley517
grimley517 / BitburnerHacknetMgr.js
Last active November 30, 2023 15:33
Bitburner Hacknet Build automation
/** @param {NS} ns **/
export async function main(ns) {
var paybackLimit = 24 * 60 * 60;
var sleepMilliseconds = 5 * 1000;
var budgetPercentage = 0.5;
while (true) {
var budget = ns.getServerMoneyAvailable('home');
budget *= budgetPercentage; //Don't want to spend all money on hacknet, allow 33% but change this if wanted
var nodeNumber = ns.hacknet.numNodes();
@grimley517
grimley517 / GetAppPoolsAndCredentials.ps1
Created January 13, 2022 11:19
Get User Credentials used for App Pools
$appPools = Get-WebConfiguration -Filter '/system.applicationHost/applicationPools/add'
foreach($appPool in $appPools)
{
Write-Host $appPool.Name " => userName:"$appPool.ProcessModel.UserName" => Password "$appPool.ProcessModel.Password
}
@grimley517
grimley517 / HomeClass.cs
Created August 18, 2017 15:05
HomeClass.cs
namespace Module
{
public class Module
{
IData data {get; set;}
public Module()
{
data = DataFactory.Create();
}
namespace Module.Data
{
public class DataFactory
{
private static IData data;
static IData Create(IData datasubstitute = null)
{
if (datasubstitute != null)
{
@grimley517
grimley517 / unittestoutline
Last active November 2, 2016 14:08
unittest outline
import task1.py
import unittest
class TestSequenceFunctions(unittest.TestCase):
def test1(self):
pass
if __name__ == '__main__':
// Objective-C methods for Base64 conversion between NSString and NSData.
// Note: these do not support trailing '=' characters.
// License: Public Domain
// Author: Leonard van Driel, 2012
static unsigned char toBase64String[65] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
static unsigned char toBase64Data[256] = {
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,