From baeb8a943c6505a7f0cbc0724eaf567a754c44a0 Mon Sep 17 00:00:00 2001 From: dbarzin Date: Tue, 5 Jul 2022 20:14:07 +0200 Subject: [PATCH] work in progress --- install.sh | 22 ++++++++++------------ pandora-box.py | 4 ++-- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/install.sh b/install.sh index 424f5d4..b2b4a02 100755 --- a/install.sh +++ b/install.sh @@ -20,7 +20,7 @@ cd redis git checkout 6.2 make # Optionally, you can run the tests: -make test +# make test cd .. chown -R $SUDO_USER redis @@ -34,7 +34,7 @@ cd kvrocks git checkout 2.0 make -j4 # Optionally, you can run the tests: -make test +# make test cd .. chown -R $SUDO_USER kvrocks @@ -74,10 +74,9 @@ wget http://cdn.download.comodo.com/av/updates58/sigs/bases/bases.cav -O /opt/CO # Workers -for file in pandora/workers/*.sample; do cp -i ${file} ${file%%.sample}; done - -chown -R $SUDO_USER . - +su - $SUDO_USER -c "cd pandora; for file in pandora/workers/*.sample; do cp -i ${file} ${file%%.sample}; done" +# remove not working +su - $SUDO_USER -c "cd pandora; rm pandora/workers/yara*.yml" su - $SUDO_USER -c "cd pandora; poetry run update --yes" #--------------------- @@ -97,6 +96,8 @@ apt install -y imagemagick pmount # Suppress all messages from the kernel (and its drivers) except panic messages from appearing on the console. echo "kernel.printk = 3 4 1 3" | tee -a /etc/sysctl.conf +# Set Permanently ulimit -n / open files in ubuntu +echo "fs.file-max = 65535" | tee -a /etc/sysctl.conf # allow write to /dev/fb0 usermod -a -G video $SUDO_USER @@ -105,10 +106,10 @@ usermod -a -G video $SUDO_USER usermod -a -G input $SUDO_USER # Start Poetry at boot -echo "su - $SUDO_USER -c \"cd /home/$SUDO_USER/pandora ; poetry run start\"" > /etc/rc.local +echo "su - $SUDO_USER -c \"cd pandora ; poetry run update -yes\"" > /etc/rc.local chmod +x /etc/rc.local -# Getty1 autostart +# getty1 autostart mkdir -p /etc/systemd/system/getty@tty1.service.d echo "[Service]" > /etc/systemd/system/getty@tty1.service.d/override.conf echo "ExecStart=" >> /etc/systemd/system/getty@tty1.service.d/override.conf @@ -117,9 +118,6 @@ echo "StandardInput=tty" >> /etc/systemd/system/getty@tty1.service.d/override.co echo "StandardOutput=tty" >> /etc/systemd/system/getty@tty1.service.d/override.conf echo "Type=idle" >> /etc/systemd/system/getty@tty1.service.d/override.conf -# Update pandora now -su - $SUDO_USER -c "cd /home/$SUDO_USER/pandora ; poetry run update --yes" - -# Then reboot ! reboot + diff --git a/pandora-box.py b/pandora-box.py index 425d542..d6fb09b 100755 --- a/pandora-box.py +++ b/pandora-box.py @@ -436,7 +436,7 @@ def scan(mount_point, used): res = pandora.submit_from_disk(full_path) time.sleep(0.1) loop = 0 - while True and (loop < 60): + while True and (loop < 960): res = pandora.task_status(res["taskId"]) status = res["status"] if status != "WAITING": @@ -448,7 +448,7 @@ def scan(mount_point, used): file, human_readable_size(file_size), status, - (file_scan_end_time - file_scan_start_time))) + (file_scan_end_time - file_scan_start_time))) scanned += os.path.getsize(full_path) file_count += 1 update_bar(scanned * 100 // used)