Skip to content

Instantly share code, notes, and snippets.

@0ccupi3R
0ccupi3R / ansible-summary.md
Created October 27, 2022 05:14 — forked from DarkPanth3r/ansible-summary.md
This is an ANSIBLE Cheat Sheet from Jon Warbrick

Ansible Summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@0ccupi3R
0ccupi3R / aws_ssm_get_parameter.md
Created October 10, 2022 00:42 — forked from ruanbekker/aws_ssm_get_parameter.md
Getting Secrets from SSM using GetParameter Example with Python and Boto3

Bash Environment Example with SSM to get Parameter Values using GetParameter:

IAM Policy:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "Stmt1517398919242",
@0ccupi3R
0ccupi3R / OneLogin.py
Created May 20, 2022 19:45 — forked from foxwill/OneLogin.py
to create token object and use with the Users OAUTH api endpoint
import requests
class OneLogin(object):
def __init__(self, shard='US'):
"""
Specify the shard of the system being used (us or eu)
:param shard: us or eu
:return:
"""
@0ccupi3R
0ccupi3R / Dockerfile
Created May 14, 2022 22:38 — forked from twang2218/Dockerfile
Docker cron example
FROM python:3.5.2
ENV TZ=Asia/Shanghai
RUN apt-get update \
&& apt-get install -y cron \
&& apt-get autoremove -y
COPY ./cronpy /etc/cron.d/cronpy
CMD ["cron", "-f"]
@0ccupi3R
0ccupi3R / list-of-hacking-games.md
Created June 19, 2021 20:18 — forked from fakhrullah/list-of-hacking-games.md
List of hacking game, wargame or capture the flag (CTF) for some one who want to learn hacking.
pass='YOURPASSWORD'
for host in `cat ips`
do
sshpass -p $pass ssh -o ConnectTimeout=1 -o StrictHostKeyChecking=no -o GSSAPIAuthentication=no root@$host "hostname"
done
### Using encoding to escape Shoulder Surfing ;)
vim tempfile
#In the file write your password
cat tempfile | openssl enc -base64
@0ccupi3R
0ccupi3R / elasticsearch-docker-script
Created April 9, 2021 13:28 — forked from mschoch/elasticsearch-docker-script
A script to fix ownership of Elasticsearch data directory (when mounted as a volume in docker), then switch to elasticsearch user and launch elasticsearch
#!/bin/sh
# fix permissions (wrong if docker mounted volume)
chown -R elasticsearch:elasticsearch /var/lib/elasticsearch
# now switch to elasticsearch user and run in foreground
echo Starting: /usr/share/elasticsearch/bin/elasticsearch -Des.default.config=$CONF_FILE -Des.default.path.home=/usr/share/elasticsearch -Des.default.path.logs=$LOG_DIR -Des.default.path.data=/var/lib/elasticsearch -Des.default.path.work=/tmp/elasticsearch -Des.default.path.conf=$CONF_DIR $@
su elasticsearch -s /bin/sh -c "/usr/share/elasticsearch/bin/elasticsearch -Des.default.config=$CONF_FILE -Des.default.path.home=/usr/share/elasticsearch -Des.default.path.logs=$LOG_DIR -Des.default.path.data=/var/lib/elasticsearch -Des.default.path.work=/tmp/elasticsearch -Des.default.path.conf=$CONF_DIR $@"
@0ccupi3R
0ccupi3R / criticalprocess.json
Created October 27, 2020 16:06 — forked from MHaggis/criticalprocess.json
Tune as you see fit for your environment
{
"Powershell": {
"process_name": ["powershell.exe"]
},
"PSExec": {
"process_name": ["psexec*.exe",
"psexesvc.exe"]
},
"at": {
"process_name": ["at.exe"]
input {
file {
path => "/var/log/nginx/access.log"
type => "nginx-access"
sincedb_path => "/var/log/.nginxaccesssincedb"
}
}
input {
file {
path => "/var/log/nginx/error.log"
@0ccupi3R
0ccupi3R / 001-elksetup.sh
Created December 28, 2019 15:07 — forked from zebde/001-elksetup.sh
ELK Setup Script
#!/bin/bash
# ---------------------------------------------------------------------------
# elksetup.sh - Ubuntu 14.04 based ELK installation script
# Copyright 2015, https://github.com/zebde
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or