Skip to content

Instantly share code, notes, and snippets.

@Zenexer
Zenexer / cloner.js
Last active December 19, 2015 07:09
(function(context, attachPrototype) {
// obj: Object or scalar to clone. Accepts any value or lack thereof. Technically optional.
// deep: Whether to perform a deep clone. Defaults to false (shallow clone). Optional.
// deepFunctions: Whether to clone functions when deep cloning. Unless you are doing some fancy voodoo,
// this should remain at the default of false, as these often represent types. Don't
// mess with this unless you understand the consequences of cloning a type complete
// in-tact, which is almost never what you want to do. Optional.
//
// NOTE: This will fail to clone properties created using ECMA 5's Object.defineProperty function. Provided
// that defineProperty is used with adequate discretion, this should not become an issue. However, if
@Zenexer
Zenexer / lscron
Last active December 20, 2015 01:18
List all cronjobs on system.
#!/bin/bash
for user in $(cut -f1 -d: /etc/passwd); do
CRONTAB="$(sudo crontab -u "$user" -l 2> /dev/null | sed '/^[[:space:]]*#/d; /^[[:space:]]*$/d')"
if (( $? )) || [ -z "$CRONTAB" ]; then
continue
fi
echo "# CRONTAB FOR: $user"
# Moved: https://github.com/Zenexer/passgen
@Zenexer
Zenexer / shadowbrokers.aREADME.md
Last active April 15, 2017 07:24
Technical observations from the Shadow Brokers leak

What is this?

These are portions of JSON responses from Yandex while browsing the latest Shadow Brokers leak. They include information about the uploads that isn't necessarily visible or easy to access from the web interface.

Observations

  1. The leak was released shortly after a Patch Tuesday and at the start of a holiday weekend.
  2. Uploader's account name: yurishitova
    1. The account doesn't show up anywhere else; it was likely created specifically for this purpose.
  3. My guess is that the name can be broken up into two words:
#!/bin/sh
set -e
backup() {
if exists "$1"; then
cp -dp "$1" "$2" || return $?
fi
return 0
}
@Zenexer
Zenexer / config.yml
Last active February 15, 2018 02:57
Banned items for Earth2Me Tekkit server.
# Configuration for ForgePlugin.
---
# General settings.
# Note: At optimal performance levels, there are 20 ticks per second.
settings:
# After a chunk is loaded, it will be re-checked to ensure that it should be remain loaded. Specify the number of
# minutes (ticks-per-second-dependent) before that check occurs. Negative to disable (default).
recheck-delay: 3
@Zenexer
Zenexer / Parsec vuln 140-1 CSRF.md
Last active February 15, 2018 02:58
Parsec CSRF vulnerability in version 140-1 and prior
#!/bin/bash
if [ $# -lt 1 ]; then
echo "Syntax: $_ USER[ USER[ ...]]" >&2
exit 1
fi
exit_code=0
for user in "$@"; do
home="/home/$user"
// Compile with -std=c11
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include <inttypes.h>
#include <string.h>
#include <limits.h>
#define MAX_STR_LEN 4095
@Zenexer
Zenexer / Firefox config.txt
Last active February 25, 2020 00:21
Fix Firefox's smooth scrolling to have the same snappy feel as Chrome, as well as some other tweaks.
# Apply these in about:config.
# Fix Firefox's smooth scrolling to have the same snappy feel as Chrome
general.smoothScroll.mouseWheel.durationMaxMS = 200
general.smoothScroll.mouseWheel.durationMinMS = 100
# Disable Pocket
extensions.pocket.enabled = false
# Enable ESNI and DoH