PB Editor Version 0.01

Posted by lnikon 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Now, this forum is in read-only mode. You find details Details hereContinue on /r/PirateBox
PB Editor Version 0.01
October 02, 2014 02:38AM
[www.filedropper.com] <----- Download link, sorry it sucks.

This evening I wrote a very simple powershell script (for Windows obviously) that will give you a menu for editing some files on your PirateBox Hard Drive.

I'm just judging how much work to put into this based on future interest in a tool like this.

Directions:
1. Plug PirateBox Hard Drive into USB port on Windows Machine
2. Run PBeditor.ps1 (right click on PBeditor.ps1 and select 'run with powershell'
*** You might need to run this command in powershell first: Set-ExecutionPolicy Unrestricted

** This will open the files with whatever editor you have selected for that type file.



*****
Technical information:
The script goes through a list of pre-set drive letters and searches for a file in a specific path that the PirateBox uses. Once it has found that file then it knows where the files should live. Then I created a static menu of a few files I have found that people might want to edit.

I understand that most people can just plug the HDD in and navigate to these files but I haven't gotten to the opening of IMG files and editing. Before I spend time doing that I want to know if people are interested in this method or if not I won't spend the time working on this.

*** CODE NOT ACTUALLY HTML, ITS POWERSHELL ***
Language: HTML
## Drive Letters ## $drive_letters = "A","B","D","E","F","G","H","I","J" ## End Drive Letters ##   foreach ($letter in $drive_letters) {cd $letter":\PirateBox\Shared\" -ErrorAction SilentlyContinue $readme_name = dir -Filter README.txt | fl name, root -ErrorAction SilentlyContinue } cd .. $PirateBoxDir = pwd   ######## # Done finding PB Dir ########   echo " ______ ______ _______ _______ __ ___________ ______ ______ " echo "| _ \ | _ \ | ____|| \ | | | | / __ \ | _ \ " echo "| |_) | | |_) | | |__ | .--. || | `---| |----`| | | | | |_) | " echo "| ___/ | _ < | __| | | | || | | | | | | | | / " echo "| | | |_) | | |____ | ';--'; || | | | | `--'; | | |\ \----." echo "| _| |______/ |_______||_______/ |__| |__| \______/ | _| `._____|" echo " " echo "____ ____ ___ ___ __ " echo "\ \ / / / _ \ / _ \ /_ | " echo " \ \/ / | | | | | | | | | | " echo " \ / | | | | | | | | | | " echo " \ / | |_| | __| |_| | | | " echo " \__/ \___/ (__)\___/ |_| " echo " Created by lnikon " pause do { $reset = "0" cls echo "PB Editor version 0.01" echo "" echo "Options:" echo "(1) Edit the Board Index File" echo "(2) Edit the CSS file for burichan style" echo "(3) Edit the CSS file for futuba style" echo "(4) Edit the CSS file for gurochan style" echo "(5) Edit the CSS file for photon style" $1 = "$PirateBoxDir\board\index.html" $2 = "$PirateBoxDir\board\css\burichan.css" $3 = "$PirateBoxDir\board\css\futaba.css" $4 = "$PirateBoxDir\board\css\gurochan.css" $5 = "$PirateBoxDir\board\css\photon.css" $selection = Read-Host ';Please select an Option'; If ($selection -eq "1") {Invoke-Item $1} If ($selection -eq "2") {Invoke-Item $2} If ($selection -eq "3") {Invoke-Item $3} If ($selection -eq "4") {Invoke-Item $4} If ($selection -eq "5") {Invoke-Item $5} echo "" echo "Please remember to press save after you make your changes" pause reset = "1" } while ($reset = "1")

--
lnikon
Re: PB Editor Version 0.01
October 04, 2014 01:29PM
Thanks, I'll check it out this evening.