Ubuntu

no pg_hba.conf entry for host / Connect call failed / Invalid data directory for cluster 12 main - Postgresql Ubuntu

丶灬走出姿态 提交于 2021-01-29 15:40:28
问题 I'm trying to move my bot to an Ubuntu virtual server from Vultr but it's having a problem connecting to the postgres database. I've tried editing the config from md5 to true, and host to local, etc. But those only give me different errors and also make it stop working on my original machine too. It's working perfectly fine on my Windows machine. Here is the error I'm facing: asyncpg.exceptions.InvalidAuthorizationSpecificationError: no pg_hba.conf entry for host "[local]", user "postgres",

npm does not support Node.js

ⅰ亾dé卋堺 提交于 2021-01-29 15:26:30
问题 npm does not support Node.js v15.5.0 as well as v14.15.3 npm Version: 5.6.0 I upgraded it trough the command: npm i -g npm-upgrade But I don't get version 6, I always get version 5.6.0 I also tried different Node.js versions according to 426750. I tried following Node.js versions: v15, v14, v12, v9. It doesn't matter which Node.js version I install, i always get the samme error. I also removed Node.js and updated it as recommended in 47226238, 63196042. I have no Idea how I can fix this

Trying to install django to my virtual env

徘徊边缘 提交于 2021-01-29 15:09:19
问题 I am new to linunx and pipenv. I tried to install django on my new environment with "pipenv install django" and this happend: Installing django… Adding django to Pipfile's [packages]… ✔ Installation Succeeded Pipfile.lock not found, creating… Locking [dev-packages] dependencies… Locking [packages] dependencies… ✔ Success! Updated Pipfile.lock (4f9dd2)! Installing dependencies from Pipfile.lock (4f9dd2)… An error occurred while installing asgiref==3.2.5 --hash=sha256

How do I add a SSH key to Google Cloud Compute Engine VM Linux instance?

孤者浪人 提交于 2021-01-29 14:24:33
问题 I have a Linux VM instance running in Google Cloud Platform. I tried to copy my public key to ~/.ssh/authorized_keys and I can successfully SSH to my VM. But sometimes ~/.ssh/authorized_keys is flushed and I have to copy the public key again. It is really a pain to add public key every time. How do I add a public key permanently? 回答1: This ~/.ssh/authorized_keys takes the ssh keys from the metadata. It best you keep your ssh public keys in the metadata as mentioned here and there’s also a

Module Object Won't Update Until Code is Restarted

耗尽温柔 提交于 2021-01-29 13:13:17
问题 Not quite sure how to ask this, so I am trying to print plugged drives' volumes. Here is a simplified version of my code: from gi.repository import Gio from time import sleep import importlib import os def check(): importlib.reload(Gio) vm = Gio.VolumeMonitor.get() volumes = vm.get_volumes() print("Volumes: {}".format([i.get_name() for i in volumes])) sleep(2) while True: check() So this code prints out plugged drives' volumes. No problem until now, however, when I plug a new device or unplug

Open password-protected ods file with python-xlswriter or bash

只愿长相守 提交于 2021-01-29 10:54:05
问题 I need a code to open spreadsheet via python3 (preferred) or bash that I give them password and they read them. I try by python-module "xlswriter" I protect xlsx with this method: import xlsxwriter workbook = xlsxwriter.Workbook('for-test-password.xlsx') worksheet = workbook.add_worksheet() content = ( ['Gas', 10], ['Gasoline', 20], ['Potro', 30], ['Other',40], ) row = 0 col = 0 for item, cost in (content): worksheet.write(row, col, item) worksheet.write(row, col + 1, cost) row += 1 worksheet

How do I link libpardiso600 in a library that requires a libpardiso500?

谁都会走 提交于 2021-01-29 10:50:39
问题 I'm trying to compile a .cpp code in ubuntu. It uses a library called "Voxelyze". This is what happen when I compile it in GCC. $ g++ -Wall -o testeo testeo.cpp -I./Voxelyze-master/include -L./Voxelyze-master/lib -lvoxelyze.0.9 /usr/bin/ld: ./Voxelyze-master/lib/libvoxelyze.0.9.a(VX_LinearSolver.o): in function `CVX_LinearSolver::CVX_LinearSolver(CVoxelyze*)': VX_LinearSolver.cpp:(.text+0x123): undefined reference to `pardisoinit' /usr/bin/ld: ./Voxelyze-master/lib/libvoxelyze.0.9.a(VX

OpenCV can't be found but can be imported

China☆狼群 提交于 2021-01-29 10:31:20
问题 I've installed opencv from source using a virtualenv, however I faced some errors and needed to reinstall it. I tried removing all the files with sudo find / -name "opencv" -exec rm {} \; and checked if the package was removed with pkg-config --modversion opencv , and it said it could not be found, but when I open the terminal with python3 and enter import cv2 then print(cv2.__version__) , the terminal returns 4.0.0 . How can I completely remove opencv? I'm on Ubuntu 18.04 LTS. 回答1: Run this

Mongodb is not updated properly from 4.2 to 4.4

杀马特。学长 韩版系。学妹 提交于 2021-01-29 09:40:31
问题 I was using mongodb 4.2.9 on ubuntu 18.04 I installed it with package manager. Now I to update it to 4.4 version used package manager following --> https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/ instructions. Installation was ok but when I write mongod -version command it shows - db version v4.2.9 . I tried to re-install again it says mongodb-org is already the newest version (4.4.1). but mongod -version command it shows - db version v4.2.9 . How can I get rid of this

Global git config Intellij

不问归期 提交于 2021-01-29 09:35:16
问题 I am using the latest version of Intellij IDEA 2019.3 on Ubuntu 18.04 and whenever I create a new project I have to add a local git config because Intellij cannot find the global config. From the IDEA terminal git can read my global git settings but IDEA VCS can't. 回答1: IntelliJ does not have builtin git and thus is not looking for configs itself - it just issues commands to the command-line git client, and git itself reads the configs as needed and applies them. The only reason for git to