Headless reinstall and update https://raspberrypi.stackexchange.com/a/57023
- create a text file in /boot/ called ssh
| # With this two lines of bash you will donwload the last malware samples extracted from the public lists of www.malwaredomainlist.com | |
| # and you'll submit automatically the alive samples (check if the response was an executable or not) to totalhash.com (contribute to | |
| # the community) and obtain the detection rate of the sample # from Virus Total (virustotal.com). | |
| # As a result you'll get a bunch of executable files and their detection rate in the log "output.virustotal.txt" | |
| # Download all the samples detected and listed in the public CSV of mdl.com | |
| $ curl -s http://www.malwaredomainlist.com/mdlcsv.php | awk 'BEGIN {FS="\",\""} {print $2}' | strings -n 3 | grep -E "\.exe$|\.so$|\.bin$|\.src$|\.pdf$|\.docx$|\.vb$|\.sh$" | xargs -I% bash -c 'echo "Downloading: %" && curl -s -O %' | tee $(date +%Y%m%d_%H%M)_malware_download.log | |
| # Upload the downloaded samples to totalhash.com and query virustotal.com with it MD5 checksum to obtain the detection ratio | |
| $ ls *_malware_download.log -ltr | tail -n1 | cat $(awk '{pr |
| BASEURL=http://username:[email protected]:3000 | |
| for dash in $(curl -s -k "${BASEURL}/api/search" | jq -r '.[].title'); do | |
| curl -k "${BASEURL}/api/dashboards/db/${dash}" > "${dash}.json" | |
| done |
| #!/bin/bash | |
| ./run.sh "${@}" & | |
| timeout 10 bash -c "until </dev/tcp/localhost/3000; do sleep 1; done" | |
| curl -s -H "Content-Type: application/json" \ | |
| -XPOST http://admin:admin@localhost:3000/api/datasources \ | |
| -d @- <<EOF | |
| { | |
| "name": "influx", |
Headless reinstall and update https://raspberrypi.stackexchange.com/a/57023
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "github.com/godbus/dbus" | |
| ) | |
| // dbus-monitor --system "type='signal',sender='org.freedesktop.NetworkManager',interface='org.freedesktop.NetworkManager'" |
| #!/usr/bin/env python | |
| import dbus | |
| NM = 'org.freedesktop.NetworkManager' | |
| NMCA = NM + '.Connection.Active' | |
| NMDW = NM + '.Device.Wireless' | |
| NMAP = NM + '.AccessPoint' | |
| DBUS_PROPS = 'org.freedesktop.DBus.Properties' |
| const LEDS = [LED1,LED2,LED3]; | |
| const onBtnClick = | |
| (fn)=> setWatch(fn, BTN, {edge:"rising", debounce:50, repeat:true}); | |
| const turnOn = (el) => { | |
| el.write(true); | |
| }; | |
| const turnOff = (el) => { |
Thanks a lot to mredbishop and others for their insturctions posted here. This is just a recap of what they figured out.
This process was tested on WSL Ubuntu 18.04.
| <# | |
| References: | |
| - https://docs.microsoft.com/en-us/dotnet/api/system.net.websockets.clientwebsocket?view=netframework-4.5 | |
| - https://github.com/poshbotio/PoshBot/blob/master/PoshBot/Implementations/Slack/SlackConnection.ps1 | |
| - https://www.leeholmes.com/blog/2018/09/05/producer-consumer-parallelism-in-powershell/ | |
| #> | |
| $client_id = [System.GUID]::NewGuid() | |
| $recv_queue = New-Object 'System.Collections.Concurrent.ConcurrentQueue[String]' |
| # From https://stackoverflow.com/questions/42636510/convert-multiple-xmls-to-json-list | |
| # Use | |
| # [xml]$var = Get-Content file.xml | |
| # Convert to JSON with | |
| # $var | ConvertFrom-XML | ConvertTo-JSON -Depth 3 | |
| # Helper function that converts a *simple* XML document to a nested hashtable | |
| # with ordered keys. | |
| function ConvertFrom-Xml { | |
| param([parameter(Mandatory, ValueFromPipeline)] [System.Xml.XmlNode] $node) |