Monday, November 4, 2024

2024-11-04 - Troubleshooting web server issue with Apache 1

     I asked Doug to give me troubleshooting problems so he simulated one that he gives to interviewees at BYU that are applying for the System Administrator position. He didn't tell me what it would be till it was set up and most of the class he was working with another student that was practicing setting up VLANs and what he was doing took the whole network down because of what a student before him did somehow. But he got it set up so I could do it in the last half hour of class. He said they usually give interviewees ten to fifteen minutes and they get a username and a password and the IP address of a website that is malfunctioning, and they get to use the internet to troubleshoot. 

    So it was set up and he gave me a username and a password for administrative access to the web server he just set up for me, and the IP address of a website, and it didn't occur to me to go to the website, he said it was down. I just immediately set out to SSH into it and in the middle of trying to do this, the network went down again from VLAN problems. After another fifteen minutes or so, I finally got to see if I could SSH into it, which I did successfully. 

    He had told me that the website was down and they didn't know why and that it was using Apache to deliver web pages. I immediately thought of that scene in The Social Network when Mark told Edwardo that he needed to buy a Linux box running Apache with a MySQL backend. I looked it up many years ago and had very little idea of what he was talking about except that I knew what Linux was. But now because of this, I was aware that Apache had something to do with delivering the website to users. 

    SO when he mentioned Apache and said the site wasn't loading, I immediately suspected Apache. I went to ChatGPT to see if this could be resolved with it's help:

To ChatGPT - how to check if apache is running? I am ssh-ed into a web server. It runs linux.

ChatGPT - sudo systemctl status apache2

admin@skibidi-slicers:~$ sudo systemctl status apache2

[sudo] password for admin:

○ apache2.service - The Apache HTTP Server

     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)

     Active: inactive (dead) since Tue 2024-11-05 03:26:15 UTC; 18min ago

       Docs: https://httpd.apache.org/docs/2.4/

    Process: 24655 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)

    Process: 24920 ExecStop=/usr/sbin/apachectl graceful-stop (code=exited, status=0/SUCCESS)

   Main PID: 24666 (code=exited, status=0/SUCCESS)

        CPU: 564ms


Nov 05 02:07:10 skibidi-slicers systemd[1]: Starting The Apache HTTP Server...

Nov 05 02:07:10 skibidi-slicers apachectl[24665]: AH00558: apache2: Could not reliably determine the server's fully qua>

Nov 05 02:07:10 skibidi-slicers systemd[1]: Started The Apache HTTP Server.

Nov 05 03:26:05 skibidi-slicers systemd[1]: Stopping The Apache HTTP Server...

Nov 05 03:26:05 skibidi-slicers apachectl[24922]: AH00558: apache2: Could not reliably determine the server's fully qua>

Nov 05 03:26:15 skibidi-slicers systemd[1]: apache2.service: Deactivated successfully.

Nov 05 03:26:15 skibidi-slicers systemd[1]: Stopped The Apache HTTP Server.

ChatGPT said that it was started and later stopped. I wondered if perhaps Apache just wasn't running or someone turned it off or if there was some error, so I decided to start it. I asked ChatGPT how to start it. 

ChatGPT -  sudo systemctl start apache2

admin@skibidi-slicers:~$ sudo systemctl start apache2

Job for apache2.service failed because the control process exited with error code.

See "systemctl status apache2.service" and "journalctl -xeu apache2.service" for details.

I was about to try and figure out why it was stopping, and was going to ask ChatGPT how to check but Doug pointed out the above highlighted response and thought I would just go with that. 

admin@skibidi-slicers:~$ sudo journalctl -xeu apache2.service

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: AH00558: apache2: Could not reliably determine the server's fully qua>

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: (98)Address already in use: AH00072: make_sock: could not bind to add>

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: (98)Address already in use: AH00072: make_sock: could not bind to add>

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: no listening sockets available, shutting down

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: AH00015: Unable to open logs

Nov 05 03:46:41 skibidi-slicers apachectl[25114]: Action 'start' failed.

Nov 05 03:46:41 skibidi-slicers apachectl[25114]: The Apache error log may have more information.

Nov 05 03:46:41 skibidi-slicers systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE

░░ Subject: Unit process exited

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ An ExecStart= process belonging to unit apache2.service has exited.

░░

░░ The process' exit code is 'exited' and its exit status is 1.

Nov 05 03:46:41 skibidi-slicers systemd[1]: apache2.service: Failed with result 'exit-code'.

░░ Subject: Unit failed

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ The unit apache2.service has entered the 'failed' state with result 'exit-code'.

Nov 05 03:46:41 skibidi-slicers systemd[1]: Failed to start The Apache HTTP Server.

░░ Subject: A start job for unit apache2.service has failed

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ A start job for unit apache2.service has finished with a failure.

░░

░░ The job identifier is 20229 and the job result is failed.

 ESCOC


check HTTP Server...

execution


pache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' di>

is already in use: AH00072: make_sock: could not bind to address [::]:80

is already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80

ng sockets available, shutting down

unable to open logs

art' failed.

 error log may have more information.

 Control process exited, code=exited, status=1/FAILURE


as exited.

 

 1.

 Failed with result 'exit-code'.

 ESCOD

░░ Support: http://www.ubuntu.com/support

░░

░░ A stop job for unit apache2.service has finished.

░░

░░ The job identifier is 19786 and the job result is done.

Nov 05 03:46:41 skibidi-slicers systemd[1]: Starting The Apache HTTP Server...

░░ Subject: A start job for unit apache2.service has begun execution

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ A start job for unit apache2.service has begun execution.

░░

░░ The job identifier is 20229.

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: AH00558: apache2: Could not reliably determine the server's fully qua>

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: (98)Address already in use: AH00072: make_sock: could not bind to add>

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: (98)Address already in use: AH00072: make_sock: could not bind to add>

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: no listening sockets available, shutting down

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: AH00015: Unable to open logs

Nov 05 03:46:41 skibidi-slicers apachectl[25114]: Action 'start' failed.

Nov 05 03:46:41 skibidi-slicers apachectl[25114]: The Apache error log may have more information.

Nov 05 03:46:41 skibidi-slicers systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE

░░ Subject: Unit process exited

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ An ExecStart= process belonging to unit apache2.service has exited.

░░

░░ The process' exit code is 'exited' and its exit status is 1.

Nov 05 03:46:41 skibidi-slicers systemd[1]: apache2.service: Failed with result 'exit-code'.

lines 36-64/77 85%

░░ Support: http://www.ubuntu.com/support

░░

░░ A stop job for unit apache2.service has finished.

░░

░░ The job identifier is 19786 and the job result is done.

Nov 05 03:46:41 skibidi-slicers systemd[1]: Starting The Apache HTTP Server...

░░ Subject: A start job for unit apache2.service has begun execution

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ A start job for unit apache2.service has begun execution.

░░

░░ The job identifier is 20229.

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: AH00558: apache2: Could not reliably determine the server's fully qualified domain >

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: no listening sockets available, shutting down

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: AH00015: Unable to open logs

Nov 05 03:46:41 skibidi-slicers apachectl[25114]: Action 'start' failed.

Nov 05 03:46:41 skibidi-slicers apachectl[25114]: The Apache error log may have more information.

Nov 05 03:46:41 skibidi-slicers systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE

░░ Subject: Unit process exited

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ An ExecStart= process belonging to unit apache2.service has exited.

░░

░░ The process' exit code is 'exited' and its exit status is 1.

Nov 05 03:46:41 skibidi-slicers systemd[1]: apache2.service: Failed with result 'exit-code'.

░░ Subject: Unit failed

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ The unit apache2.service has entered the 'failed' state with result 'exit-code'.

Nov 05 03:46:41 skibidi-slicers systemd[1]: Failed to start The Apache HTTP Server.

░░ Subject: A start job for unit apache2.service has failed

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ A start job for unit apache2.service has finished with a failure.

 ESCOC


P Server...

n


 Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to s>

dy in use: AH00072: make_sock: could not bind to address [::]:80

dy in use: AH00072: make_sock: could not bind to address 0.0.0.0:80

ets available, shutting down

o open logs

iled.

log may have more information.

l process exited, code=exited, status=1/FAILURE


ed.


 with result 'exit-code'.


ult 'exit-code'.

che HTTP Server.


.

 ESCOD

░░ Support: http://www.ubuntu.com/support

░░

░░ A stop job for unit apache2.service has finished.

░░

░░ The job identifier is 19786 and the job result is done.

Nov 05 03:46:41 skibidi-slicers systemd[1]: Starting The Apache HTTP Server...

░░ Subject: A start job for unit apache2.service has begun execution

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ A start job for unit apache2.service has begun execution.

░░

░░ The job identifier is 20229.

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: AH00558: apache2: Could not reliably determine the server's fully qualified domain >

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: no listening sockets available, shutting down

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: AH00015: Unable to open logs

Nov 05 03:46:41 skibidi-slicers apachectl[25114]: Action 'start' failed.

Nov 05 03:46:41 skibidi-slicers apachectl[25114]: The Apache error log may have more information.

Nov 05 03:46:41 skibidi-slicers systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE

░░ Subject: Unit process exited

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ An ExecStart= process belonging to unit apache2.service has exited.

