This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### General PFCTL Commands #### | |
$ pfctl -d disable # packet-filtering | |
$ pfctl -e enable # packet-filtering | |
$ pfctl -q # run quiet | |
$ pfctl -v -v # run even more verbose | |
#### Loading PF Rules #### | |
$ pfctl -f /etc/pf.conf # load /etc/pf.conf | |
$ pfctl -n -f /etc/pf.conf # parse /etc/pf.conf, but dont load it | |
$ pfctl -R -f /etc/pf.conf # load only the FILTER rules | |
$ pfctl -N -f /etc/pf.conf # load only the NAT rules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I used this handy one-liner to search ip ranges while looking up its PTR record. | |
The PTR record will have the string "stretchoid". This process took about an hour. | |
for N in {128..255}; do echo "Testing 192.241.$N.0 - 192.241.$N.255" >> stretchoid_ips.txt; for L in {0..255}; do host -t PTR "192.241.$N.$L" | grep -qF 'stretchoid.com.' && echo "192.241.$N.$L `host -t PTR \"192.241.$N.$L\"`" >> stretchoid_ips.txt; done; done | |
Credit goes to sissy for the idea: | |
https://forum.netgate.com/topic/169024/stretchoid-com-ip-list-for-use-in-blocking-their-port-scans?_=1671484145965&lang=en-US | |
I then opened up the text file in notepad++ and did a regular expressions Search/Replace (CTRL+H) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
agent_publickey = 3059301306072a8648ce3d020106082a8648ce3d03010703420004f2b81b1902a771c8c24f09c6bd8be647d33bd139269856418a42c5a78343d943a03ac2173529a816f797a803563de6ecdd25572ce09af8c081c02303bac0c4d3 | |
agent_publickey_hash = 525f76180e55012341ffe12bcfb5587adad1b920 | |
agent_publickey_hash_result = not found | |
agent_publickey_hash_type = web:ecdsa | |
agent_type = browser_computer | |
alert_id = 9598 | |
api_call_datetime = 2019-12-16 15:24:42.595 | |
api_key = fioxxxxxxxxxx370 | |
api_site_id = api101.qa2.sac. | |
api_type = session-query |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from shodan import Shodan | |
api = Shodan('API-KEY') | |
results = api.search('org:"Threat Metrix" port:443 Bad Request') | |
for banner in results['matches']: | |
# Only care about services that use SSL | |
if 'ssl' in banner: | |
print(banner['ssl']['cert']['subject']['CN']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add a new user to the www-data group | |
In this example, add a new user called vivek to the www-data group, enter: | |
sudo useradd -g www-data vivek | |
### set the password for vivek user ### | |
sudo passwd vivek | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# *----------------------------------------------------------------- | |
# | PROGRAM NAME: ex bank marketing predictive model.py | |
# | DATE: 5/1/20 | |
# | CREATED BY: MATT BOGARD | |
# | PROJECT FILE: | |
# *---------------------------------------------------------------- | |
# | PURPOSE: basic example of predictive modeling, evaluation, and scoring | |
# *---------------------------------------------------------------- | |
# Import numpy and pandas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# *----------------------------------------------------------------- | |
# | PROGRAM NAME: ex VAR.py | |
# | DATE: 2/23/21 | |
# | CREATED BY: MATT BOGARD | |
# | PROJECT FILE: | |
# *---------------------------------------------------------------- | |
# | PURPOSE: source: https://www.machinelearningplus.com/time-series/vector-autoregression-examples-python/ | |
# *---------------------------------------------------------------- | |
# see also my blog post: http://econometricsense.blogspot.com/2011/05/vector-autoregressions-and-bayesian.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################################################ | |
# name: barplot-03.py | |
# desc: Simple bar plot with options | |
# date: 2018-07-02 | |
# Author: conquistadorjd | |
# Documentation : https://matplotlib.org/api/_as_gen/matplotlib.pyplot.bar.html#matplotlib.pyplot.bar | |
################################################################################################ | |
from matplotlib import pyplot as plt | |
import numpy as np |
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 6.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"symbol","series","date","prevclose","open","high","low","last","close","vwap","volume","turnover","nooftrades","deliverableqty","percentdelivery","insert_timestamp" | |
"TCS ","EQ ","2018-07-27",1964.70,1960.85,1964.65,1940.30,1943.75,1943.75,1948.53,2033977,3963271946.50,103516,1389322,68.31,"2018-07-28 19:27:19.008727" | |
"INFY ","EQ ","2018-07-27",1373.25,1373.20,1389.00,1368.30,1371.20,1373.45,1377.08,3246616,4470848815.00,101649,2173390,66.94,"2018-07-28 19:27:19.008727" | |
"KOTAKBANK ","EQ ","2018-07-27",1311.25,1313.05,1327.00,1305.65,1312.90,1311.10,1316.74,1885821,2483145144.90,73950,944774,50.10,"2018-07-28 19:27:19.008727" | |
"RELIANCE ","EQ ","2018-07-27",1110.65,1119.50,1137.40,1112.15,1128.00,1129.85,1127.43,6679468,7530602219.35,140124,2217077,33.19,"2018-07-28 19:27:19.008727" | |
"KOTAKBANK ","EQ ","2018-07-26",1314.90,1311.65,1322.50,1294.35,1310.55,1311.25,1307.55,3664497,4791512541.15,76422,1433092,39.11,"2018 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################################################ | |
# name: convert_daily_to_monthly.py | |
# desc: takes inout as daily prices and convert into monthly data | |
# date: 2018-06-15 | |
# Author: conquistadorjd | |
################################################################################################ | |
import pandas as pd | |
import numpy as np | |
print('*** Program Started ***') |
NewerOlder