Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am colemanjp on github.
  • I am jcoleman (https://keybase.io/jcoleman) on keybase.
  • I have a public key whose fingerprint is 0D0B CA4D D59A 774B BD02 44B7 69F4 9F4E FF22 C12F

To claim this, I am signing this object:

@colemanjp
colemanjp / create-hotspot.md
Last active August 8, 2019 04:14 — forked from narate/create-hotspot.md
Create Wi-Fi Hotspot on Linux using nmcli

Create a Wi-Fi hotspot on Linux using nmcli

Original post : https://unix.stackexchange.com/a/310699

nmcli con add type wifi ifname wlp4s0 con-name Hostspot autoconnect yes ssid Hostspot
nmcli con modify Hostspot 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared
nmcli con modify Hostspot wifi-sec.key-mgmt wpa-psk
nmcli con modify Hostspot wifi-sec.psk "veryveryhardpassword1234"
@colemanjp
colemanjp / minemeld-sync.py
Created December 6, 2018 19:08 — forked from jtschichold/minemeld-sync.py
Utility for synchronizing a list of indicators with a MineMeld local DB Miner (Python 2.7.9+)
#!/usr/bin/env python
# Copyright 2015-present Palo Alto Networks, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@colemanjp
colemanjp / gist:ade6e52dd60b8ad74a9d
Created October 1, 2014 01:09
count unique smtp auth users
awk -F, '/sendmail.*authid=/{print $3}' maillog maillog.1 | sort -u | wc -l
788
@colemanjp
colemanjp / gist:9752bfdade300ad69d59
Last active August 29, 2015 14:05
SEC 2 patterns with single action
type=Single
ptype=RegExp
pattern=one
desc=one_matched
action=event NEED_BOP
type=Single
ptype=RegExp
pattern=two
desc=two_matched
1006 grep from=bob.erb maillog
1015 grep s7M7KPDf002853 maillog | less
1017 grep 107-1-157-130-ip-static.hfc.comcastbusiness.net maillog | less
Aug 22 03:20:25 vm-emlprdomg-03 sendmail[2852]: AUTH=server, relay=107-1-157-130-ip-static.hfc.comcastbusiness.net [107.1.157.130], authid=xxxx6, mech=LOGIN, bits=0
curl http://localhost:8080/api/add \
-X POST \
-H 'Content-Type: application/json' \
-d '{"hostname": gilda, "criticality": 1, "description": "made a change", "user": "misc", "body": "cli test"}'
$ du -hs maillog*
8.6G maillog.1
8.6G maillog.1a
$ time gzip -9 maillog.1
real 3m37.652s
user 3m28.382s
sys 0m5.502s
@colemanjp
colemanjp / gist:7156834
Last active December 26, 2015 13:09
Add custom james mailer to pps
Current pps mailers:
Msmtp, P=[IPC], F=mDFMuX, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=0,
T=DNS/RFC822/SMTP,
A=TCP $h
Mesmtp, P=[IPC], F=mDFMuXa, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=0,
T=DNS/RFC822/SMTP,
A=TCP $h
Msmtp8, P=[IPC], F=mDFMuX8, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=0,
T=DNS/RFC822/SMTP,