Calibrating the SenseHat Raspberry Pi - coordinates

Currently I have been trying to set up a functioning compass on the raspberry pi using the SenseHat and I am using Raspbian Stretch, and I have run into an issue where the SenseHat is only picking up coordinates in the East to the South, essentially picking up coordinates in the 100s only. I have seen many things including on this site telling to install octave -y and then doing whatever. However, I don't know if it is because it is old and with the newest version of Raspbian it doesn't work anymore or something but I am running into error messages upon just trying to install. Does anyone have a way to recalibrate or just fix the coordinates the SenseHat is picking up? Getting something like this: E: /etc/ca-certificates/update.d/jks-keystore exited with code 1. done. octave , with other issues

Edit: octave actually exists on the newest raspbian. There is however a specific case in which you must do a sudo apt-get update, sudo apt-get upgrade then follow up with another update. Without the update after upgrade octave will not install. It is also better to use sudo apt install octave rather than sudo apt-get octave -y.

Related

ERROR: gcloud crashed (ModuleNotFoundError): No module named 'distutils.spawn'

I have been deploying my service on App Engine for a long time now and never had an issue until today.
Command to Deploy
gcloud app deploy app.yaml
Output
Beginning deployment of service [default]...
Building and pushing image for service [default]
ERROR: gcloud crashed (ModuleNotFoundError): No module named 'distutils.spawn'
I just deployed this morning with no issues and randomly when I tried to redeploy now I get the above error. Hopefully someone can help figure out what caused this issue.
For info:
app.yaml
runtime: custom
env: flex
manual_scaling:
instances: 1
resources:
cpu: 1
memory_gb: 4
disk_size_gb: 10
Gcloud version
$ gcloud --version
Google Cloud SDK 341.0.0
alpha 2021.05.14
beta 2021.05.14
bq 2.0.68
core 2021.05.14
gsutil 4.62
minikube 1.20.0
skaffold 1.23.0
I had a similar issue, on my case this was the solution:
sudo apt-get install python3-distutils
Same exact problem.
Building and pushing image for service [default]
ERROR: gcloud crashed (ModuleNotFoundError): No module named 'distutils.spawn'
This issue seemed to be in the snap install of google-cloud-sdk in Ubuntu 20.04.2 LTS (You can select it pre-installed during the ISO setup.. DONT)
I was getting this in 18.04 as well
FINALLY solved it..
But.. I had to make sure I did not snap install google-cloud-sdk
I also..
sudo apt update
sudo apt upgrade
Then I made sure the snap install was not installed. (After a fresh install of Ubuntu). Sense I use dockerfiles it's easy for me to zap a dev environment and get it back.
But Id imagine if you can't zap your os and make sure not to let the OS put it's snap install of google-cloud-sdk.. You could snap remove google-cloud-sdk and then hunt for all it's configuration files.. And remove them.
At that point
https://cloud.google.com/sdk/docs/install#deb
Follow that... I did so exactly... FINALLY seemed to work. I used the apt install route they explain.. NOT the snap.
I tried all the pip install sudo apt-get install python3-distutils Till I was blue in the face... NADA.
somehow.. The Snap being present puts PATH settings that use the wrong distutils.
On my box now that I search for it.. In Totally fresh OS state... No Snap install and going through exactly the cloud.google.com/sdk/docs/install#deb work..
Here is distutils everywhere on my box in Ubuntu 20.03.2 LTS
$ sudo find / -name distutils
/snap/lxd/19188/lib/python2.7/distutils
/snap/core18/1944/usr/lib/python3.6/distutils
/snap/core18/1944/usr/lib/python3.7/distutils
/snap/core18/1944/usr/lib/python3.8/distutils
/usr/lib/python3.8/distutils
/usr/lib/python3.9/distutils
/usr/lib/python2.7/distutils
Note.. There's no google-cloud-sdk in the snap!!
The gcloud app deploy FINALLY works!! Passes the part where it starts to deploy.
But as the others in this.. It happened completly random.
All I can guess is...... Something clobered distutils as an update somewhere and started pointing to a garbage path.
Make sure you search for distutils find out where it is.. what's referencing it.. Somewhere in that mess you can fix it.
One thing I was able to discover is this problem will come default from 20.04.2.
I downloaded the most recent iso.. thinking it was an 18.04 issue.
Installed it fresh into Virtual Box.. And got exactly this same issue. So my solution fix (no SNAP).. Is against a totally clean 20.04.2 brand spanking new Ubuntu LTS VM. Default everything.
===============
Regarding the random one day it worked.. the next it didn't...
Here's the thing about snaps in Ubuntu:
https://www.google.com/search?q=Do+snap+packages+update+automatically%3F&rlz=1C1CHBF_enUS834US834&ei=ygynYJGRIo3f-gSLzb3YDg&oq=Do+snap+packages+update+automatically%3F&gs_lcp=Cgdnd3Mtd2l6EAMyCAghEBYQHRAeUJ-TCVifkwlgj5kJaABwAXgAgAFziAHVAZIBAzEuMZgBAKABAqABAaoBB2d3cy13aXrAAQE&sclient=gws-wiz&ved=0ahUKEwiRnrfXz9nwAhWNr54KHYtmD-sQ4dUDCA4&uact=5
"Do snap packages update automatically?
Snaps update automatically, and by default, the snapd daemon checks for updates 4 times a day. Each update check is called a refresh."
so that's how it randomly broke if you used a snap