░░

░░ The process' exit code is 'exited' and its exit status is 1.

Nov 05 03:46:41 skibidi-slicers systemd[1]: apache2.service: Failed with result 'exit-code'.

░░ Subject: Unit failed

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ The unit apache2.service has entered the 'failed' state with result 'exit-code'.

Nov 05 03:46:41 skibidi-slicers systemd[1]: Failed to start The Apache HTTP Server.

░░ Subject: A start job for unit apache2.service has failed

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ A start job for unit apache2.service has finished with a failure.

 ESCOD

░░ Support: http://www.ubuntu.com/support

░░

░░ A stop job for unit apache2.service has finished.

░░

░░ The job identifier is 19786 and the job result is done.

Nov 05 03:46:41 skibidi-slicers systemd[1]: Starting The Apache HTTP Server...

░░ Subject: A start job for unit apache2.service has begun execution

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ A start job for unit apache2.service has begun execution.

░░

░░ The job identifier is 20229.

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: AH00558: apache2: Could not reliably determine the server's fully qualified domain >

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: no listening sockets available, shutting down

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: AH00015: Unable to open logs

Nov 05 03:46:41 skibidi-slicers apachectl[25114]: Action 'start' failed.

Nov 05 03:46:41 skibidi-slicers apachectl[25114]: The Apache error log may have more information.

Nov 05 03:46:41 skibidi-slicers systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE

░░ Subject: Unit process exited

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ An ExecStart= process belonging to unit apache2.service has exited.

░░

░░ The process' exit code is 'exited' and its exit status is 1.

Nov 05 03:46:41 skibidi-slicers systemd[1]: apache2.service: Failed with result 'exit-code'.

░░ Subject: Unit failed

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ The unit apache2.service has entered the 'failed' state with result 'exit-code'.

Nov 05 03:46:41 skibidi-slicers systemd[1]: Failed to start The Apache HTTP Server.

░░ Subject: A start job for unit apache2.service has failed

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ A start job for unit apache2.service has finished with a failure.

 ESCOD

░░ Support: http://www.ubuntu.com/support

░░

░░ A stop job for unit apache2.service has finished.

░░

░░ The job identifier is 19786 and the job result is done.

Nov 05 03:46:41 skibidi-slicers systemd[1]: Starting The Apache HTTP Server...

░░ Subject: A start job for unit apache2.service has begun execution

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ A start job for unit apache2.service has begun execution.

░░

░░ The job identifier is 20229.

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: AH00558: apache2: Could not reliably determine the server's fully qualified domain >

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: no listening sockets available, shutting down

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: AH00015: Unable to open logs

Nov 05 03:46:41 skibidi-slicers apachectl[25114]: Action 'start' failed.

Nov 05 03:46:41 skibidi-slicers apachectl[25114]: The Apache error log may have more information.

Nov 05 03:46:41 skibidi-slicers systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE

░░ Subject: Unit process exited

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ An ExecStart= process belonging to unit apache2.service has exited.

░░

░░ The process' exit code is 'exited' and its exit status is 1.

Nov 05 03:46:41 skibidi-slicers systemd[1]: apache2.service: Failed with result 'exit-code'.

░░ Subject: Unit failed

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ The unit apache2.service has entered the 'failed' state with result 'exit-code'.

Nov 05 03:46:41 skibidi-slicers systemd[1]: Failed to start The Apache HTTP Server.

░░ Subject: A start job for unit apache2.service has failed

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ A start job for unit apache2.service has finished with a failure.

 ESCOD

░░ Support: http://www.ubuntu.com/support

░░

░░ A stop job for unit apache2.service has finished.

░░

░░ The job identifier is 19786 and the job result is done.

Nov 05 03:46:41 skibidi-slicers systemd[1]: Starting The Apache HTTP Server...

░░ Subject: A start job for unit apache2.service has begun execution

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ A start job for unit apache2.service has begun execution.

░░

░░ The job identifier is 20229.

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: AH00558: apache2: Could not reliably determine the server's fully qualified domain >

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: no listening sockets available, shutting down

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: AH00015: Unable to open logs

Nov 05 03:46:41 skibidi-slicers apachectl[25114]: Action 'start' failed.

Nov 05 03:46:41 skibidi-slicers apachectl[25114]: The Apache error log may have more information.

Nov 05 03:46:41 skibidi-slicers systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE

░░ Subject: Unit process exited

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ An ExecStart= process belonging to unit apache2.service has exited.

░░

░░ The process' exit code is 'exited' and its exit status is 1.

Nov 05 03:46:41 skibidi-slicers systemd[1]: apache2.service: Failed with result 'exit-code'.

░░ Subject: Unit failed

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ The unit apache2.service has entered the 'failed' state with result 'exit-code'.

Nov 05 03:46:41 skibidi-slicers systemd[1]: Failed to start The Apache HTTP Server.

░░ Subject: A start job for unit apache2.service has failed

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ A start job for unit apache2.service has finished with a failure.

 ESCOD

░░ Support: http://www.ubuntu.com/support

░░

░░ A stop job for unit apache2.service has finished.

░░

░░ The job identifier is 19786 and the job result is done.

Nov 05 03:46:41 skibidi-slicers systemd[1]: Starting The Apache HTTP Server...

░░ Subject: A start job for unit apache2.service has begun execution

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ A start job for unit apache2.service has begun execution.

░░

░░ The job identifier is 20229.

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: AH00558: apache2: Could not reliably determine the server's fully qualified domain >

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: no listening sockets available, shutting down

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: AH00015: Unable to open logs

Nov 05 03:46:41 skibidi-slicers apachectl[25114]: Action 'start' failed.

Nov 05 03:46:41 skibidi-slicers apachectl[25114]: The Apache error log may have more information.

Nov 05 03:46:41 skibidi-slicers systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE

░░ Subject: Unit process exited

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ An ExecStart= process belonging to unit apache2.service has exited.

░░

░░ The process' exit code is 'exited' and its exit status is 1.

Nov 05 03:46:41 skibidi-slicers systemd[1]: apache2.service: Failed with result 'exit-code'.

░░ Subject: Unit failed

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ The unit apache2.service has entered the 'failed' state with result 'exit-code'.

Nov 05 03:46:41 skibidi-slicers systemd[1]: Failed to start The Apache HTTP Server.

░░ Subject: A start job for unit apache2.service has failed

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ A start job for unit apache2.service has finished with a failure.

 ESCOD

░░ Support: http://www.ubuntu.com/support

░░

░░ A stop job for unit apache2.service has finished.

░░

░░ The job identifier is 19786 and the job result is done.

Nov 05 03:46:41 skibidi-slicers systemd[1]: Starting The Apache HTTP Server...

░░ Subject: A start job for unit apache2.service has begun execution

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ A start job for unit apache2.service has begun execution.

░░

░░ The job identifier is 20229.

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: AH00558: apache2: Could not reliably determine the server's fully qualified domain >

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: no listening sockets available, shutting down

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: AH00015: Unable to open logs

Nov 05 03:46:41 skibidi-slicers apachectl[25114]: Action 'start' failed.

Nov 05 03:46:41 skibidi-slicers apachectl[25114]: The Apache error log may have more information.

Nov 05 03:46:41 skibidi-slicers systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE

░░ Subject: Unit process exited

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ An ExecStart= process belonging to unit apache2.service has exited.

░░

░░ The process' exit code is 'exited' and its exit status is 1.

Nov 05 03:46:41 skibidi-slicers systemd[1]: apache2.service: Failed with result 'exit-code'.

░░ Subject: Unit failed

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ The unit apache2.service has entered the 'failed' state with result 'exit-code'.

Nov 05 03:46:41 skibidi-slicers systemd[1]: Failed to start The Apache HTTP Server.

░░ Subject: A start job for unit apache2.service has failed

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ A start job for unit apache2.service has finished with a failure.

 ESCOC


P Server...

n


 Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to s>

dy in use: AH00072: make_sock: could not bind to address [::]:80

dy in use: AH00072: make_sock: could not bind to address 0.0.0.0:80

ets available, shutting down

o open logs

iled.

log may have more information.

l process exited, code=exited, status=1/FAILURE


ed.

 with result 'exit-code'.


ult 'exit-code'.

che HTTP Server.

 

.

 ESCOC


ame, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message


 ESCOC


ppress this message


 ESCOC


 ESCOD


ppress this message


 ESCOD


ame, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message


 ESCOD


P Server...

n


 Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to s>

dy in use: AH00072: make_sock: could not bind to address [::]:80

dy in use: AH00072: make_sock: could not bind to address 0.0.0.0:80

ets available, shutting down

o open logs

iled.

log may have more information.

l process exited, code=exited, status=1/FAILURE


ed.


 with result 'exit-code'.


ult 'exit-code'.

che HTTP Server.


.

 ESCOD

░░ Support: http://www.ubuntu.com/support

░░

░░ A stop job for unit apache2.service has finished.

░░

░░ The job identifier is 19786 and the job result is done.

Nov 05 03:46:41 skibidi-slicers systemd[1]: Starting The Apache HTTP Server...

░░ Subject: A start job for unit apache2.service has begun execution

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ A start job for unit apache2.service has begun execution.

░░

