On receiving NAS:
setcfg LOGIN "SSH AllowTcpForwarding" TRUE
reboot
On client to forward local port 8443 to the QNAP admin interface:
ssh user@host -L 8443:localhost:443
:root { | |
--min-item-width: 28ch; | |
--max-item-width: .5fr; | |
--grid-spacing: .25rem; | |
--item-padding: .25rem; | |
} | |
/* Let items expand on small screens */ | |
@media (max-width: 600px) { | |
:root { |
#! /usr/bin/env python3 | |
''' | |
Needs Requests (pip3 install requests) | |
Author: Marcello Salvati, Twitter: @byt3bl33d3r | |
License: DWTFUWANTWTL (Do What Ever the Fuck You Want With This License) | |
This should allow you to detect if something is potentially exploitable to the log4j 0day dropped on December 9th 2021. |
# these can all be npm scripts, but anything can be an npm script | |
# a | |
echo $(cat ./package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]') | |
# b | |
echo $(cat ./package.json | grep version | head -1 | awk -F= "{ print $2 }" | sed -E 's/(version)|[:,\",]//g' | tr -d '[[:space:]]') | |
# c | |
echo $(node --eval="process.stdout.write(require('./package.json').version)") |
### Cloudwatch Events ### | |
# Event rule: Runs at 8pm during working days | |
resource "aws_cloudwatch_event_rule" "start_instances_event_rule" { | |
name = "start_instances_event_rule" | |
description = "Starts stopped EC2 instances" | |
schedule_expression = "cron(0 8 ? * MON-FRI *)" | |
depends_on = ["aws_lambda_function.ec2_start_scheduler_lambda"] | |
} | |
# Runs at 8am during working days |
# this assumes your using oh-my-zsh for maximum zsh-ness | |
# info and defaults are here: | |
# https://github.com/robbyrussell/oh-my-zsh/blob/master/templates/zshrc.zsh-template | |
export LC_ALL="en_US.UTF-8" | |
export ZSH=/Users/bret/.oh-my-zsh | |
# custom prompt theme | |
ZSH_THEME="present" # mine is present, default is robbyrussell, also agnoster, fishy, ys, wild-cherry | |
COMPLETION_WAITING_DOTS="true" |
On receiving NAS:
setcfg LOGIN "SSH AllowTcpForwarding" TRUE
reboot
On client to forward local port 8443 to the QNAP admin interface:
ssh user@host -L 8443:localhost:443
# Log the X-Forwarded-For client IP address or the real client ip address if the X-Forwarded-For header does not exist. | |
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined | |
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy | |
SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded | |
CustomLog "logs/access_log" combined env=!forwarded | |
CustomLog "logs/access_log" proxy env=forwarded |
# problem: when presenting, I want to obscure | |
# my prompt to act like it's at root of file system | |
# and be very basic with no git info, etc. | |
# solution: this theme lets you set a ENV to the path | |
# of your presentation, which will help remove unneeded prompt | |
# features while in that path | |
# oh-my-zsh theme for presenting demos | |
# based off the default rubbyrussell theme |
#!/bin/bash | |
compose_file_path=$1 | |
project_name=$2 | |
backup_path=$3 | |
function backup_volume { | |
volume_name=$1 | |
backup_destination=$2 |
print("UPDATE AUG 2023: this script is beyond old and broken") | |
print("You may find interesting and more up to date resources in the comments of the gist") | |
exit() | |
from slacker import Slacker | |
import json | |
import argparse | |
import os | |
# This script finds all channels, private channels and direct messages |