ubuntu 16.04 LTS login loop after updating driver nvidia-396

I have an issue on login to my computer when nvidia-396 is installed. It returns to login screen after giving error message pop up. When I remove the nvidia* and restart lightdm it works fine.
Could you please help me fixing this.
Thanks.
I had the same issue with this driver.
my system is:
Nvidia gtx 1060 (6gb)
AMD Fx 8350
ASUS motherboard
I was using the 390 driver ( 394.48 ), then upgraded to 396 and got this 'lightdm<->nvidia driver' problem.
It seems that mostly users are getting this bug too.
Unfortunately there's no solution yet, the nvidia-396 driver is still in beta according to Nvidia drivers page. Just purge the 396 driver and switch back to an older version, then everything should work fine.
If not, see this askubuntu question and this Nvidia topic (only step 2, 4 and 5 are necessary for you, but yet the whole tutorial may become usefull) , it helped me to get the drivers working again after i messed up badly some files and packages.
This is what i did, no login screen after upgrading the Nvidia driver, it works for me.
login with console Ctrl+Alt+F1
login as root and remove the read-only file system by mounting mount -o remount,rw /
stop lightdm , /ete/init.d/lightdm stop. (if this is in inactive(dead) just copy backup xorg.conf.new file in your root directory and copy file to /ete/X11/xorg.conf and reboot)
then remove old nvidia Drivers, apt-get remove --purge nvidia-*
add the driver repository add-apt-repository ppa:graphics-drivers/ppa
apt-get update
apt-get install nvidia-387
apt-get install ubuntu-desktop
start lightdm /etc/init.d/lightdb start. or reboot.(Finished)
I was able to fix by fully removing nvidia drivers with bumblebee.
sudo apt purge nvidia* bumblebee
And reinstalling
sudo apt install nvidia-396
Problem description
Nvidia-396, which you have installed intently or unawarely auto-installed by other related package, such as swig, can not properly used in ubuntu 16.04.
Solution
The best way to solve the problem would be ever find the miss-operation firstly. To do this, firstly, you need to check your command history by :
vi ~/.bash_history
and then search "sudo" keywords which indicate essential command, and find suspects. In my case, it is
sudo install swig
Finally, revert it by :
sudo apt-get purge swig
CAUTION : PLEASE NEVER DO
sudo apt-get upgrade
It will install newest package of your whole system which will include nivida-396
For me I just deleted the .Xauthority and two more of them having different suffixes from my home folder and it was working again fine!

how to install postgresql on Linux

I'm new to Linux and have been using KDE for a little while. I'm working on learning more ruby on rails. The book I'm reading uses postgresql but I cannot find a walkthrough of installing postgresql on KDE. On this page - https://yum.postgresql.org/repopackages.php#pg10 - it doesn't list an rpm for KDE so I'm not sure if there's another one I can use or not. I don't know enough about Linux/KDE yet to know. Does anyone know if I can use any of the packages on that page or if there's another way to install postgresql on KDE?
Simple solution
sudo apt-get update
sudo apt-get install postgresql postgresql-contrib
sudo -i -u postgres
psql
So KDE is your desktop. It could be used on almost any operating system, and probably doesn't determine your install. It's more about distros/OS that you're on. So, what OS are you on? Wild guess Fedora or Ubuntu. Here are the install guides for each:
Fedora: https://fedoraproject.org/wiki/PostgreSQL
Ubuntu: https://www.postgresql.org/download/linux/ubuntu/
Neither is as bad as it seems. Just take them step by step.
BTW, in the Linux world the command line is king. At first, this will seem daunting, but after a while, you'll find it faster for many things. Maybe Learn Enough Command Line to Be Dangerous would help.

Remove program that isn't listed in apt-get

I installed the program dolphin-emu on Ubuntu 16.04, but wanted to remove it and install a different version. I tried removing it but I can't see the package when searching for "dolphin" using "sudo apt-get --purge remove ..." or "apt list -installed" (the package should be called dolphin-emu). However I can still run the application from the user interface in Unity so it is clearly still installed.
I tried installing the version I want but it does not come up when I try to run it, only the older version that I want to get rid of! I tried to manually remove files and such but I think that made the whole thing worse and now I'm in some kind of mess that I can't resolve...

How to Install Metasploitable on External Device

I want to Install metasploitable os on an external device like a computer or Raspberry Pi.
is it possible?
I download that but it have ".vmdk" format and it's not ".iso".
how can I convert it to iso or how can I have this OS on a computer?
Thanks.
There's a step or two but this should cover just about the whole process, it's been a while since I've tried it but I don't think much has changed since
sudo -i
wget http://downloads.metasploit.com/data/releases/framework-latest.tar.bz2
apt-get update; apt-get dist-upgrade
apt-get install ruby subversion libpcap
tar jxpf framework-latest.tar.bz2
cd msf3
./msfconsole
However if you want more check out http://www.pwnpi.com/ which has a few extra tools included