░░ The job identifier is 20229.

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: AH00558: apache2: Could not reliably determine the server's fully qualified domain >

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: no listening sockets available, shutting down

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: AH00015: Unable to open logs

Nov 05 03:46:41 skibidi-slicers apachectl[25114]: Action 'start' failed.

Nov 05 03:46:41 skibidi-slicers apachectl[25114]: The Apache error log may have more information.

Nov 05 03:46:41 skibidi-slicers systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE

░░ Subject: Unit process exited

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ An ExecStart= process belonging to unit apache2.service has exited.

░░

░░ The process' exit code is 'exited' and its exit status is 1.

Nov 05 03:46:41 skibidi-slicers systemd[1]: apache2.service: Failed with result 'exit-code'.

░░ Subject: Unit failed

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ The unit apache2.service has entered the 'failed' state with result 'exit-code'.

Nov 05 03:46:41 skibidi-slicers systemd[1]: Failed to start The Apache HTTP Server.

░░ Subject: A start job for unit apache2.service has failed

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ A start job for unit apache2.service has finished with a failure.

 ESCOC

 

P Server...

n


 Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to s>

dy in use: AH00072: make_sock: could not bind to address [::]:80

dy in use: AH00072: make_sock: could not bind to address 0.0.0.0:80

ets available, shutting down

o open logs

iled.

log may have more information.

l process exited, code=exited, status=1/FAILURE


ed.


 with result 'exit-code'.


ult 'exit-code'.

che HTTP Server.


.

 ESCOD

░░ Support: http://www.ubuntu.com/support

░░

░░ A stop job for unit apache2.service has finished.

░░

░░ The job identifier is 19786 and the job result is done.

Nov 05 03:46:41 skibidi-slicers systemd[1]: Starting The Apache HTTP Server...

░░ Subject: A start job for unit apache2.service has begun execution

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ A start job for unit apache2.service has begun execution.

░░

░░ The job identifier is 20229.

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: AH00558: apache2: Could not reliably determine the server's fully qualified domain >

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: no listening sockets available, shutting down

Nov 05 03:46:41 skibidi-slicers apachectl[25117]: AH00015: Unable to open logs

Nov 05 03:46:41 skibidi-slicers apachectl[25114]: Action 'start' failed.

Nov 05 03:46:41 skibidi-slicers apachectl[25114]: The Apache error log may have more information.

Nov 05 03:46:41 skibidi-slicers systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE

░░ Subject: Unit process exited

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ An ExecStart= process belonging to unit apache2.service has exited.

░░

░░ The process' exit code is 'exited' and its exit status is 1.

Nov 05 03:46:41 skibidi-slicers systemd[1]: apache2.service: Failed with result 'exit-code'.

░░ Subject: Unit failed

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ The unit apache2.service has entered the 'failed' state with result 'exit-code'.

Nov 05 03:46:41 skibidi-slicers systemd[1]: Failed to start The Apache HTTP Server.

░░ Subject: A start job for unit apache2.service has failed

░░ Defined-By: systemd

░░ Support: http://www.ubuntu.com/support

░░

░░ A start job for unit apache2.service has finished with a failure.

At this point I had not understood that "is already in use: AH00072: make_sock: could not bind to address [::]:80 is already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80" was referring to ports. It said sockets and I didn't know. I had asked ChatGPT about the output the server gave me and it gave two answers, but one of them talked about port 80 already being in use and I thought, oh, HTTP is already in use. I remembered back when I had made a Pi Hole and Pi VPN and to access it, there was a web interface. And from my understanding, this used port 80. And then one of my next projects was to create a self hosted password manager. But one of the snags I ran into was that to access it, I would need to host my own website. And this couldn't be done because I was already hostin a website basically so I could access my Pi Hole through the web interface. So if that was going to be solved, Doug had the idea ot try and use a free domain. I ultimately ended up scrapping the project for other reasons but I remembered this, that it couldn't host more than one site from one public IP address.

I asked ChathGPT how to see what all was running on port 80 and entered in one of its responses.

admin@skibidi-slicers:~$ sudo lsof -i :80

COMMAND   PID     USER   FD   TYPE DEVICE SIZE/OFF NODE NAME

nginx   24974     root    6u  IPv4 251337      0t0  TCP *:http (LISTEN)

nginx   24974     root    7u  IPv6 251338      0t0  TCP *:http (LISTEN)

nginx   24975 www-data    6u  IPv4 251337      0t0  TCP *:http (LISTEN)

nginx   24975 www-data    7u  IPv6 251338      0t0  TCP *:http (LISTEN)

nginx   24976 www-data    6u  IPv4 251337      0t0  TCP *:http (LISTEN)

nginx   24976 www-data    7u  IPv6 251338      0t0  TCP *:http (LISTEN)

nginx   24977 www-data    6u  IPv4 251337      0t0  TCP *:http (LISTEN)

nginx   24977 www-data    7u  IPv6 251338      0t0  TCP *:http (LISTEN)

nginx   24978 www-data    6u  IPv4 251337      0t0  TCP *:http (LISTEN)

nginx   24978 www-data    7u  IPv6 251338      0t0  TCP *:http (LISTEN)

I went to ChtGPT to learn what NGINX was. One of the many things it said was that "Nginx (pronounced "engine-ex") is a high-performance web server and reverse proxy server that is also used for load balancing, HTTP caching, and serving static files. It was created by Igor Sysoev and first released in 2004. Nginx is known for its ability to handle a large number of concurrent connections efficiently, making it popular for high-traffic websites."

   My conclusion here was not that it was an alternative to Apache, but rather I concluded that NGINX was an important part of either Apache or something that worked with Apache. And I formed the conclusion that it was important, after all we likely do want the processes its running and so if I just end the process and start Apache, I might just be causing another problem in order to solve one, like robbing Peter to pay Paul. I told Doug my conclusion that one option is to end NGINX, but I suspect that NGINX was actually important and when he asked me what it does, I said it's a high performance web server that runs many tasks at the same time.  And he corrected me that basically its an alternative to Apache. And I realized, oh, so since we want Apache to run, we need to kill NGINX since only one thing can run over port 80 at a time. I asked ChatGPT how to stop it, and Chat GPT said how to stop it, and I asked how to start Apache again and it also suggested I run a status check on it after I had run the command to start it which I did: 

admin@skibidi-slicers:~$ sudo systemctl stop nginx

admin@skibidi-slicers:~$ sudo systemctl start apache2

admin@skibidi-slicers:~$ sudo systemctl status apache2

● apache2.service - The Apache HTTP Server

     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)

     Active: active (running) since Tue 2024-11-05 04:01:59 UTC; 7s ago

       Docs: https://httpd.apache.org/docs/2.4/

    Process: 25143 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)

   Main PID: 25147 (apache2)

      Tasks: 55 (limit: 4563)

     Memory: 5.0M

        CPU: 103ms

     CGroup: /system.slice/apache2.service

             ├─25147 /usr/sbin/apache2 -k start

             ├─25148 /usr/sbin/apache2 -k start

             └─25149 /usr/sbin/apache2 -k start

Problem solved. He told me that there were a lot of people that took far more than the ten minutes I took and may who didn't even solve it. But there were people who solved it faster than me. I asked if employers would care if I used ChatGPT and he said no, as long as you don't rely on it to tell you what everything means, you should try to understand the outputs yourself as much as you can or else you're just using it as a crutch. I said but he had given me a few nudges here and there. I suppose I can expect that on the job, that I can receive nudges from co-workers and stuff and he said yes, especially if you're a junior sys. admin. And I asked, so basically I got like a B on my test ad he said yes. 

This has been Truncat3d 00000000111100010100110______________end of line 

Sunday, October 20, 2024

2024-10-20 - Screen Off solution / script

 Screen Off solution / script

    Okay, so I use my laptop on battery to run a Zoom meeting once a week for an hour. This isn't a problem but I would like to somehow preserve some of the battery life of my laptop if I can help it. I remember being trained on this and the guy that showed me how to do this said that he just turns the brightness of his screen way down for the meeting since once it starts recording and uploading to the cloud, there's almost no need to touch anything until the meeting is over. But I have never been satisfied with just turning the brightness way down. On my laptop, the brightness goes way down but it is still pretty bright and if I close the lid, the screen will turn off but the laptop will heat up a lot more, which is bad for the battery, and the GPD Pocket 3 does not have a keyboard shortcut for turning the screen or trackpad on or off. 
    Remember that my solution to turn my trackpad on or off came down to creating a PowerShell script that turned the HID device in Device Manager for the keyboard on and off and to revert back and fourth each time I double-click it depending on what it did before, turning it or turning it off. Well, that would not work so well for this problem, which is why it has taken me a year to figure out how to solve this issue. You see, if I write a script that turns the device in Device Manager on or off, then all that needs to happen is that I activate the script to turn it off and then that's it, I can't turn it back on because I could never hope to be so lucky that the mouse will be right over the same sport and I can just double click again and get my screen back. And the major inconvenience of plugging in a second screen just to maybe get my screen back is not a solution. This needs to be a way of turning off the screen without losing the ability to turn it back on. So how do I do that? 
    And then an idea intrigued me. I was thinking today as I was in the middle of this Zoom meeting today and thought, what if I used the keyboard shortcuts to turn the screen brightness down as usual but then if there was another screen brightness control like in Intel Display settings or something, I could also turn that down too. So I went about looking for any discrete video driver settings that might have an extra brightness control there and I would just use both controls for each Zoom meeting. I found the driver settings but alas, the only brightness controls were for if you were watching a video, the driver would artificially brighten or darken any video automatically going forward according to your selection. But I don't want that. 
    I was researching this online when I googled something about a script to power off the screen but keyboard shortcut revives it. And after some digging, I found an old program someone had written about called NIRCMD. The site said that it worked for everything from I think Windows 2000 all the way up to 10. And I thought, is there any possibility that if it worked with 10 that it might still possibly work with 11? SO I downloaded it and in .batch, wrote a script with the simple line:

