From a78042b0fda03b93e54da86d8f8067715b5ea9b5 Mon Sep 17 00:00:00 2001 From: jayofelony Date: Sun, 1 Dec 2024 12:57:33 +0100 Subject: [PATCH] Remove builder/data folder, we don't need that anymore. Signed-off-by: jayofelony --- .gitignore | 10 +- apt_packages.txt | 0 release.stork | 7 -- scripts/backup.sh | 47 ++++----- scripts/preview.py | 217 ----------------------------------------- scripts/pypi_upload.sh | 6 -- 6 files changed, 34 insertions(+), 253 deletions(-) delete mode 100644 apt_packages.txt delete mode 100755 release.stork delete mode 100755 scripts/preview.py delete mode 100755 scripts/pypi_upload.sh diff --git a/.gitignore b/.gitignore index fd20fddf..45df4bf2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,10 @@ - +scripts/ *.pyc +CODE_OF_CONDUCT.md +CONTRIBUTING.md +LICENSE.md +Makefile +MANIFEST.in +README.md +README-google.md +RE \ No newline at end of file diff --git a/apt_packages.txt b/apt_packages.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/release.stork b/release.stork deleted file mode 100755 index 023c4ecf..00000000 --- a/release.stork +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env stork -f - -version:parser "__version__\\s*=\\s*['\"]([\\d\\.ab]+)[\"']" -version:file "pwnagotchi/_version.py" -version:from_user - -git:create_tag $VERSION \ No newline at end of file diff --git a/scripts/backup.sh b/scripts/backup.sh index dd3f2349..70164c5d 100755 --- a/scripts/backup.sh +++ b/scripts/backup.sh @@ -32,28 +32,31 @@ OUTPUT=${OUTPUT:-${UNIT_HOSTNAME}-backup-$(date +%s).tgz} # username to use for ssh UNIT_USERNAME=${UNIT_USERNAME:-pi} # what to backup -FILES_TO_BACKUP="/root/brain.nn \ - /root/brain.json \ - /root/.api-report.json \ - /root/.ssh \ - /root/.bashrc \ - /root/.profile \ - /root/handshakes \ - /root/peers \ - /etc/pwnagotchi/ \ - /etc/ssh/ \ - /var/log/pwnagotchi.log \ - /var/log/pwnagotchi*.gz \ - /home/pi/.ssh \ - /home/pi/.bashrc \ - /home/pi/.profile \ - /root/.api-report.json \ - /root/.auto-update \ - /root/.bt-tether* \ - /root/.net_pos_saved \ - /root/.ohc_uploads \ - /root/.wigle_uploads \ - /root/.wpa_sec_uploads" +FILES_TO_BACKUP=" + /boot/firmware/cmdline.txt \ + /boot/firmware/config.txt \ + /root/settings.yaml \ + /root/client_sercrets.json \ + /root/.api-report.json \ + /root/.ssh \ + /root/.bashrc \ + /root/.profile \ + /root/handshakes \ + /root/peers \ + /etc/modprobe.d/g_ether.conf \ + /etc/pwnagotchi/ \ + /etc/ssh/ \ + /etc/pwnagotchi/log/pwnagotchi.log \ + /etc/pwnagotchi/log/pwnagotchi*.gz \ + /home/pi/.ssh \ + /home/pi/.bashrc \ + /home/pi/.profile \ + /root/.api-report.json \ + /root/.auto-update \ + /root/.bt-tether* \ + /root/.ohc_uploads \ + /root/.wigle_uploads \ + /root/.wpa_sec_uploads" ping -c 1 "${UNIT_HOSTNAME}" > /dev/null 2>&1 || { echo "@ unit ${UNIT_HOSTNAME} can't be reached, make sure it's connected and a static IP assigned to the USB interface." diff --git a/scripts/preview.py b/scripts/preview.py deleted file mode 100755 index de043ce0..00000000 --- a/scripts/preview.py +++ /dev/null @@ -1,217 +0,0 @@ -#!/usr/bin/env python3 -import sys -import os -import argparse -import yaml -import toml - -sys.path.insert(0, - os.path.join(os.path.dirname(os.path.realpath(__file__)), - '../')) - -import pwnagotchi.ui.faces as faces -from pwnagotchi.ui.display import Display -from PIL import Image - - -class CustomDisplay(Display): - - def __init__(self, config, state): - self.last_image = None - super(CustomDisplay, self).__init__(config, state) - - def _http_serve(self): - # do nothing - pass - - def _on_view_rendered(self, img): - self.last_image = img - - def get_image(self): - """ - Return the saved image - """ - return self.last_image - - -class DummyPeer: - - def __init__(self): - self.rssi = -50 - - @staticmethod - def name(): - return "beta" - - @staticmethod - def pwnd_run(): - return 50 - - @staticmethod - def pwnd_total(): - return 100 - - @staticmethod - def first_encounter(): - return 1 - - @staticmethod - def face(): - return faces.FRIEND - - -def append_images(images, horizontal=True, xmargin=0, ymargin=0): - w, h = zip(*(i.size for i in images)) - - if horizontal: - t_w = sum(w) - t_h = max(h) - else: - t_w = max(w) - t_h = sum(h) - - result = Image.new('RGB', (t_w, t_h)) - - x_offset = 0 - y_offset = 0 - - for im in images: - result.paste(im, (x_offset, y_offset)) - if horizontal: - x_offset += im.size[0] + xmargin - else: - y_offset += im.size[1] + ymargin - - return result - - -def main(): - parser = argparse.ArgumentParser(description="This program emulates\ - the pwnagotchi display") - parser.add_argument('--displays', help="Which displays to use.", nargs="+", default=["waveshare_2"]) - parser.add_argument('--lang', help="Language to use", default="en") - parser.add_argument('--output', help="Path to output image (PNG)", default="preview.png") - parser.add_argument('--show-peer', dest="showpeer", help="This options will show a dummy peer", action="store_true") - parser.add_argument('--xmargin', help="Add X-Margin", type=int, default=5) - parser.add_argument('--ymargin', help="Add Y-Margin", type=int, default=5) - args = parser.parse_args() - - config_template = ''' - main: - lang: {lang} - ui: - font: - name: 'DejaVuSansMono' - size_offset: 0 - size: 0 - fps: 0.3 - display: - enabled: false - rotation: 180 - color: black - refresh: 30 - type: {display} - web: - enabled: true - address: '::' - port: 8080 - - faces: - look_r: '( ⚆_⚆)' - look_l: '(☉_☉ )' - look_r_happy: '( ◕‿◕)' - look_l_happy: '(◕‿◕ )' - sleep: '(⇀‿‿↼)' - sleep2: '(≖‿‿≖)' - awake: '(◕‿‿◕)' - bored: '(-__-)' - intense: '(°▃▃°)' - cool: '(⌐■_■)' - happy: '(•‿‿•)' - excited: '(ᵔ◡◡ᵔ)' - grateful: '(^‿‿^)' - motivated: '(☼‿‿☼)' - demotivated: '(≖__≖)' - smart: '(✜‿‿✜)' - lonely: '(ب__ب)' - sad: '(╥☁╥ )' - friend: '(♥‿‿♥)' - broken: '(☓‿‿☓)' - debug: '(#__#)' - ''' - - list_of_displays = list() - for display_type in args.displays: - config = yaml.safe_load(config_template.format(display=display_type, - lang=args.lang)) - display = CustomDisplay(config=config, state={'name': f"{display_type}>"}) - list_of_displays.append(display) - - columns = list() - - for display in list_of_displays: - emotions = list() - if args.showpeer: - display.set_closest_peer(DummyPeer(), 10) - display.on_starting() - display.update() - emotions.append(display.get_image()) - display.on_ai_ready() - display.update() - emotions.append(display.get_image()) - display.on_normal() - display.update() - emotions.append(display.get_image()) - display.on_new_peer(DummyPeer()) - display.update() - emotions.append(display.get_image()) - display.on_lost_peer(DummyPeer()) - display.update() - emotions.append(display.get_image()) - display.on_free_channel('6') - display.update() - emotions.append(display.get_image()) - display.wait(2) - display.update() - emotions.append(display.get_image()) - display.on_bored() - display.update() - emotions.append(display.get_image()) - display.on_sad() - display.update() - emotions.append(display.get_image()) - display.on_motivated(1) - display.update() - emotions.append(display.get_image()) - display.on_demotivated(-1) - display.update() - emotions.append(display.get_image()) - display.on_excited() - display.update() - emotions.append(display.get_image()) - display.on_deauth({'mac': 'DE:AD:BE:EF:CA:FE'}) - display.update() - emotions.append(display.get_image()) - display.on_miss('test') - display.update() - emotions.append(display.get_image()) - display.on_lonely() - display.update() - emotions.append(display.get_image()) - display.on_handshakes(1) - display.update() - emotions.append(display.get_image()) - display.on_rebooting() - display.update() - emotions.append(display.get_image()) - - # append them all together (vertical) - columns.append(append_images(emotions, horizontal=False, xmargin=args.xmargin, ymargin=args.ymargin)) - - # append columns side by side - final_image = append_images(columns, horizontal=True, xmargin=args.xmargin, ymargin=args.ymargin) - final_image.save(args.output, 'PNG') - - -if __name__ == '__main__': - SystemExit(main()) diff --git a/scripts/pypi_upload.sh b/scripts/pypi_upload.sh deleted file mode 100755 index 265a56ae..00000000 --- a/scripts/pypi_upload.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -rm -rf build dist pwnagotchi.egg-info && - python3 setup.py sdist bdist_wheel && - clear && - twine upload dist/*