how I can give permission to database for modification? - sqlite

I am using python flask application as backend in my website I'm using apache2 in ubuntu VPS
the website is live but I am getting the error while signup and I can't able to post or like or comment on that site.
I checked that error by using command
cd /var/log/apache2 && cat error.log
the error was
sqlalchemy.exe.OperationalError : (sqlite3.OperationalError) attempt to write a readonly database.
It means It do not have access to edit the sqlite3 DB file.
I tried all chmod command but still I can't able to solve the issue.
help me pleaee
sudo chmod 666 /var/www/webApp/webApp/buzz.db sudo chown root:www-data /var/www/webApp/webApp/buzz.db sudo chmod 660 /var/www/webApp/webApp/buzz.db
this are the some commands that I used

Related

Cannot update plugin for WordPress on localhost on Mac

I'm running WordPress 5.8.1 on localhost, on my Mac. I am unable to update plugins. I get this error:
Update failed: Could not create directory.
I've tried changing the permission on the wp-content folder as suggested here like this:
sudo chmod -R 755 wp-content
but it didn't work. I still get the error message.
I also tried this
sudo chown -R _www wp-dir
sudo chmod -R g+w wp-dir
still no luck.
Ok, Managed to find the issue. Apache uses a different username so this command was ok:
sudo chown -R _www wp-dir
But my username wasn't _www (hence my error)
you can find the apache username in the etc/httpd.conf file

"./ngrok authtoken <my_authtoken>" not working

