help-circle
rss


How can I move my home folder to an external drive?
Edit: doing this has slowed down the computer. I don't recommend it. I'm going to revert the changes. I would like to move all the content of my home folder to an external drive to preserve the SSD from too many reads and writes when downloading stuff. Would it be safe to just move everything to `/mnt/T/home` and symlink with `ln -s /mnt/T/home /home/user`? The hard drive is configured to mount on system startup. I don't know if this would generate issues with any program that may refuse to follow symlinks. Maybe it's safer to [create a home partition][1] and [move it][2]? [1]: https://www.howtogeek.com/116742/how-to-create-a-separate-home-partition-after-installing-ubuntu/ [2]: https://www.howtogeek.com/442101/how-to-move-your-linux-home-directory-to-another-hard-drive/
fedilink

[SOLVED] How to connect to postgres database with sea-orm?
I've [installed postgres on manjaro](https://wiki.archlinux.org/title/PostgreSQL), then I've created the user wiki with password wiki. ``` ❯ sudo -iu postgres [postgres@arch-desktop ~]$ createuser -P wiki [postgres@arch-desktop ~]$ psql postgres=# \du Role name wiki ``` And when I try to run [this program](https://codeberg.org/LifeSymbiont/media_wiki/src/commit/e1687774d6ebdb9afacb9d8cad5ab3f6a44b90b0) I get the error ``` thread 'main' panicked at 'Connection Error: error returned from database: database "wiki" does not exist', src/main.rs:53:9 ``` [According to this](https://www.sea-ql.org/sea-orm-tutorial/ch01-01-project-setup.html#connecting-to-the-database-server) ``` // Change this according to your database implementation, // or supply it as an environment variable. // the database URL string follows the following format: // "protocol://username:password@host:port/database" const DATABASE_URL: &str = "postgres://wiki:wiki@localhost:5432"; ``` it shouldn't be using `wiki` as the database name. [In the tutorial](https://www.sea-ql.org/sea-orm-tutorial/ch01-01-project-setup.html#creating-a-database), why is it creating the database after it's already connected to it? Shouldn't it check if the database exists and create it only if it doesn't? If I create the database manually with ``` [postgres@arch-desktop ~]$ createdb media_wiki_db postgres=# ALTER DATABASE media_wiki_db OWNER TO wiki; ``` and use this instead ``` const DATABASE_URL: &str = "postgres://wiki:wiki@localhost:5432/media_wiki_db"; ``` I get the error ``` thread 'main' panicked at 'Execution Error: error returned from database: cannot drop the currently open database', src/main.rs:53:9 ``` thread 'main' panicked at 'Execution Error: error returned from database: permission denied to create database', src/main.rs:53:9 If I use the postgres database ``` const DATABASE_URL: &str = "postgres://wiki:wiki@localhost:5432/postgres"; ``` I get ``` thread 'main' panicked at 'Execution Error: error returned from database: permission denied to create database', src/main.rs:53:9 ``` Probably missing `CREATEDB` permission ``` ❯ sudo -iu postgres [postgres@arch-desktop ~]$ createdb test postgres=# ALTER USER wiki CREATEDB; postgres=# ALTER DATABASE test OWNER TO wiki; postgres=# \l \q Ctrl+D ``` Changed to `const DATABASE_URL: &str = "postgres://wiki:wiki@localhost:5432/test";` ``` ❯ cargo run thread 'main' panicked at 'Connection Error: error returned from database: database "test/media_wiki_db" does not exist', src/main.rs:53:9 ``` What am I doing wrong? How do I connect to the database? Actually what I would like to do is drop the database, recreate it and connect. At least for now.
fedilink

How to close ssh in nested tmux session?
I've opened ssh and it has gone into the tmux session opened in the other computer so now I see two tmux one inside another. Now I don't know how to exit ssh. When I pressed `Ctrl+D` it closed a panel in the nested tmux session. When I tried to detach `Ctrl+B D` it closed the tmux session in my computer.
fedilink


VMs and VM management for your home
What do you use, prefer? I have mostly used KVM with qemu, but I want to try out other things. I have heard of proxmox and all kinds of cool management things, what's a solid setup that supports easy backups and such things? KVM and qemu is solid and pretty easy to understand. Basic control of the VMs can be done with virt-manager, which is a basic but solid tool.
fedilink

How do I install packages from a file on a debian based system?
I want to install a list of packages from a file on a debian based system. But if there is any error I just one to log the package and output a list of packages that couldn't be installed at the end, when every package has finished installing. I don't want to see any other output. I don't want the installation to stop if a package gives an error, like it's missing or can't be installed. I want the packages to be installed without any input whenever possible. This is the function I'm using right now, which I would like to substitute: ``` install_packages() { xargs pacstall -I < pacscripts sudo apt install --ignore-missing $(cat apt-pkglist) } ```
fedilink

How do I use VM as a server?
I want to install HomelabOS on a virtual machine, with a few services like NextCloud, Jellyfin, Pi-hole, Peertube, Funkwhale, PrivateBin. I've installed QEMU/virt manager following [this guide](https://computingforgeeks.com/install-kvm-qemu-virt-manager-arch-manjar/). I've downloaded Ubuntu 20.04.4. It says [here](https://homelabos.com/docs/setup/installation/) that it requires Ubuntu Server 20.04, but I guess it's pretty much the same. ``` sudo pacman -Syyu sudo pacman -S --needed archlinux-keyring qemu virt-manager virt-viewer dnsmasq vde2 bridge-utils openbsd-netcat ebtables iptables libguestfs sudo systemctl enable --now libvirtd.service // Edit the file /etc/libvirt/libvirtd.conf // unix_sock_group = "libvirt" // unix_sock_ro_perms = "0777" // unix_sock_rw_perms = "0770" sudo usermod -aG libvirt $(whoami) newgrp libvirt sudo systemctl reload-or-restart libvirtd.service ``` What else should I do? I think I need to set bridged network but it's giving me an error. I've selected all the default options during the configuration of the virtual machine in *Virtual Machine Manager*, except for the Network selection, in which I've chosen `Bridge device`, with `Device name` asdfasdf. Unable to complete install: 'Cannot get interface MTU on 'asdfasdf': No such device' ``` Traceback (most recent call last): File "/usr/share/virt-manager/virtManager/asyncjob.py", line 65, in cb_wrapper callback(asyncjob, *args, **kwargs) File "/usr/share/virt-manager/virtManager/createvm.py", line 2001, in _do_async_install installer.start_install(guest, meter=meter) File "/usr/share/virt-manager/virtinst/install/installer.py", line 701, in start_install domain = self._create_guest( File "/usr/share/virt-manager/virtinst/install/installer.py", line 649, in _create_guest domain = self.conn.createXML(install_xml or final_xml, 0) File "/usr/lib/python3.10/site-packages/libvirt.py", line 4400, in createXML raise libvirtError('virDomainCreateXML() failed') libvirt.libvirtError: Cannot get interface MTU on 'asdfasdf': No such device ```
fedilink

/git: permission denied
I reinstalled *Manjaro Cinnamon 21.2.2-220123-linux515* trying to get rid of this error with no luck. I've only copied my dotfiles from an external drive and run the installation script. Whenever I try a `git init` in any empty repository I get `/git: permission denied`. Which doesn't tell me anything. I've found that the error is produced because of this lines in the installation of my dotfiles: ``` sudo tee -a /etc/profile /etc/zshenv /etc/zsh/zshenv &>/dev/null <<EOF export XDG_CONFIG_HOME=$XDG_CONFIG_HOME export ZDOTDIR=$ZDOTDIR EOF ``` If I change the lines appended to those files and restart the system it doesn't give me an error, but then my configuration isn't loaded. But that could mean the error happens anywhere in my configuration and I don't know how to find it.
fedilink

Ask specific questions about how to do something with linux

General linux discussion on lemmy.ml

Create Post From:
lemmy.ml

Community icon by Alpár-Etele Méder,
licensed under CC BY 3.0

  • 0 users online
  • 1 user / day
  • 1 user / week
  • 1 user / month
  • 5 users / 6 months
  • 1 subscriber
  • 10 Posts
  • 1 Comment
  • Modlog
Heap Overflow
A place to ask programming questions and share free resources

General programming discussion,
Additional resources, challenges

To post or comment:

  1. Create an account on another lemmy instance
  2. Then search for the community url like here

RULES:

  1. No politics
  2. No flaming / trolling
  3. No proprietary BS
  4. Stay on topic

Please keep questions & examples short!

All content is Public Domain unless otherwise specified.
Only CC0, CC BY 3.0, or CC BY-SA 3.0 alternate licenses are allowed.

No affiliation with StackOverflow.com