Skip to content

Instantly share code, notes, and snippets.

View marcinantkiewicz's full-sized avatar

Marcin Antkiewicz marcinantkiewicz

View GitHub Profile
auto bond0
iface bond0 inet static
address 10.1.10.1
netmask 255.255.255.0
hwaddress ether aa:aa:aa:aa:aa:aa # else mac can float based on what's bonded
post-up ifenslave bond0 eth1 eth2 eth3 eth4 eth5
# to verify/monitor
cat /proc/net/bonding/bond0
function msa_scan_arp () {
## Discover hosts on a /24 that respond to arp requests.
# Write information about hosts that responded to a file.
#
# ex: msa_resolve_arp 192.168.1 arp-scan.txt
# yep, this is an ugly hack
# arping -w should provide a qicker timeout for IPs that do not respond, but it works in a way I do not seem to understand.
NET=$1; shift;
FILENAME=$1; shift
@marcinantkiewicz
marcinantkiewicz / Bluetooth_references.md
Last active June 14, 2018 10:15
Resources for bluetooth monitoring (ubertooth)
@marcinantkiewicz
marcinantkiewicz / unifi system setup
Last active June 8, 2018 06:03
Notes - setup of unifi controller in docker
USG and UAP - security gateway and access ponit adoption/initial config
- devices want to live on 192.168.1 network.
- IP address can be set through the controller, in the Networks tab, or using CLI (configure, set interfaces ethernet eth1 address 10.10.10.1/24, delete interfaces ethernet eth1 address 192.168.1.1/24,
commit)
- the DNS name used in the Controller tab must resolve to the right IP, else succesful adoption will requie login to the device and "mca-cli, set-inform http://controller-IP-or-resolving-fqdn):8080/inform
Controller setup:
-- runs fine in docker
-- cloud key is convenient, but it was flakey for me. This is not expected, people have good luck with them.
@marcinantkiewicz
marcinantkiewicz / README.md
Created September 12, 2018 15:25 — forked from joyrexus/README.md
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")

Note, a lot of content here is from SIRA lists/posts. If you are interested in the topic, please join SIRA.

TODO

  • Group items in a sane way.
  • The papers probably should be listed in a quotable format of some standard. Same with books?
  • This list grew a bit big, probably should be split into separate lists per category. I started listing by person, but it probably makes no sense.
  • The books and podcasts are the only lists that I think are substantial. The rest is not even stubs.

Books

Some of the books are available used on Ebay, for a fraction of the Amazon price.

//will miss cookies with httpOnly attribute set
function printCookie(match){
var cookies = document.cookie.split(";");
var cookie = {};
for (var i=0; i<cookies.length; i++){
header = cookies[i].trim();
marker = header.indexOf("=");
name = header.substr(0,marker);
value = header.substr(marker+1);
@marcinantkiewicz
marcinantkiewicz / 99-redirect-to-unifi.conf
Created February 18, 2021 17:29
lighttpd: redirect default ports to the unifi controller
# tls has to be enabled on :443 so that the connection can be terminated there before the redirect is sent back.
$SERVER["socket"] == ":80" {
$HTTP["host"] =~ ".*" {
url.redirect = (""=>"https://%0:8443/manage/site/default/dashboard")
}
}
$SERVER["socket"] == ":443" {
$HTTP["host"] =~ ".*" {
def get_detects():
# other parameters: for pagination: limit (max on page) and offset, and for ordering: sort. I want detections from last 5min.
parameters = {"filter":"last_behavior:>'now-5m'"}
d = detects.Detects(creds={ 'client_id': cid,'client_secret': key})
response = d.QueryDetects(parameters)
if response:
if response['body']['meta']['pagination']['total'] > 0:
return response['body']['resources']
else:
// userscript parts to pause playback in all open tabs, save for the current one.
// handles http video and audio tags, this will pause what is playing.
// Swap pause() to play() to reverse. Other controls:
// .volume (goes on interval from 0-1.0)
// .muted (bool)
['video','audio'].forEach((tag)=>{
player = document.getElementsByTagName(tag)
if(!![...player].find((e)=>e && !(e.paused && e.ended && e.muted))){