nircmd.exe monitor off

    I downloaded it, and it came with a copy called NIRCMD and another called NIRCMDC, and the difference between those is that NIRCMD will run with a CMD, but NIRCMDC is the console option that will simply run silently or in the background. And the trick that lead me to this old program was that the pressing of any keyboard key will reactivate the screen. So I took the risk, but not until after creating a restore point, then I placed the NIRCMD.EXE file in my System32 folder, created a notepad file with the single line of code requesting NIRCMD to activate along with the NIRCMD command to turn the screen off, saved it, changed the file extension to .bat, double-clicked it, the screen turned off and then I pressed a keyboard key and it came back. 
    Fun side note, I was at home when I did this and had a second screen plugged in as my main screen, and this screen turned off when I activated this script. Signal was lost and the external screen was getting ready ti power off. So I am sure it will turn off all screens built in and otherwise. 
    I can't believe it! A lot of the time I at least run these things by my instructor to see what he thinks, if he has any ideas, and I have talked to him about this over the past year, but even he didn't have any ideas. So this was done in one day without his involvement at all in any way, shape or form. 
    A friend raised the point that any power savings from simply turning the screen off is not likely to result in that much savings, but if before the meeting I am at 100% battery and at the end of it I am in the 40s, I feel like turning the screen all the way off for that whole time could save me more than 10% which is what I am hoping for. Because I will often use my laptop before I go home and recharge it and would like to have the option of using it for the next few hours without concern that it will die if I am not quick with whatever I do.  

This has been Truncat3d 00000000111100010100110______________end of line

Wednesday, October 9, 2024

2024-07-16 - Bought a Pine64 PineTab2 with Arch Linux installed, trying to get it running, and my thoughts on it as a product

Pine Tab 2


     I bought a PineTab2 after a suggestion from Doug. You see that conversation we had about my thinking about building a tablet with a Raspberry Pi and a touch screen and a power bank, I was frustrated that I have a perfectly good working order Samsung tablet that's a little over ten years old and it can't update anymore so all you can do with it is open pictures and play videos from an SD card. I am sure this tablet used to cost close to a thousand dollars and now it's almost useless. I have a few things I would like it to do. But all of those things require it to be able to update somehow. And because of this, Doug said that with all the logistics  of building a tablet from scratch, you'll be in quite a bit of money if you decide to build a tablet from scratch, and I said it wasn't about the money. Besides, the advantage of buying it in parts is that I can buy it piecemeal which is far more doable than buying one thing for a ton of money. And then I added, the reason I am thinking about doing this is that I am frustrated with companies selling an expensive product and then just deciding remotely that it is useless so I have to buy another one. On principal, I want to be the one who makes decisions like these. Then he suggested a PineTab2, which is only about $200, runs Linux, and has tons of peripherals that tablets typically don't have, which I sited as another motivator for building a tablet out of a Pi. I was thinking about turning it into a Flipper Zero, well, to have the functionality but to also do all other tablet things. And you need peripherals for this because a Flipper has GPIO pins, a USB port, bluetooth, RF, RFID, iButton, and others. It just lacks Wifi. But the Pi would have Wifi by default. 

    We looked at the PineTab2 and actually it looked very compelling. It used an ARM processor but all phones and tablets do, it had 8GB of RAM and internal graphics, a USB 3.0 port and a 2.0 port for charging and debugging, another just for the detachable keyboard, a micro SD card slot, and a micro HDMI port. This was sounding too good to be true for only 200. What was the deal?

    Well, I was thinking about just buying this instead, with the warning from Doug that it'll run Arch Linux, which is way harder to set up than a regular Linux machine. You have to set it up so that it has a GUI at all, it doesn't just come with it like many Linux OS's do. You have to set it up so it connects to WiFi and Bluetooth and so on. I thought, well, if I don't like it surely I can install another Linux OS, right? Yeah. Okay, so this isn't a problem as far as I see it. I am willing to give Arch Linux a shot in the name of ultimate control. Plus one of the reasons for doing this is to challenge myself so that I can become more competent. Doug thought that was a good cause. But he did question why do this at all when I have a perfectly good laptop, that's really powerful, fits in my pocket, is smaller than the PineTab2 which is 10 inches and my GPD Pocket 3 is only 8 inches wide, it can be used as a tablet, it's specs are far superior, has an i7 processor, why would I do this? Well, it isn't actually a tablet, I don't want to use it that way, and it is actually just a bit small for what I want a tablet for. 

    I am an artist, I trace the outlines initially because it drives me nuts that I will work so hard to get everything right, all the proportions, the lines seem right, but everything seems a bit off and I can't figure out why, but I am doing my best, and then I shade it and I am satisfied with how good the hand I drew looks, and I did the folds of the persons jeans really well, I would never want to delete this. And then I find out a crucial line is absolutely in the wrong spot, or it's the wrong proportion or it's shaped wrong. And I have to fix it because it affects everything else. So I trace. I figure I'll do this until I get better. But in the meantime, I need a tablet I can trace off of because I don't want to print everything I want to draw and I don't want to have the printer dictate for me how big the picture will be. So far this is a thing my Samsung tablet can still do with one huge problem. I can't actually trace because pencil lead is conductive and confuses the screen. So I thought, man if this was my GPD Pocket, I would just write a script that temporarily disabled the touchscreen so I could trace without problems. But it's not. It's my Samsung tablet and I cannot modify anything because that isn't a thing Android allows anyway, even if it did work. 

    Well, I think I will probably be able to solve this with a Linux-based tablet even more easily than a still perfectly working brand new Android or Apple tablet. 

    I bought it on the 4th of July. I didn't think it would take so long for them to put the order together, they didn't even send an email saying that they were putting it together, for all I knew it was shipping and I couldn't track it to make sure I was on the doorstep to receive it before a porch pirate takes it. 

    Before buying it I looked up why it was so cheap for such a fancy seeming tablet, basically it came down to no marketing, only word of mouth, it uses parts from other tablets that other companies built, it uses affordable parts, it uses Linux which is free, ...got it. 

    Turned it on and it already had a username and password, found it in the manual.

    Connecting to WiFi was a problem, I was thinking the whole time that because its Arch Linux, this will be a real challenge but I was going to plow into it and figure out how to connect it to WiFi which was a far harder operation by appearance than any other attempt I had ever made with literally anything ever before. it wanted to know what security the router was using, the BSSID as well as the SSID, it wouldn't list any SSID's that it saw, in fact I couldn't even get it to recognize that there was a WiFi transmitter/receiver built into it and I started to wonder if this is one of this tablets quarks. 

    Turned out that it just needed an update, and it took a while, there were a lot of updates to clear. But when this was done, all of the sudden, everything was very smooth sailing. I was able to simply click on the wifi icon and selected an SSID, plugged in my password and it connected. 

    I tried installing a number of things and as I was using the Pine Tab 2, it started to become apparent that it is a slow tablet even though it has great specs. I was so sure before I bought it that there had to be a catch to justify how cheap it was, and I did what research I could and watched videos and googled things I was curious about and so on, and I learned that they saved money using a plethora of methods like being open source and reusing designs for other products which also means using their parts. They were cheap where they could be and good quality where they had to be. And I was kind of satisfied that perhaps it is just the case that this is a good and really cheap product. But I have used it in trying to set it up and while I haven't ever hit a point where it freezes or anything, its response latency seems kind of high.  Like it always takes it a quarter or half second to respond every time you do something. 

    Wednesday 2024-10-09

    I was talking about this with my instructor who agreed and suggested we try installing a different OS. But I was kind of convinced to give Arch Linux a shot and now we are abandoning it. And I liked that this tablet had a really nice desktop environment very similar to both Mac OS and Windows 11. IT just so happened that I didn't write down my usernames or passwords for this device for some reason, which I never just don't do but I didn't do it this time for some reason so I has a hard time trying to remember what the login password might have been and finally I remembered it by chance and got in, and in trying to resolve this issue, I was doing research on alternative ways to get into the tablet so I can redo y usernames and passwords or even install a different OS and happened to google what type of OS the Pine Tab 2 has and I learned that there's this desktop environment thing I had seen the name of on the tablet while using it, so I recognized it when it said KDE Plasma. I looked it up and learned that desktop environments are a thing, and this is why Arch Linux on my tablet looks like a cross between Windows 11 and Mac OS. 

