Skip to content

Instantly share code, notes, and snippets.

View seven62's full-sized avatar

Sean Cochran seven62

  • KC
View GitHub Profile
@ritog
ritog / alacritty.toml
Created October 6, 2023 10:58
Example configuration file for Alacritty and simple guide
# $HOME/.config/alacritty/alacritty.toml
# by Rito Ghosh 2023-10-06
# Alacritty now uses TOML formatting for its config files.
# This is a simple example.
# There are the specification here: https://github.com/alacritty/alacritty/blob/master/extra/man/alacritty.5.scd
# It is not obvious how it translates to TOML. But it is extremely straightforward.
# example: WINDOW, COLORS, etc. are tables, and should be represented as [window], [colors], respectively.
@dcode
dcode / 30-ssdp-relay.sh
Created July 10, 2022 21:32
Startup script for SSDP mirroring on a UDM Pro
#!/bin/sh
# file: /mnt/data/on_boot.d/30-ssdp-relay.sh
# See https://github.com/unifi-utilities/unifios-utilities
# for info on how to setup on-boot scripts
CONTAINER="ssdp-relay"
# Specify which interfaces to relay, number is VLAN number
INTERFACES="br10 br20"
@dcode
dcode / cleanup_workstations.ps1
Created December 3, 2021 15:38
An example of an unsafe admin script that "gets the job done". DON'T DO THIS!
<#
This is an example of how to hack together a script to achieve an objective, but it's a
terrible way to do it. This script was used as a scheduled task in an exercise scenario
to make a plausible mechanism for lateral movement and privilege escalation.
- Don't store passwords in the clear
- Don't run scripts with password-based SSH
- Don't use Posh-SSH to do windows admin tasks, use PS remoting over SSH
Not only does this script store a password in the clear, it passes it to the remote systems
@dcode
dcode / local-mirrors.repo
Created January 29, 2021 16:11
Quick dirty script to maintain local repo mirrors. Serve up with httpd, nginx, or whatever
# Add this file to /etc/yum.repos.d/local-mirrors.repo
# Change the IP below accordingly
[mirror-base]
name=Base mirror
baseurl=http://192.168.100.10/base
enabled=1
cost=500
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
If you want to run a pcap through Zeek, but don't have ROCK or don't need "all the things".
# Fire up the Docker container, mapping the directory with your pcap
## If pcap in your current directory
docker run -it -v $(pwd):/pcap broplatform/bro:3.0.0 /bin/bash
## If pcap is somewhere else
docker run -it -v [directory where your pcap is]:/pcap broplatform/bro:3.0.0 /bin/bash
# If you have to build your own for some reason
# This can be skipped if the `docker run...` worked above
@dcode
dcode / _CLI_Elasticsearch_Analysis.md
Last active November 20, 2023 17:30
Analyze Elasticsearch on command line using HTTPie and jq

README

Especially when developing new query logic, it's helpful to query elasticsearch from the command line. If your Elasticsearch cluster uses SAML authentication or some other SSO, it's not simple or sometimes not even possible to query using curl directly. I wrote an auth plugin for HTTPie that should greatly simplify this process if you have rights to create API keys via the Kibana dev console (talk to your administrator and see the link below).

This process is also super handy for shell scripting because you can provide fine-grained limits of what your API key can do, making their use much safer and easier to manage than embedding native realm username/passwords.

@bradtraversy
bradtraversy / vscode_shortcuts.md
Last active May 13, 2024 14:12
Helpful shortcuts for VSCode

VSCode Shortcuts

List of helpful shortcuts for faster coding

If you have any other helpful shortcuts, feel free to add in the comments of this gist :)

Official List of all commands

@dcode
dcode / podman_pod_example.sh
Created November 19, 2018 20:55
I brute forced playing through the options of podman to try to work with pods on a standalone system using podman (i.e. without kubernetes)
# Creates new pod named `test` with `running` status with `infra` container only
sudo podman pod create --name test
# Pauses the named pod and all containers in the pod
sudo podman pod pause test
# Unpauses the named pod and all containers in the pod
sudo podman pod unpause test
# Show all pods and their status
@poeli
poeli / exfat.sh
Created April 5, 2018 21:00
exFAT support on CentOS 7
# ExFAT support on CentOS7
yum install -y http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm
yum install exfat-utils fuse-exfat
# mount disk
# $sudo fdisk -l
# $sudo mount /dev/sda1 /media/
@joshgerdes
joshgerdes / Wanhao_Cura_Profile16.ini
Last active March 31, 2022 17:01
Monoprice Maker Select Plus (Wanhao i3 Plus) Setup
[profile]
layer_height = 0.16
wall_thickness = 1.2
retraction_enable = True
solid_layer_thickness = 1.2
fill_density = 10
nozzle_size = 0.4
print_speed = 50
print_temperature = 200
print_temperature2 = 0