update editor

This commit is contained in:
pedrocx486 2023-02-11 21:49:41 -03:00
parent 12a5aa04fb
commit e756093a93
8 changed files with 144 additions and 140 deletions

View file

@ -1,6 +1,7 @@
{ {
"postTitle": "Auto-starting a simple bash script on Raspbian/RaspiOS is hell... ", "postTitle": "Auto-starting a simple bash script on Raspbian/RaspiOS is hell... ",
"timestamp": "1672336950", "timestamp": "1672336950",
"editedTimestamp": "",
"postContent": "(Old post, reposted from my old blog.)\n\nSo, it's 00:12 here. I was (still am) setting up my brand new RPi4, the shiny 8GB version to replace my old cranky RPi3b. New hardware, same hell as always with Raspbian (or RaspiOS or Raspberry Pi OS or however the hell they call it these days). \n\nI run on it some apps I use on my local network (basically my fancy app hub) and one of these apps is a Node.js API. Usually one would say “oh that's simple use PM2 and that's it!” but for some god forsaken reason it didn't work on me. \n\nI had just finished configuring Nextcloud and Gitea (and that went fine, as you can define the word…) and went to bring back up my Node API. As mentioned PM2 didn't work, so I went the classic way of having LXDE start a terminal and run a bash script with the commands needed. \n\nNo biggie, right? No. \n\nThe documentation for the RPi is… Well, fiddly. If you can call it that. I absolutely despise the crazy mish-mash of things you have on the internet regarding Raspbian/RaspiOS (starting by the friggin' name change!) because you simply can't easily find what works or doesn't with newer versions. \n\nSo this blog post is both a reminder to ME and a tutorial to you, fellow internet traveler that ever happens to stumble across it if you need to do the same thing. \n\n# HOW TO START A TERMINAL AND LAUNCH A BASH SCRIPT ON THE RASPBERRY PI OS: THE F*CKING TUTORIAL \n\n1. Boot your Pi to the GUI, not command line, obviously. \n\n2. Write your script and test it on the terminal (and for fuck's sake remember that the FIRST LINE should always be #!/bin/bash). \n\n3. Save your script in an easy path to access (such as /home/pi) and with the .sh extension. \n\n4. Open a terminal and run: sudo chmod +x /home/pi/your_script.sh \n\n5. Open an text editor with the sudo command (any you prefer, but IT NEEDS TO BE AS ROOT). \n\n6. Navigate to /etc/xdg/lxsession/LXDE-pi \n\n7. Open the file called autostart \n\n8. BEFORE THE LINE THAT STARTS WITH @XSCREENSAVER add a new line: @lxterminal --command \"/home/pi/your_script.sh\" (Why before @xscreensaver? Who knows. Do after it and you'll never see it execute.) \n\n9. DO FUCKING NOT put a . (dot) before the path, and INCLUDE THE DOUBLE QUOTES IN THE PATH. \n\n10. That's it. \n\nBeware that if your script does something (like launching a node app that auto-closes) and then closes after (or the app crashes…), you may want to add something like a sleep or pause command, if you want to see it running or its output. \n\nPS: I know the tone of the text is “violent”, this is literally how I write notes to myself so I can remember things. (Why? Because I'm a dumbass.) \nI usually don't share these, but considering the hellish experience I had with the PiOS (both on my 3 and 4), I wanted to share it at least so I have a permanent archive on the internet with it. \n\nHope it was helpful to someone out there. \n\nI gathered all content/commands from here: [https://www.raspberrypi.org/forums/viewtopic.php?t=65607](https:\/\/www.raspberrypi.org\/forums\/viewtopic.php?t=65607)", "postContent": "(Old post, reposted from my old blog.)\n\nSo, it's 00:12 here. I was (still am) setting up my brand new RPi4, the shiny 8GB version to replace my old cranky RPi3b. New hardware, same hell as always with Raspbian (or RaspiOS or Raspberry Pi OS or however the hell they call it these days). \n\nI run on it some apps I use on my local network (basically my fancy app hub) and one of these apps is a Node.js API. Usually one would say “oh that's simple use PM2 and that's it!” but for some god forsaken reason it didn't work on me. \n\nI had just finished configuring Nextcloud and Gitea (and that went fine, as you can define the word…) and went to bring back up my Node API. As mentioned PM2 didn't work, so I went the classic way of having LXDE start a terminal and run a bash script with the commands needed. \n\nNo biggie, right? No. \n\nThe documentation for the RPi is… Well, fiddly. If you can call it that. I absolutely despise the crazy mish-mash of things you have on the internet regarding Raspbian/RaspiOS (starting by the friggin' name change!) because you simply can't easily find what works or doesn't with newer versions. \n\nSo this blog post is both a reminder to ME and a tutorial to you, fellow internet traveler that ever happens to stumble across it if you need to do the same thing. \n\n# HOW TO START A TERMINAL AND LAUNCH A BASH SCRIPT ON THE RASPBERRY PI OS: THE F*CKING TUTORIAL \n\n1. Boot your Pi to the GUI, not command line, obviously. \n\n2. Write your script and test it on the terminal (and for fuck's sake remember that the FIRST LINE should always be #!/bin/bash). \n\n3. Save your script in an easy path to access (such as /home/pi) and with the .sh extension. \n\n4. Open a terminal and run: sudo chmod +x /home/pi/your_script.sh \n\n5. Open an text editor with the sudo command (any you prefer, but IT NEEDS TO BE AS ROOT). \n\n6. Navigate to /etc/xdg/lxsession/LXDE-pi \n\n7. Open the file called autostart \n\n8. BEFORE THE LINE THAT STARTS WITH @XSCREENSAVER add a new line: @lxterminal --command \"/home/pi/your_script.sh\" (Why before @xscreensaver? Who knows. Do after it and you'll never see it execute.) \n\n9. DO FUCKING NOT put a . (dot) before the path, and INCLUDE THE DOUBLE QUOTES IN THE PATH. \n\n10. That's it. \n\nBeware that if your script does something (like launching a node app that auto-closes) and then closes after (or the app crashes…), you may want to add something like a sleep or pause command, if you want to see it running or its output. \n\nPS: I know the tone of the text is “violent”, this is literally how I write notes to myself so I can remember things. (Why? Because I'm a dumbass.) \nI usually don't share these, but considering the hellish experience I had with the PiOS (both on my 3 and 4), I wanted to share it at least so I have a permanent archive on the internet with it. \n\nHope it was helpful to someone out there. \n\nI gathered all content/commands from here: [https://www.raspberrypi.org/forums/viewtopic.php?t=65607](https:\/\/www.raspberrypi.org\/forums\/viewtopic.php?t=65607)",
"filename": "auto-starting-a-simple-bash-script-on-raspbian", "filename": "auto-starting-a-simple-bash-script-on-raspbian",
"draft": false "draft": false

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
#app{font-family:Avenir,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#2c3e50}button{cursor:pointer;transition:all .3s ease-in-out;text-decoration:none;padding:.6rem;border:none;box-shadow:#000a 4px 4px}.btn-primary{background-color:#6100a2;color:#fff;font-size:.8rem}.btn-primary:hover{box-shadow:0 0 7px #6100a2}.wrapper{display:flex;grid-gap:1rem;flex-direction:row;justify-content:center;width:100%;height:85vh;position:relative;margin-bottom:-1.3rem}.editor-area{text-align:left;flex:1}.title-area{display:flex}.title{flex:1}.editor{resize:none;width:-webkit-fill-available;height:90%}.preview{max-width:50vw;flex:1;border:1px solid #969696;max-height:96.8%;overflow-y:auto}.preview-title{margin-top:0;border-bottom:solid 1px}.preview>*{max-width:50vw;line-break:normal}.preview>* p{padding:.2rem}.footer-buttons{text-align:center}#file-input{width:.1px;height:.1px;opacity:0;overflow:hidden;position:absolute;z-index:-1}#file-input+label{display:inline-block;cursor:pointer;transition:all .3s ease-in-out;text-decoration:none;padding:.55rem;border:none;box-shadow:#000a 4px 4px;color:#fff;background-color:#6100a2;position:absolute;font-size:.8rem;margin-top:.3rem;width:20.7rem;text-align:center;margin-left:-11.2rem}#file-input:focus+label,#file-input+label:hover{box-shadow:0 0 7px #6100a2;color:#fff}label{margin-bottom:0!important}@media only screen and (hover: none){.wrapper{flex-direction:column;margin-bottom:unset!important}.preview{max-width:100vw;margin-top:1rem}}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +0,0 @@
#app{font-family:Avenir,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#2c3e50}button{cursor:pointer;transition:all .3s ease-in-out;text-decoration:none;padding:.6rem;border:none;box-shadow:#000a 4px 4px}.btn-primary{background-color:#6100a2;color:#fff;font-size:.8rem}.btn-primary:hover{box-shadow:0 0 7px #6100a2}.wrapper{display:flex;grid-gap:1rem;flex-direction:row;justify-content:center;width:100%;height:85vh;position:relative}.editor-area{text-align:left;flex:1}.title-area{display:flex}.title{flex:1}.editor{resize:none;width:-webkit-fill-available;height:90%}.preview{max-width:50vw;flex:1;border:1px solid #969696;max-height:96.8%;overflow-y:auto}.preview-title{margin-top:0}.preview>*{max-width:50vw;line-break:normal}@media only screen and (hover: none){.wrapper{flex-direction:column}.preview{max-width:100vw;margin-top:1rem}}

0
editor/favicon.ico Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 104 KiB

View file

@ -5,8 +5,8 @@
<link rel="icon" href="./favicon.ico" /> <link rel="icon" href="./favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ngx-retroblog editor</title> <title>ngx-retroblog editor</title>
<script type="module" crossorigin src="./assets/index.4d0e6c12.js"></script> <script type="module" crossorigin src="./assets/index-ae82a772.js"></script>
<link rel="stylesheet" href="./assets/index.d2322268.css"> <link rel="stylesheet" href="./assets/index-80021042.css">
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>