I suspected that this was the reason why Arch Linux was running so slow but then also asked if Arch or KDE Plasma were slow. But my research basically told me they are both very lightweight and the KDE Plasma desktop environment is only a few hundred MB or something like that. So I asked google "arch linux kde plasma vs ubuntu desktop os which is lighter" and the impression I got from the results was that Ubuntu is lighter. Doug, my instructor, suggested that I try Raspberry Pi OS and I said yeah but I want it to be very customizable and he said well it was developed for PI's, so it's very customizable and he said something like that it may be even more customizable than other Linux OS's. This was flabbergasting to me because my impression is that Linux all around is extremely customizable but things just work and look differently depending on which flavor and distro you install. And then he suggested that I should install a minimized Ubuntu Server OS, and then install KDE Plasma since I liked what I saw. It should run pretty well. I asked why Ubuntu server, will I still be able to install anything that I want like regular Ubuntu and he said yes except that Ubuntu server would have even more options because its designed to run server stuff and it's all designed to run well, so there's not much beta software. 

    I decided to give Ubuntu Server Minimized and install KDE Plasma to see if that would do the trick. So we began the process of trying to boot this from a USB but all the methods I found were invalid. One result said yes, you just hold the up volume button and then press and hold the power button as well until you see the UBOOT menu. I did this many times and it would just keep booting regular, another thing said there is no boot menu. And finally on the Pine Tab 2 Wikipedia page, under Installation Instructions and Preparing the MicroSD card, there was a thing that said:

Note regarding the boot order: The SPI and the internal memory (eMMC) have a higher boot priority than the microSD card. The pre-installed bootloader on the internal memory (eMMC) tries to boot from the microSD card first. In some cases it can be required to bypass the bootloader, for example if the bootloader is corrupted or was overwritten by a bootloader with varying settings.

To force the device to boot from the microSD card, the eMMC and the SPI can be disabled by using the debug UART adapter shipped with the device in the box also containing the charging cable. Set the SD BOOT MASKROM switch on the adapter to the position ON and plug it into the USB/PD charging port. Then power on the tablet and unplug the debug board or set the switch to the position OFF again when the factory image is started, otherwise the factory image won't find the eMMC.

Power on the device with the microSD card inserted (and optionally with the USB UART adapter inserted and the bypass switch set to ON depending on the software situation, see the info box above). It should now boot the new operating system from the microSD card.

Something is not working? Please join the PineTab channel in the community chat, the community is always happy to help. In the section #Connecting the UART adapter you can find information about how to connect the USB UART adapter and how to retrieve the boot logs if the device is not booting properly even after the above procedure. 

So when I opened the box the tablet came in, there was an odd device called USB UART that I had no idea what it was for. Apparently, you need this if you are going to boot to something else.  


    Thursday 2024-10-16

    Got to work on project day today by trying to use the UART device to install an alternate OS on the Pine Tab2. Took me a whole day to find where I put the UART device but I found it. It's a small circuit board with a couple of lights on it, an on/off switch for booting of the SD card in the Paine Tab2, and three USB C ports. I found instructions online that said to connect the UART device to the tablets console or serial port, which in this case to my understanding is the second USB C debugging port, and the other end to your computer. I got excited when my instructor, Doug, told me that controlling this device is very similar to plugging into a switch or router through the RS232 port to configure it. That is a project I have been wanting to do for a long time but there was always something higher priority to do. 

    Install puTTy, and turn the device on through the console. It gave instructions to set the port to whichever USB port you plugged the computer into the UART with and set the baud rate to 115200, data bits to 8, stop bits to 1, parity bits to none, and flow control to none. 

    I discovered that once you connect the UART while turned on into the tablet, it freezes. It will not boot, if it is already booting, it will stop and even start writing lines of error to the screen and if the n turned back off or unplugged, it may still hang there or continue on to boot. However, while it was off, once the tablet was turned on through the traditional power switch, lines of garbled text and what looks to me like blocks of static, undefined characters--would fill the screen in paragraphs and then once the screen reached the login screen these would eventually give way to legible lines of text where you essentially control the tablet as though through the CLI, or console. You type what user, it prompts you for a password and it will show on the screen of the tablet that you logged in. 

    But this was not what we were trying to accomplish. We had flashed the SD card with Ubuntu Server with the intention to put KDE Plasma on it like the tablet came with on Arch Linux. But we were unable to find the screen on the console screen that said we could press any key to interrupt the boot process. And neither of us figured out yet how to turn the device on through the console port. 

    In troubleshooting, I tried different baud rates since this is how text is interpreted for the console from the tablet. And there were many features that controlled this.  I did not try to press space, escape or enter when seeing the garbled text, so I need to try that since I just saw that instruction in my research but missed itSometimes the boot process doesn't display a visible prompt but will still accept key input "Ctrl + C" immediately after you power the device. My research indicated that I needed to recheck my settings in puTTy, but all of the settings were correct, no prompt shows up that can be interrupted, just a bunch of illegible lines that cannot be discerned, and then it starts showing all of the lines for bootup for Linux, at which point I assume it may be too late. My understanding at this time was that the illegible lines I was seeing in in the PuTTY console suggested that the output might not be properly configured to display correctly in the terminal, and that this is often caused by a mismatch in the encoding or baud rate, or it might be that some output is garbled before switching to readable text during boot. So I tried 9600 baud rate, 57600 and 38400 and then I think I tried one other before cycling back through to double check that I did it correctly. Then I tried enabling and disabling ESC[n~ in Terminal>keyboard settings, and IMPLICIT CR IN EVERY LF and IMPLCIT LF IN EVERY CR, and also XTERM, VT100, or LINUX. None of that worked either. 

    Instead of using puTTy, I could have tried using TERE TERM since I'm using Windows, but I did not try this yet. 

    I am delighted as I look back on this a few years later as I was brushing up on all manner of tools and stuff that employers might ask about in an interview, Putty did come up and I was curious because it looked similar. I didn't ever think I had used it. But to my surprise, I had, here!

    After more digging I found the possibility that the reason this wasn't working was because I was using a .ISO instead of a .IMG since this is an ARM device. SO I looked for an IMG of Ubuntu Server, couldn't find one, went to the Pine Tab website and found a bunch of IMG's for Arch Linux and Ubuntu touch, kept looking, then looked for a way to convert ISO to IMG and found sites that would do it but one in particular for example would only do it for files that were a few hundred MB's, and Ubuntu Server is a few GB's. Then I found a video on YouTube explaining how to convert it in Windows. But all this guy did was have you make file extensions visible so you could change the extension in the file name from .ISO to .IMG. So despite my reservations, I did it when the guy in the video said that .IMG and .ISO are virtually the same. So I changed it, and then further research said that Rufus might not be the best solution for Arch Linux devices, so I should try Balena Etcher. So I did, it flashed to the card successfully', I inserted it into the tablet, tried booting again same thing. 

    I was stumped.


    Friday 2024-10-17

    I had the idea to simply just try installing the .IMG Ubuntu Touch OS from the Pine Tab website because perhaps we are going about this all wrong and none of the things I am trying are actually intended to work, and that this may be why they provide images of Arch and Ubuntu Touch on the Pine Tab website. So one of my next things to try is to flash Ubuntu Touch onto it to see if the parts I'm working with work properly and if they do then Ubuntu Touch should install just fine. If not I may need to get it fixed or replaced or just put up with how slow the tablet is with the current OS, despite how lite it is. 




This has been Truncat3d 00000000111100010100110______________end of line

Friday, October 4, 2024

2024-10-04 - Arduino LED light strip project

Arduino LED light strip project


-Installed Arduino ide software
-I had lolin new nidemcu v3 and IT wasn’t recognized by the ide software
-Went to arduino website and find a link for the board and went to file, preferences and added the link to add new board.
-Installed fastLED
-There are two sections in the code of the main interface of the IDE software, one is the SETUP section and the other is the LOOP section. The SETUP section informs it on how to work, and this is where we enter "int neoPixelPin = " and the pin number being used. NEOPIXEL is how the IDE software will try to communicate with the light strip and not all light strips communicate the same. So the one I bought which is a USB 5 volt 2 amp 6 and a half foot COB ARGB strip from PAUTIX, costs about 20 dollars, comes with a remote, a controller, and can be controlled via Bluetooth through an app on your phone which I have been doing until now with several of these strips attached to my computer case in what sort of suffices until I find a better way to display them which is not terribly tidy. 
-Had trouble getting the ide software and Arduino to talk to each other
-had a lot of problems getting it to work. Soldered the white wire of an led strip i had have to the G pin for ground, the red wire to VU and the green data wire for the strip to the s10 pin. I bought a pine64 digital soldering pencil for this job add has fun playing with this toy Asher Linus tech tips suggested it several years ago. I know what you’re going to say, 40 bucks for a soldering iron? Why? You can get one for like ten bucks or whatever. Everyone in my class said that too but I was sold add I bought it since I want to do tons of led light strip projects and saw myself doing a lot of future soldering. Brought it to class today and Doug, my instructor, was playing with it for like 20 minutes. It can be powered by a12-24 volt barrel Jack as well as USB C and can run off of a power brick. It heats up to temperature in about ten seconds if you use a high enough voltage Abe it has a temperature sensor that displays in the screen what the temperature is at all times and You can watch it heat up really fast. It’s got a bunch of special features too. A boost button, a sleep setting, it’ll turn off after ten minutes automatically or whatever you set it to, it rotates the display whichever way your holding the iron, it’s just very cool. Comes with no replacement tips or a Mount to put the iron on when hot unfortunately and IT’s not the only brand that does this now either. 
-trimester for a while, tried messing with the code, added a line that automatically turns the strip blue when it gets power, we realized the power requirements of the strip might be the issue and So we unplugged it from my laptop that although has all USB 3.2 gen plugs, my laptop only sends 900 milliamps to those ports. So with that code that automatically turns the strip blue when it gets power, we tried plugging it into another computer with no results and Then into my 100 watt pd brick again with no results until we decided to desolder from pin 10 or s3, to pin 5 which is d1. S3 is a standard data pin, and IT’s right next to the ground and VU pins so we thought that would work. But the D1 pin is a standard data pin on the other side of the board. Once we’re soldered that, it worked fine. Obviously don’t forget to change it to pin 5 in the ide software.


