Skip to content

Instantly share code, notes, and snippets.

@danthegoodman1
danthegoodman1 / harmless.sh
Created Mar 9, 2021
Harmless pranks for someone's .bashrc, .bash_profile, .zshrc, etc.
View harmless.sh
alias rm="find . && rm"
alias cd="sleep 1 && cd"
alias ls="sleep 1 && ls"
export PROMPT_COMMAND="cd"
@danthegoodman1
danthegoodman1 / speed.js
Last active Jun 1, 2020
In order and In Sync (high performance) JS
View speed.js
// Immediate execution, for of with indexes, in order
const r = ["a",2,3,4,5]
const t = (i) => {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve(`hi ${i}`)
}, 1000 * i)
})
}
@danthegoodman1
danthegoodman1 / index.js
Last active Oct 2, 2019
Project 1 code snippets
View index.js
const Compute = require('@google-cloud/compute')
const compute = new Compute({
projectId: '[PROJECT NAME]',
keyFilename: './keyFile.json'
})
const zone = compute.zone('us-east1-b')
const config = {
http: true,
https: true,
@danthegoodman1
danthegoodman1 / entropy.js
Created Jul 14, 2019
Calculates shannon entropy in node.js
View entropy.js
let raw = fs.readFileSync('./wannacrydump')
// console.log(raw)
let freqList = []
console.log(`Bytes: ${raw.length}`)
const getEntropy = (bytes) => {
for (let i = 0; i < 255; i++) {
let ctr = 0
for (byte of bytes) {
@danthegoodman1
danthegoodman1 / gifFrames.py
Last active Mar 7, 2019
Exgtract RGB values of each frame from a gif
View gifFrames.py
from PIL import Image
from PIL import GifImagePlugin
im = Image.open('./tenor.gif')
im.seek(0) # changes the frame we are on
# print(im.tell()) # Tells us what frame we are on
p = im.getpalette()
conv = im.convert('RGB')
# print(conv) # converted frame to rgb
View keybase.md

Keybase proof

I hereby claim:

  • I am danthegoodman1 on github.
  • I am danthegoodman (https://keybase.io/danthegoodman) on keybase.
  • I have a public key ASDVutdzPNyzDiGJDdSDogov-kYx088M2WUwbEwTGvHbTAo

To claim this, I am signing this object:

View eggHuntTest.java
package cisc181.egghunt;
// import cisc181.egghunt.GamePiece;
// import cisc181.egghunt.eggHuntGame;
// import cisc181.egghunt.eggHuntAction;
import java.util.*;
public class eggHuntTest{
private String up = "up";
private String down = "down";
private String left = "left";
View Firebase Functions REST API boilerplate.js
const functions = require('firebase-functions');
const cors = require("cors");
const express = require("express");
const path = require("path");
const app = express();
app.use(cors({ origin:true }));
app.use('/', express.static(path.join(__dirname,'views')));
// create a directory called 'views' in the functions folder
// wisit the /widgets/ to get the index, and /widgets/otherfile.html to get the otherfile.html
View main.js
/*
Multiverse by HTML5 UP
html5up.net | @ajlkn
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
*/
(function($) {
skel.breakpoints({
xlarge: '(max-width: 1680px)',
large: '(max-width: 1280px)',
View pbon.json
{
"itemName": "pbon",
"title": "P-Bon",
"categories": ["Cellular", "USB", "BadUSB", "WiFi", "Bluetooth", "Drone"],
"subtitle": "P-Bon is a Bring-Your-Own-Network penetration testing suite which brings the power of a cellular connection, a mobile linux computer, and a plethora of physical and wireless attacks.",
"heroPic": "https://i.imgur.com/U7lXHFq.jpg",
"galleryItems": ["https://i.imgur.com/Gx6XCcD.jpg", "https://i.imgur.com/D6wmI2J.jpg", "https://youtu.be/Q4enwgQTij8"],
"video": "https://youtu.be/Q4enwgQTij8",
}