Skip to content

Instantly share code, notes, and snippets.

@jpeckham
jpeckham / hack.js
Created October 31, 2023 02:27
BitBurner hack script
/** @param {NS} ns */
/****
runs on any server to hack every server.
weakens until they are minimum security
for a long time all you'll do is weaken but once they're all weakened it will hack/grow
****/
export async function main(ns) {
while (true) {
let hostName = ns.getHostname();
let servers = scan(ns,ns.getHostname(),[hostName]);
@jpeckham
jpeckham / worm.js
Created October 31, 2023 02:25
BitBurner Worm to implant a hack on every server max threads
/** @param {NS} ns **/
/*
Inspired by https://www.reddit.com/user/pwillia7/
but i wanted to use my own hack script and i didn't want to pass args
https://www.reddit.com/r/Bitburner/comments/rjkn4q/improved_hack_all_servers_script/
*/
export async function main(ns) {
//if no arguments provided tell the user how to use script.
ns.toast('Running worm on ' + ns.getHostname());
$url = "https://your devops url"
$username = "yourname@company.com"
$password = "access token"
# Retrieve list of all repositories
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $username,$password)))
$headers = @{
"Authorization" = ("Basic {0}" -f $base64AuthInfo)
"Accept" = "application/json"
}
@jpeckham
jpeckham / delete_unused_versions.py
Created October 1, 2019 19:43
delete unused versions in jira
from jira import JIRA
import secrets
import urllib3
import requests
urllib3.disable_warnings() # deleting warnings about ssl. i'm local and can check before i run this, so i don't care.
# By default, the client will connect to a JIRA instance started from the Atlassian Plugin SDK
# (see https://developer.atlassian.com/display/DOCS/Installing+the+Atlassian+Plugin+SDK for details).
# Override this with the options parameter.
@jpeckham
jpeckham / redditClient.js
Last active July 25, 2023 06:55
login to the reddit api and use a bearer token
/*
from quickstart https://github.com/reddit-archive/reddit/wiki/OAuth2-Quick-Start-Example
*/
const axios = require('axios')
const qs = require('querystring');
const main = async function () {
using System;
using System.Collections.Concurrent;
using System.Text;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using System.Timers;
using Confluent.Kafka;
using Confluent.Kafka.Serialization;
using Newtonsoft.Json;
@jpeckham
jpeckham / TaskRun.cs
Created April 17, 2018 01:33
TPL Task.Run example
using System;
using System.Threading;
using System.Threading.Tasks;
namespace AsyncAwaitStuff
{
class Program
{
static void Main(string[] args)
{
@jpeckham
jpeckham / IllustrateContinueWith.cs
Last active April 17, 2018 01:16
Illustrate use of TPL ContinueWith()
using System;
using System.Threading;
using System.Threading.Tasks;
public class Example
{
public static void Main()
{
// Execute the antecedent.
Task<string> taskA = Task.Run(() =>
@jpeckham
jpeckham / gist:c276f81ffc923eded5db72a5fb11eb8d
Last active February 11, 2018 18:04
using Tweetinvi to stream a topic
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using Amazon;
using Amazon.KinesisFirehose;
using Amazon.KinesisFirehose.Model;
using Amazon.Runtime.CredentialManagement;
using Amazon.SQS;
using Amazon.SQS.Model;