#include <Adafruit_NeoPixel.h>



// the data pin for the NeoPixels


int neoPixelPin = 5;


// How many NeoPixels we will be using, charge accordingly

int numPixels = 180;



// Instatiate the NeoPixel from the ibrary

Adafruit_NeoPixel strip = Adafruit_NeoPixel(numPixels, neoPixelPin, NEO_GRB);


// Global RGB values, change to suit your needs

int r = 0;

int g = 0;

int b = 255;


void setup() {

strip.begin(); // initialize the strip

strip.show(); // make sure it is visible

strip.clear(); // Initialize all pixels to 'off'

}


void loop() {

// set the colors for the strip

for( int i = 0; i < numPixels; i++ ){

strip.setPixelColor(i, i, 255 - i, 0);

strip.show();

delay(10);

}

// show all pixels



// wait for a short amount of time -- sometimes a short delay of 5ms will help

// technically we only need to execute this one time, since we aren't changing the colors but we will build on this structure

delay(10);

strip.clear();

}


    Monday - 2024-10-07

    Over this last weekend I was playing with the Arduino IDE strip light software and ran into a few snags. I didn't realize that the USB port I was using was so critical. So I got home from class after not getting much of a chance to experiment with the light strip because we spent the whole class trying to make it work, and only solving it in time before class was over. 

     So I got home and immediately lit up the laptop again and went to continue where I left off before taking a load off for the night and I plugged the board in and got one error after another. It kept telling me that there was a fatal esptool.py error, that it couldn't open COM5, file not found, error none2)esptool.py v3.0. I had been trying this for a while with many attempts so a variety of errors were displayed. 


I played with it on and off for an hour or so, going to Device Manager (this is Win11) to look at ports and tried changing ports in the IDE software under TOOLS/PORT:/ (of which I had 5 selected), and after taking more breaks I finally tried different USB ports. I had no idea it was port specific. Apparently I just glossed right over setting this specific port up to communicate with the Arduino in the first place. And so I had no idea that when it was talking about ports, it meant physical USB ports. For some reason, I had it in my head that there are like logical ports that needed to be switched around for some reason. I must have been going over Firewall ports recently or something. But to be fair, when looking at things like Serial ports and Universal Serial ports in Device Manager, a lot of the time it seems to me to be very logical like in a virtual sense rather than physically literal. I mean you're dealing with drivers and stuff like that. Just go with it, I'm a dummy, whatever! 

    If you set up a strip light and a board to work with the Arduino IDE software, keep in mind which port you're using physically because it needs to keep using that port in the software unless you change the port. I did make the mistake of changing the port to port 2 and 3 and 4 before changing what physical USB port I was using and this caused a little extra confusion for a few seconds till I realized, oh yeah, I changed it. I was actually lucky that I just happened to plug the board into the correct USB port the second time around and then checked the ports after a few minutes and saw that port 5, which had disappeared since I had left class, had no reappeared and so I clicked it and pressed the upload button. 


    







    

 This has been Truncat3d 00000000111100010100110______________end of line

Tuesday, September 24, 2024

2024-09-23 - File Monitoring Powershell (.ps1) script

     In short, I have an Ubuntu file server, connected to a windows desktop, through SMB protocol, so the directories can be viewed as you do on a windows computer. For some reason files seem to disappear from the file server in a particular folder, which I frequent so I know I unwittingly delete things. I wrote a PowerShell script to check this folder for me and check what all the files are in the folder and remember them in a list formed by the script, to then be compared to and updated each time the script runs and specifically tell me when files are missing. The script will create a list of the files and then compare that list to the current contents of the folder each time it runs, alerting me if any files are missing.

    I was going to make it a .bat script, but PowerShell has built in functions that would make it easier. And I had to modify my plan so that I would have two scripts, one to create the list of file contents recursively, and a second script that will check that list against the folder contents later. If I want to update the list I have to re-run the first script. That is just it's current iteration though. Perhaps there is a way to get it to run off one script but I don't know, this was just my instructors suggestion on the matter. 

    The first script I wrote is here:

# Script: CreateFileList.ps1


# Open a dialog box for folder selection

Add-Type -AssemblyName System.Windows.Forms

$folder = [System.Windows.Forms.FolderBrowserDialog]::new()

$null = $folder.ShowDialog()


# Get the selected folder path

$selectedPath = $folder.SelectedPath


# Check if a folder was selected

if (-not [string]::IsNullOrEmpty($selectedPath)) {

    # Define the output CSV file

    $csvFile = "file_list.csv"

    

    # Get the list of all files and folders recursively

    $fileList = Get-ChildItem -Path $selectedPath -Recurse | Select-Object FullName


    # Export the list to a CSV file

    $fileList | Export-Csv -Path $csvFile -NoTypeInformation


    Write-Host "File list created and saved to $csvFile"

} else {

    Write-Host "No folder selected."

}

The second script is here:

# Script: CheckForMissingFiles.ps1


# Open a dialog box for folder selection

Add-Type -AssemblyName System.Windows.Forms

$folder = [System.Windows.Forms.FolderBrowserDialog]::new()

$null = $folder.ShowDialog()


# Get the selected folder path

$selectedPath = $folder.SelectedPath


# Check if a folder was selected

if (-not [string]::IsNullOrEmpty($selectedPath)) {

    # Define the path to the CSV file

    $csvFile = "file_list.csv"

    

    # Check if the CSV file exists

    if (-not (Test-Path $csvFile)) {

        Write-Host "CSV file not found. Please run the script to create the file list first."

        exit

    }


    # Import the original file list from the CSV

    $originalList = Import-Csv -Path $csvFile | Select-Object -ExpandProperty FullName


    # Get the current list of files and folders recursively

    $currentList = Get-ChildItem -Path $selectedPath -Recurse | Select-Object -ExpandProperty FullName


    # Compare the original list with the current list

    $missingFiles = $originalList | Where-Object { $_ -notin $currentList }


    if ($missingFiles) {

        Write-Host "The following files/folders are missing:"

        $missingFiles

    } else {

        Write-Host "No files/folders are missing."

    }

} else {

    Write-Host "No folder selected."

}

I tested the script. When you click it, you have to right-click on it and select to run in PowerShell, because left-clicking it just opens it for editing for reasons I don't yet understand. Then it will open a window that will have you specify what folder you want to take an account of and it will take a moment depending on the size of the folder and how many files it contains, but it will then export a .csv file that will show all the contents of the folder with full names and their file formats. 

    The second script when run didn't seem to produce any results. This is when my instructor was looking at it and checked the end of the second script and realized that it spits out the results but it isn't pausing at the end so I have any time to even register that results were given before they disappear. So we added a pause at the end. 

    So literally just like this for the end of the second script:

} else {

    Write-Host "No folder selected."

}


pause

