Linux Admin
!linux
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 to disable reading password timeout?
I know I can disable password aging with: ``` sudo visudo ``` And adding: ``` Defaults timestamp_timeout=-1 ``` But how can I disable timeout when reading passwords instead? To avoid this kind of error: ``` [sudo] password for user: sudo: timed out reading password sudo: a password is required -> exit status 1 ```
fedilink

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

Linux Admin
!linux

    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
    • 2 users / day
    • 3 users / week
    • 3 users / month
    • 8 users / 6 months
    • 37 subscribers
    • 8 Posts
    • 13 Comments
    • Modlog