Skip to content

Instantly share code, notes, and snippets.

@haam3r
haam3r / hive_responder_api.py
Created May 21, 2019 07:25
The Hive - run Responder via API
def responder(objectId, objectType):
'''
Run responder via API
'''
post_data = {
'objectId': objectId,
'objectType': objectType,
'responderId': cfg['responderIds']['<responder_name>']
}
response = requests.post(
{% if salt['pkg.version']('ntp') %}
/etc/ntp.conf:
file.managed:
- source: salt://file/on/master.conf
{% elif salt['pkg.version']('chrony') %}
/etc/chrony.conf:
file.managed:
- source: salt://file/on/master.conf
{% else %}
chrony:
@haam3r
haam3r / jinja.sls
Created May 10, 2018 08:30
salt jinja interfaces
{% set int = salt['pillar.get']('test:int') %}
{{ salt['grains.get']('ip4_interfaces:' ~ int, grains.ip4_interfaces.ens160) | first }}
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew tap caskroom/cask
brew cask install atom
brew cask install caffeine
brew cask install keeweb
brew cask install mattermost
brew cask install skype
brew cask install spotify
brew cask install sublime-text
brew cask install thunderbird
sc.exe sdset $ServiceName D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;IU)(A;;CCLCSWLOCRRC;;;SU)S:(AU;FA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;WD)"
@haam3r
haam3r / jdk_download.sh
Created February 2, 2018 08:36 — forked from P7h/jdk_download.sh
Script to download JDK / JRE / Java binaries from Oracle website from terminal / shell / command line / command prompt
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### #####
### Shell script to download Oracle JDK / JRE / Java binaries from Oracle website using terminal / command / shell prompt using wget.
### You can download all the binaries one-shot by just giving the BASE_URL.
### Script might be useful if you need Oracle JDK on Amazon EC2 env.
### Script is updated for every JDK release.
### Features:-
# 1. Resumes a broken / interrupted [previous] download, if any.
# 2. Renames the file to a proper name with including platform info.
@haam3r
haam3r / vaibad.py
Last active December 4, 2017 19:19
Vaiba pikkuste arvutamine
def lõimede_pikkus(vaiba_lõpp_pikkus, lõimede_arv):
return (round(lõimede_arv * (vaiba_lõpp_pikkus * 1.2 + 0.5), 2))
failinimi = input("Sisestage failinimi: ")
lõimede_arv1 = int(input("Sisestage 5-meetriste ja pikemate vaipade lõimede arv: "))
lõimede_arv2 = int(input("Sisestage lühemate vaipade lõimede arv: "))
vaiba_lõpp_pikkus = []
fail = open(failinimi, encoding="UTF-8")
@haam3r
haam3r / influxdb.py
Created November 24, 2017 11:22
salt.modules.influxdb passing client_args
# Passing in this:
return influxdb.InfluxDBClient(host=host,
port=port,
username=user,
password=password,
**client_args)
# Gives me this:
# Passed invalid arguments: __init__() got an unexpected keyword argument '__pub_pid'.
@haam3r
haam3r / salt_file_write.sls
Created November 9, 2017 20:41
using salt.function file.write
name:
salt.function:
- name: file.write
- tgt: 'salt.master.here'
@haam3r
haam3r / salt-minion_restart.sls
Created September 26, 2017 14:34
Restart salt-minion in a state without breaking the state run.
restart_minion:
cmd.run:
- name: |
exec 0>&-
exec 1>&-
exec 2>&-
nohup /bin/sh -c 'sleep 10 && salt-call --local service.restart salt-minion' &
- order: last