That resulted in it leaving an open prompt window that now shows that there are many missing files, so technically the two scripts in conjunction with each other worked perfectly. And they work with a networked drive located on a Linux system, from a Windows PowerShell script. So that was a happy result. 

    The problem now is that when the second script compared the results against the .csv of the first script of the file contents where files seem to magically disappear all the time and I need to know which ones, the second script returned results for many missing files that I then went to check to see if they were gone and they were still there. What gives? However I did notice something. 

    A movie file I was supposedly missing but confirmed was not missing on my server was named: "Clint Eastwood Dollar Trilogy I A Fistful Of Dollars 1964 Clint Eastwood Marianne Koch José Calvo.mp4" while the name given to it by the first script which exports the .csv file calls it: "Clint Eastwood Dollar Trilogy I A Fistful Of Dollars 1964 Clint Eastwood Marianne Koch Jos? Calvo.mp4"

    Instead of the accent over the E in 'Jose Calvo', the script or the character base used to create the script didn't recognize it and put "Jos?" instead of Jose with the accent over the E, and so this was counted as one of the missing files from the original list. The second script saw the file with the accent over the letter E on this file and similar discrepancies in all other cases, it saw those correctly named files on the server but is not programmed to tell me that "hey, this file with the question mark wasn't found but one without it was found that was not included in the .csv file", and it also isn't programmed to know the difference. So it didn't see script 1's error with the question mark replacing the E with the accent and then script 2 returned the output saying that the file with the question mark couldn't be found. And it did the same with all other files that it found the same discrepancy with. 
    I emailed my instructor about it and then researched online if this was a problem with the first script not using UTF-8 or Unicode because I know from my A+ Fundamentals certification that ASCII only has like 128 characters or something like that but Unicode intentionally has millions and is still growing in order to accomodate every situation and I found that making this one change to have script 1 utilize Unicode was a very simple change. I added the change, so instead of the line in script 1 saying part way through the script:

    # Export the list to a CSV file

    $fileList | Export-Csv -Path $csvFile -NoTypeInformation

    Write-Host "File list created and saved to $csvFile" 

    It now instead says:

    # Export the list to a CSV file

    $fileList | Export-Csv -Path $csvFile -NoTypeInformation -Encoding UTF8

    Write-Host "File list created and saved to $csvFile"

    I made the change in class and tested it in front of Doug, my instructor, and it returned nothing, the result was blank. I threw up my hands in frustration like, "What is the problem now!?" 
    Before I could even fully express this thought, Doug said, "Oh look, it worked" or something like that and I thought he was being sarcastic and after expressing my frustration, he said, "No, it did work, look, no files were listed in the return, isn't that what we want--for nothing to be missing?"
    "Oh...it worked! I don't believe it!"
    And you can't know all the baggage behind this but I deal with a lot of frustration over various difficulties with things like this, so when Doug said, "And you figured out the problem and fixed it without any of my help", I realized what he was saying and was sort of elated. 
    This technically isn't the end of the story yet though because there are several changes I want to make to these scripts, potentially combining them if possible, configuring them so the second script doesn't require that the .csv from the first script be relocated to the folder in question in order to run the comparison properly, I would like to just specify that it's here and the folder in question is over there. And there are other changes I would like to make too. 

    Thursday 2024-09-26

    I went back into the second script today and made some changes so that the system opens a window and asks which folder I'd like an accounting of as well as as opening another window to specify where the .csv file is located. I changed it to the following:

# Script: CheckForMissingFiles.ps1

# Open a dialog box for folder selection
Add-Type -AssemblyName System.Windows.Forms
$folder = [System.Windows.Forms.FolderBrowserDialog]::new()
$null = $folder.ShowDialog()

# Get the selected folder path
$selectedPath = $folder.SelectedPath

# Check if a folder was selected
if (-not [string]::IsNullOrEmpty($selectedPath)) {
    # Open a dialog box to select the CSV file
    Add-Type -AssemblyName System.Windows.Forms
    $csvFileDialog = [System.Windows.Forms.OpenFileDialog]::new()
    $csvFileDialog.Filter = "CSV Files (*.csv)|*.csv"
    $null = $csvFileDialog.ShowDialog()

    # Get the selected CSV file path
    $csvFile = $csvFileDialog.FileName

    # Check if a CSV file was selected
    if (-not [string]::IsNullOrEmpty($csvFile)) {
    }

    # Import the original file list from the CSV with UTF-8 encoding
    $originalList = Import-Csv -Path $csvFile -Encoding UTF8 | Select-Object -ExpandProperty FullName

    # Get the current list of files and folders recursively
    $currentList = Get-ChildItem -Path $selectedPath -Recurse | Select-Object -ExpandProperty FullName

    # Compare the original list with the current list
    $missingFiles = $originalList | Where-Object { $_ -notin $currentList }

        if ($missingFiles) {
            Write-Host "The following files/folders are missing:"
            $missingFiles
        } else {
            Write-Host "No files/folders are missing."
        }
    } else {
        Write-Host "No CSV file selected."
    }
pause

I had to have Doug's help to make a few edits because it broke before it even reached the pause at the end of the script. I had a moment where I thought I deleted a curly que bracket and so I put what I thought I deleted back in and that was one of the things that broke the script. 
    I am now thinking of changing what the line at the end says which tells me that the script finished and no files were missing, and I had the idea to do something like ASCII art except this is Unicode I'm using PowerShell. So I am going to try to write the echo command on every line and create some sort of unmistakable image that when I see it, it will signal to be that I am done without any confusion. 


        Saturday 2024-10-19

        Remember how this all came around because I would occasionally discover files missing from folders I realized were usually commonly accessed folders? I had been thinking about what can be done to minimize the kind of traffic on folders or files that I definitely don't want deleted but due to high traffic, unwittingly get deleted by accident. And the solution for my mom was simple--that she not have write access to her own movies folder so she can't delete anything, and then to make it easier for me to put movies in her folder for her, I linked her movies directory in Linux to my movies directory so I can easily add things or whatever, but then I decided to just put her directory in mine and then relegate her access to just my movies and her movies, and by sharing our movie folders with each other I can eliminate unwanted, space hogging copies. And then the idea hit me: what if I put all of my files in a folder that I likewise will also not be accessing hardly ever except to put files into it, which is far rarer, nearly eliminating the traffic, and then in Windows, create shortcuts in the folder directly before it in the file path? 
    So I did this. It worked. Now I can access everything and if a shortcut gets deleted, it will still be annoying but at least I can keep track of it now with this file monitoring script file and then just go into the folder with all the actual files and grab another copy to make a shortcut with. 
    I had a moment where my heart fell through the floorboards when I opened a common file that also had common association with another file, and I dropped the secondary file into the program that runs all these files to see if the shortcut of the secondary file would still work and it did not. I then considered that since these secondary files are so incredibly small it's not a big deal to just bite the bullet and have redundant copies of those in the above folder of the file path, but then I realized the reason it wasn't working wasn't because the program couldn't open the file for the shortcut in the above folder, but rather because I had a bunch of computer errors that were annoying me, and had just rebooted, and since I seldom reboot unless I have to due to all the clockwork I have going on with my really stupid smart TV and AV receiver and my desktop and the slightest little thing will cause my smart tv to forget that I want my audio to come from my computer and simply play out of the speakers connected to the AV receiver and not my TV. All of that to say that the reason the secondary file shortcuts weren't working was all because of rebooting my PC, I had forgotten that I needed to log back in to SMB to access my file server. And there, it worked fine. 





















This has been Truncat3d 00000000111100010100110______________end of line


Thursday, September 5, 2024

2024-08-29 - Creating Ducky Scripts for Flipper Zero

 I bought a Flipper Zero, but this isn't going to be much of a talkative explanation about anything. This will be mostly technical. 

My instructor, Doug, says that if I can get the Flipper using Ducky script to open a .txt file on a windows computer then you can get it to do anything. I did already write two .bat scripts to keep on a jump drive that are meant for pranks, and they both utilize a .vbs script to keep them silent (invisible to the user) and also insert the .bet scripts into RAM so the jump drive can be removed. We are going to attempt to convert all this to Ducky script so that this can all be done through the Flipper Zero. 

I created a file with no text to put in the file but to get the Flipper to create a .txt on a windows computer in Ducky script, here is what you need to write:

DELAY 500

GUI r

DELAY 300

STRING notepad

ENTER

DELAY 500

STRING This is a test file created by Flipper Zero.

DELAY 500

CTRL s

DELAY 500

STRING C:\Users\%USERNAME%\Desktop\flipper_output.txt

ENTER

DELAY 500

ALT f4

 So to explain what these commands do in Ducky script, the DELAY commands are necessary so that commands have time to finish executing before the next one is carried out. GUI is the command for pressing the windows key through the keyboard since the Flipper is acting like an HID device (keyboard). So GUI r means WINDOWS RUN which will bring up the Windows Run dialogue box. Next we have STRING notepad, this command tells the Flipper to write in the selected field the word NOTEPAD. ENTER obviously tells the Flipper to press the enter button, executing the command. When the file opens, we have another STRING command. This time the selected field is notepad itself and whatever you type after the word STRING, that will be typed by the Flipper into notepad on the windows computer as if you were typing it yourself on the keyboard. CTRL s simply tells the Flipper to save the notepad file on the windows computer. "STRING C:\Users\%USERNAME%\Desktop\flipper_output.txt" tells the Flipper to type the file path and name of the file into the save as field. So I did not know that you could dictate the file path from the file name line followed by the filename so you wouldn't have to type more than one thing. Cool! And just so you know, %USERNAME% is an environment variable. So you don't need to know the username, you can simply type %USERNAME% in the string and the Windows computer will assume that whatever the user is, to select that file path. ENTER clicks the save button. ALT f4 is the keyboard shortcut in Windows for closing the selected windows (program or folder), which in this case is closing notepad. 

GUI r               # Opens the Run dialog

STRING notepad       # Types "notepad" to launch Notepad

ENTER               # Opens Notepad

DELAY 500           # Waits for Notepad to open

STRING This is a test file created by Flipper Zero.  # Types text into Notepad

CTRL s              # Simulates Ctrl + S to open the Save dialog

DELAY 500           # Waits for the Save dialog to appear

STRING C:\Users\%USERNAME%\Desktop\flipper_output.txt  # Types the file path and name

ENTER               # Saves the file on the Desktop

DELAY 500           # Ensures the file is saved

ALT f4              # Closes Notepad 

    Now if you want to run .bat files on the windows computer through Ducky script off the Flipper, then there are two ways to do this. First you can use the method above to have the Flipper write in notepad a file and save it to then be run, or the second method which I prefer, is to have the Flipper open either command prompt or PowerShell to then run the commands from there without saving a file to the computer.  


    Thursday 2024-09-12 update 

