Skip to content

Instantly share code, notes, and snippets.

sudo tee /etc/apt/sources.list.d/ddebs.list << EOF
deb http://ddebs.ubuntu.com/ ${codename} main restricted universe multiverse
#deb http://ddebs.ubuntu.com/ ${codename}-security main restricted universe multiverse
deb http://ddebs.ubuntu.com/ ${codename}-updates main restricted universe multiverse
deb http://ddebs.ubuntu.com/ ${codename}-proposed main restricted universe multiverse
EOF
sudo apt-get install linux-image-$(uname -r)-dbgsym
wget https://raw.githubusercontent.com/cuckoosandbox/cuckoo/master/stuff/systemtap/expand_execve_envp.patch
TASK [ANXS.postgresql : PostgreSQL | Make sure the PostgreSQL users are present] ***************************************************************************************************************************
2019-06-19T01:07:13.965953 (delta: 4.627564) elapsed: 314.707469 ******
fatal: [brain.irma]: FAILED! => {"msg": "Failed to set permissions on the temporary files Ansible needs to create when becoming an unprivileged user (rc: 1, err: chown: changing ownership of '/tmp/ansible-tmp-1560906434.22-26962963142885/': Operation not permitted\nchown: changing ownership of '/tmp/ansible-tmp-1560906434.22-26962963142885/postgresql_user.py': Operation not permitted\n}). For information on working around this, see https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user"}
@mshirley
mshirley / dns_server.py
Created June 9, 2018 00:13 — forked from samuelcolvin/dns_server.py
requires python 3.5+ and dnslib, see https://github.com/samuelcolvin/dnserver for full/better implementation
from datetime import datetime
from time import sleep
from dnslib import DNSLabel, QTYPE, RD, RR
from dnslib import A, AAAA, CNAME, MX, NS, SOA, TXT
from dnslib.server import DNSServer
EPOCH = datetime(1970, 1, 1)
SERIAL = int((datetime.utcnow() - EPOCH).total_seconds())
@mshirley
mshirley / SimpleThugAPIDemo.py
Created February 11, 2016 23:01 — forked from reachtarunhere/SimpleThugAPIDemo.py
A dead simple demo of Thug API based on thug.py file in thug
import logging
from ThugAPI import ThugAPI
log = logging.getLogger("Thug")
class Thug(ThugAPI):
def __init__(self, args):
ThugAPI.__init__(self, args)
def analyze(self):
self.log_init('http://google.com')
self.run_remote('http://google.com')
@mshirley
mshirley / schedulers.py
Created February 3, 2016 04:52 — forked from brolewis/schedulers.py
A distributed job scheduler for Celery using ZooKeeper (via kazoo) to manage the locking.
'''Zookeeper-based Scheduler'''
## Standard Library
import cPickle # Store dictionary in ZooKeeper
import datetime # Time delta
import socket # Hostname
## Third Party
import celery # Current app
import celery.beat # Scheduler
import celery.utils.log # Get logger
import kazoo.client # ZooKeeper Client Library
rsyslog:
pkgrepo.managed:
{% if grains['os_family'] == 'RedHat' %}
- humanname: rsyslog
- baseurl: http://rpms.adiscon.com/v8-stable/epel-$releasever/$basearch
- gpgcheck: 0
{% elif grains['os_family'] == 'Debian' %}
- ppa: adiscon/v8-stable
{% endif %}
# pillar/top.sls
base:
'*':
- pkg_files
# pillar/pkg_files/init.sls
pkg_files:
{% if grains['os_family'] == 'RedHat' %}
kafka: salt://kafka/files/kafka-0.8.2.1-1.x86_64.rpm
#{% elif grains['os_family'] == 'Debian' %}
@mshirley
mshirley / gist:6bb178826b83e04199b8
Created March 28, 2015 01:07
elasticsearch-hadoop elasticsearch errors
[2015-03-27 20:55:55,304][INFO ][node ] [Grotesk] version[1.4.0], pid[2215], build[bc94bd8/2014-11-05T14:26:12Z]
[2015-03-27 20:55:55,304][INFO ][node ] [Grotesk] initializing ...
[2015-03-27 20:55:55,309][INFO ][plugins ] [Grotesk] loaded [], sites []
[2015-03-27 20:55:58,820][INFO ][node ] [Grotesk] initialized
[2015-03-27 20:55:58,820][INFO ][node ] [Grotesk] starting ...
[2015-03-27 20:55:59,000][INFO ][transport ] [Grotesk] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/192.168.122.235:9300]}
[2015-03-27 20:55:59,023][INFO ][discovery ] [Grotesk] elasticsearch/LqqiMzLcQAuBISXvr7FspA
[2015-03-27 20:56:02,812][INFO ][cluster.service ] [Grotesk] new_master [Grotesk][LqqiMzLcQAuBISXvr7FspA][localhost.localdomain][inet[/192.168.122.235:9300]], reason: zen-disco-join (elected_as_master)
[2015-03-27 20:56:02,838][INFO ][http ] [Grotesk]
@mshirley
mshirley / gist:efb3f8f038d34b6dbaa7
Last active August 29, 2015 14:17
elasticsearch-hadoop spark-shell error
[root@localhost bin]# SPARK_DAEMON_JAVA_OPTS="-Dlog4j.configuration=../conf/log4j.properties" ./spark-shell --jars elasticsearch-hadoop-2.1.0.BUILD-20150324.023417-341.jar
15/03/27 21:17:59 INFO SecurityManager: Changing view acls to: root
15/03/27 21:17:59 INFO SecurityManager: Changing modify acls to: root
15/03/27 21:17:59 INFO SecurityManager: SecurityManager: authentication disabled; ui acls disabled; users with view permissions: Set(root); users with modify permissions: Set(root)
15/03/27 21:17:59 INFO HttpServer: Starting HTTP Server
15/03/27 21:18:00 DEBUG HttpServer: HttpServer is not using security
15/03/27 21:18:00 INFO Utils: Successfully started service 'HTTP class server' on port 44365.
15/03/27 21:18:03 DEBUG SparkILoop: Clearing 6 thunks.
Welcome to
____ __
@mshirley
mshirley / gist:88e5b0b94be38b3e1d77
Last active August 29, 2015 14:17
elasticsearch-hadoop installation and testing
# install java
yum install -y java-1.7.0 wget
export JAVA_HOME=/usr/lib/jvm/jre-1.7.0-openjdk.x86_64
# install hadoop
wget http://www.motorlogy.com/apache/hadoop/common/current/hadoop-2.6.0.tar.gz
tar fvxz hadoop-2.6.0.tar.gz
export HADOOP_PREFIX=~/hadoop-2.6.0
echo "<configuration><property><name>fs.defaultFS</name><value>hdfs://localhost:9000</value></property></configuration>" > ~/hadoop-2.6.0/etc/hadoop/core-site.xml
echo "<configuration><property><name>dfs.replication</name><value>1</value></property></configuration>" > ~/hadoop-2.6.0/etc/hadoop/hdfs-site.xml