I've got kali linux from microsoft store.
I wanted to run ./ngrok authtoken <my_authtoken>
but got -bash: ./ngrok: cannot execute binary file: Exec format error
so I tried chmod +x ./ngrok authtoken <my_authtoken> and sudo chmod +x ./ngrok authtoken <my_authtoken>
but either way I get chmod: cannot access 'authtoken': No such file or directory chmod: cannot access '<my_authtoken>'
what should I do?
I really need to run ./ngrok authtoken <my_authtoken>
P.S: I want to use blackeye and when I chose the number it downloaded Ngrok
edit 1: I downloaded another version from https://ngrok.com/download and I removed the previous Ngrok in blackeye directory and unziped the new one instead.
now I'm getting bash: ./ngrok: Permission denied
edit 2: It's been 12 days with no accurate answer guess I gotta get the real Kali Linux and the problem is the windows version.
Always Google and try to find an answer before you post a question.
Your first error (-bash: ./ngrok: cannot execute binary file: Exec format error) is probably because your trying to run a program made for a different architecture such as x86 or ARM (see https://askubuntu.com/a/648558).
Your second error (chmod: cannot access 'authtoken': No such file or directory chmod: cannot access '<my_authtoken>') is because your trying to run a command from within chmod, you have to chmod the file then run it.
Your third error (bash: ./ngrok: Permission denied) is because you need to chmod the file to an executable before you can run it, and there is no need for sudo unless chmod returns chmod: cannot access '<yourfile>': Permission denied then you should use sudo.
What your should run is:
curl -L https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip -o ngrok.zip
unzip ngrok.zip
chmod +x ngrok
./ngrok authtoken <myauthtoken>
this was the only thing that work for me:
curl -s https://ngrok-agent.s3.amazonaws.com/ngrok.asc | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null && echo "deb https://ngrok-agent.s3.amazonaws.com buster main" | sudo tee /etc/apt/sources.list.d/ngrok.list && sudo apt update && sudo apt install ngrok

Reverse a chown command

What I did
Last night while updating plugins on my Wordpress site my site crashed and I had to spin up a new server and restore from a Vaultpress backup. Once the restore had finished propogating I was unable to update the plugins so I ran the command
chown -R www-data:www-data /var/www/html/
I got the response
-bash: cd: /var/www/html: No such file or director
So after a bit of snooping I determined my directory path was off slightly. So, I ran
chown -R www-data:www-data /var/www/html/html.old
What happened
After running the chown command when I attempt to install plugin updates I get this in-browser error message:
Not Found
The requested URL /wp-admin/plugins.php was not found on this server.
Apache/2.4.29 (Ubuntu) Server at $domain Port 80
My question
Obviously I broke something when I ran the chown command, so how do I undo the command that I ran?
Any help would be very much appreciated
I don't think it's possible to revert the chown command unless you have a backup or know which file belongs to whom or all files belonged to a single user, which I doubt is the case here.

Permission Denied - \tmp\hive in sparklyr

I am trying to copy R dataframe to Spark 2.0.1 using copy_to function but it says
The root scratch dir: /tmp/hive on HDFS should be writable. Current permissions are: rw-rw-rw-
I executed winutils.exe to change the permissions but still I get the same Exception of permissions.
%HADOOP_HOME%\bin\winutils.exe chmod 777 \tmp\hive
I tried other variants of the command like -
%HADOOP_HOME%\bin\winutils.exe chmod 777 C:\tmp\hive
%HADOOP_HOME%\bin\winutils.exe chmod 777 /tmp/hive
%HADOOP_HOME%\bin\winutils.exe chmod 777 -R \tmp\hive
but nothing worked. I still get the error
I tried using advanced permission and all my permissions were set to rwx. I tried running ls -l command but was getting an error;
C:/> %HADOOP_HOME%/bin/winutils ls C:/tmp/hive
FindFileOwnerAndPermission error (1789): The trust relationship between this workstation and the primary domain failed.
My system was unable to connect to it's domain controller so I had to connect to VPN and then execute C:/> %HADOOP_HOME%/bin/winutils chmod 777 /tmp/hive.
It worked!

New created wordpress by cloud launcher Automatic Update Failed

I use the Google cloud launcher to start a fresh Wordpress.
with the following VM :
Machine type
f1-micro (1 vCPU, 0.6 GB memory)
CPU platform
Intel Ivy Bridge
Zone
us-central1-f
It was launched with an older version : 4.5.3-1
I tried to do an automatic update. it didn't work, and showed
The update could not be unpacked
Installation Failed
I tried following tutorials on
https://community.bitnami.com/t/automatic-update-wordpress-4-6-is-not-working/43814/4
Connect to your server via SSH and execute:
sudo chown -R bitnami:daemon /opt/bitnami/apps/wordpress/htdocs/wp-content
sudo chmod -R g+w /opt/bitnami/apps/wordpress/htdocs/wp-content
Doesn't work for my case,
I also tried to use follow manual update https://codex.wordpress.org/Upgrading_WordPress.
Delete the old wp-includes and wp-admin directories on your web host (through your FTP or shell access).
using filezilla ftp , i get a lot permission denied errors of different file names.
Error: rm /opt/bitnami/apps/wordpress/htdocs/wp-includes/customize/class-wp-customize-partial.php: permission denied
Please advice. how can i update this thing?
Anyone facing the same issue?
Google should put back their own wordpress.
You can try the following workaround to upgrade your old WordPress to the latest version:
Open /opt/bitnami/apps/wordpress/htdocs/wp-config.php
Look for define('FS_METHOD', 'ftptext');
Replace it with define('FS_METHOD', 'direct');
Change the permissions of /opt/bitnami/apps/wordpress/htdocs to allow the server user (daemon) to make the modifications. You can do that by executing sudo chown -R daemon /opt/bitnami/apps/wordpress/htdocs
Go to the WordPress admin panel and perform the automatic upgrade.
Change the permissions of /opt/bitnami/apps/wordpress/htdocs to it original ones. To do that, execute sudo chown -R bitnami:daemon /opt/bitnami/apps/wordpress/htdocs
Replace again the define('FS_METHOD', 'direct'); line with define('FS_METHOD', 'ftptext'); in the wp-config.php file
Hope it helps.

Resources