My classmate, Pierce, wants a Flipper Zero badly, but he doesn't have the money for one. I thought zI might fan the flame to get him to want to buy one by letting him play with mine and the benefit for me is that he helps me to create Ducky scripts for the Flipper. So most of the time when I pull it out he will forgo other projects and work on it, in fact all last weekend he worked on it for hours at a time trying to figure out how to convert into Ducky script the CAPS LOCK EVERY FIVE SECONDS prank script Doug and I wrote together with parts in .bat and another part in .vbs. It uses both because of two problems, which will haunt us. 

    It needs to run without the source file so it can be stored on a thumb drive, activated on someone else's computer, and you can run away with the thumb drive and it will keep turning caps lock on and off every five seconds until they figure out how to cancel it. It's not hard to cancel, you just need to reboot or open task manager and under BACKGROUND PROCESSE< end the task WINDOWS COMMAND PROCESSER. So you need to use the line in .vbs: 

CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False. 

    CreateObject("Wscript.Shell") creates an instance of Wscript.shell so that it runs without the source file and WScript.Arguments(0) & """", 0, False says that it needs to run silently or rather, without a command prompt window. Because it negates the point of the prank if the user sees this caps lock loop running in a command line window and to stop it they can simply close the prompt and the process is ended. 

    We worked today for hours to try and figure out how to convert this into Ducky script. Here's the problem, it all can technically be multiple scripts written in one ducky script because the flipper acts as a keyboard, which when connected to the host computer, and the code is injected, it will open a run window in Windows with the command:

GUI r

And then it'll specify to use powershell, string, and then write the lines of code that powerhell will deduce is .bat, and each line of code is separated with a semicolon so it knows how to differentiate between separate commands on different lines that are all wrotten in one line in the run window. The run window allows us to avoid opening the powershell window so that it runs in the background, however the problem we run into here is that you can't run .vbs commands in the run window. And when Doug and I were writing the .bat script for the caps lock prank script, we were trying to figure out how to make this run in the background. We tried and tried and tried for weeks to get .bat to run the window in the background. We couldn't figure out how to do this. At this point it was probably back in January or March so I don't remember much about what we did. But I eventually learned that while this is either really hard to do or impossible in .bat, we started to have another problem as well, once the thumb drive is removed, the script stops running and hilariously, it starts running again when the drive is plugged back in. So we tried to solve both problems and this was extremely challenging. 

    I had eventually asked Doug what he did after learning that other computer languages ran in the background much more easily than .bat does. Since I had been programming the weather display in python, and python turned out to be one of the many languages that runs in the background easily, Doug told me that there is one huge problem with this, python is not natively installed on all windows machines, rendering this method useless because in order to pull a prank on anyone you wish, it has to be in a language that everyone's windows computer can run. You have to install Python in order for this to work. 

    I toyed with the idea of having the script install Python at the beginning of the script, or a separate script that does so, so that the other scripts can run in python. But I think you need permissions to do this, so that's out. Doug helped me and we discovered multiple times through multiple methods, including stackoverflow.com, that the only way to run invisibly is to write a .vbs script that makes it run in the background, and around this time Doug parted with the information that he wrote all his prank scripts in .vbs but that it would be really hard for me to do. And another problem is that if I take on projects in .vbs, no one is hiring for that, so it'd be a waste of effort. But we wrote the separate .vbs script creating the object Wscipt.shell and giving zero arguments so that it would not open a window, but creating this object would temporarily allow it to run without eh source file. 

    In Ducky script, you can tell it all in one script to write multiple scripts, and even define different languages, you just have tow rite everything in Ducky syntax with the addition of the code to be written on the host computer in the other program languages with their proper syntax, since Ducky is only telling the Flipper to write it, it doesn't actually know what these commands are, it doesn't need to know what they are doing or even how to interpret the language. The host computer will do all that, the Flipper just needs to write it. And Ducky actually looks pretty straightforward to write in. From what little I know, the Syntax is kind of minimal and clean looking. And it has the added bebenfit that you can simply write it as a .txt and save it on the Flipper. The Flipper will run it in Ducky, no special Ducky extension required. 

    But since the run window cannot run .vbs, we now have to solve this problem all over again if we want to run all these prank scripts from the Flipper. Obviously this isn't crucial. I have a thumb drive and the original scripts for these pranks Doug and I created on the thumb drive and I can simply roll up to a computer and activate said scripts and run away. But the cool thing about having a Flipper Zero is that it is built for this, and you can keep it in your pocket all the time. It acts as a remote, a hacking device, a thumb drive with keyboard functionality, I can use it to insert usernames and passwords into foreign computers without having to go through the trouble of holding my phone with Bitwarden running in one hand and typing the password and username in another computer, I can simply plug in and as long as I write the script properly, it will enter the username and password without issue. There are so many cool things that it does and I want to take advantage of all of them. I paid nearly $200 for this thing so I want to get as much out of it as I can, and the reason I paid that money is so that I could use these cool methods and learn how to program it so that it will do what I want, which sounded cool and I felt would also make me more employable. 

    So far, the thumb drive scripts are made up of three scripts, one activation script in .bat, the actual ccaps lock every five seconds script in .bat, and then the .vbs which hides it and runs it in the background. 

    Doug had Pierce and I figure out how to get Ducky to open notepad and write out the script and then save it, which is where I learned a week or two ago that it can name and save the file where you want it all from the filename line in the save as window. So we successfully got it to do that and Doug was now satisfied that since we could do that, we can just copy and paste any script into the existing template that opens run, which opens notepad, and then saves it where we want it, and then runs it. 

    I had a problem with this. It's a prank script. And to leave it on someone computer runs the risk of them finding it and being able to use it for free without going through all the effort I am going through. I prefer to keep it for myself unless I decide to share it, which I will do easily, I just want it to be my choice to do so. And also, I hate the idea of leaving a file on a host computer which may or may not cause problems later. If you do this prank again to the same person on the same computer, it may try to write the file just for the computer to say this file already exists, would you like to overwrite it and the script won't have that programmed in by default and on purpose because it will not be necessary on any computer that it hasn't been run on before. To add this step just in case may run the risk of the computer accidentally misinterpreting that extra command to yes, please overwrite and instead perhaps changes something else when the computer does not ask if you want to overwrite a file. 

    So we spent much of last night trying to figure out how to get .bat to hide the file and run it in the background. We wanted to run everything from the run window because then it activates the script without opening a permanent window and it can run .bat. The computer can also run power shell, which I think is .ps1 or .ps or something like that, I forgot, it has been a few months since I needed to know this for an exam. The computer can run .vbs but not from the run window and also Doug warned that employers are not hiring for this anymore since it is an outdated language I guess.    

    I scoured stackoverflow.com for other answers but everybody that answered the question about hiding the shell window or running in the background all said you needed .vbs. I stopped and thought for a minute, if .vbs is still the only one that can do this, then is it really that outdated? A little while later, Doug reminded us that we could either write a command to do the notepad option and thenw rite a command that will then delete it once its no longer needed, or we can put it in a temp folder called:

%TEMP%

    So far, the Ducky script looks like this:

DEFAULT_DELAY 100

GUI R

STRING Notepad 

ENTER 

STRING @echo off

ENTER

STRING set "Toggle=0"

ENTER

STRING :loop

ENTER

STRING if %Toggle%==0 (

ENTER

TAB

STRING echo Turning Caps Lock on

ENTER

TAB

STRING set "Toggle=1"

ENTER

STRING ) else (

ENTER

TAB 

STRING echo Turning Caps Lock off

ENTER

TAB

STRING set "Toggle=0"

ENTER

STRING )

ENTER

STRING powershell -command "$wsh = New-Object -ComObject WScript.Shell; $wsh.SendKeys('{CAPSLOCK}')"

ENTER

STRING timeout /t 5 /nobreak >nul

ENTER

STRING goto :loop

CTRL S

STRING %TEMP%\CAPSLOCKAGAIN.bat

ENTER

GUI R

STRING powershell

ENTER 

STRING $batFileContent = Get-Content "$HOME\AppData\Local\Temp\CAPSLOCKAGAIN.bat"; $tempFile = [System.IO.Path]::GetTempPath() + 'script.bat'; Set-Content -Path $tempFile -Value $batFileContent; Start-Process -FilePath $tempFile -WindowStyle Hidden; Remove-Item "$HOME\AppData\Local\Temp\CAPSLOCKAGAIN.bat"

ENTER

    So in case this matters, Pierce's version he started working on last weekend is called CAPSLOCKAGAIN in order to differentiate it from mine which is unconverted to Ducky. 

    It does work but one of the problems we came across was that it once activated, there's no WINDOWS COMMAND PROCESSOR task to end in task manager under BACKGROUND PROCESSES. So there's no way we know of yet to end this prank without rebooting which can get to be too much trouble, especially when testing and you have to reboot all the time. These pranks were not meant to be so vicious. I would like to choose how vicious I get and the more vicious while not intending to be so, the more I feel obligated to let the victims of these pranks off the hook easily and make it up to them.  







2026-05-10 - MWB constant reconnect fix and all other ultimate fixes until now for my whole home computer setup

     Now I was fixing a problem with a couple things that annoy me on my laptop. Every once in a while I manage to fix another little thing ...