Except script inside shell script closing ssh after it ends

I need to execute some tasks inside a ssh. I built a simple script where I start an ssh session in a terminal and I need ssh to stay open after finishing my script.

#!/bin/bash

gnome-terminal -e "bash -c "/usr/bin/expect -c '
set timeout -1
eval spawn ssh "SSH INFO"
expect assword:
send "PASSWORD"
send bash'
; bash"" &

# Some more code here...

The script is working so far it accesses ssh. After entering ssh, it automatically terminates it, but I want to keep it open.

I also tried a script using nohop, whitout success:

#!/bin/bash

nohup gnome-terminal -e "bash -c "/usr/bin/expect -c '
set timeout -1
eval spawn ssh acen
expect assword:
send 123456
'"; bash" & tail -f nohup.out

What can I do to fix it?

equipment – How would closing borders and supply routes affect local market prices?

I’m developing a world where governments are freaking out over a perceived threat (not a virus). The stars have disappeared and the gods have seemingly abandoned them. Many leaders have ordered their borders locked down and trade routes closed for various reasons.

Different countries would have the resources they can produce themselves (obviously) but things from outside would be increasingly scarce as time goes on. I know that not having shipments to a desert country would raise the price of the remaining wood products in their markets. But I don’t know how much. I know what each country produces and what they import.

My question:
What is a reasonable scale for increasing scarcity?

I’m mostly looking for a realistic percentage I can add to market prices every week/month to reflect the scarcity. But if a set scale is more realistic let me know.

P.S.
I know my PCs will be able to exploit this with smuggling and get “hella rich” as they would put it. But in the long run if they waste their time smuggling they will come to the inevitable end of the campaign with too much money and not enough power. I’m letting them know it’s on a timeline so they can make their own decisions.

lightning network – What fee is the starting point of the closing fee negotiation?

When I issue the command lightning-cli listpeers $peerid i get a feerate perkb of 1012 atm. What feerate is this exactly? Is this the feerate which will be proposed by the other peer for a mutual close? I don’t think this is the case.

feerate: An object containing the latest feerate as both perkw and perkb.

I know that i can get the feerates of my node with lcli feerates perkb. With these results atm:

{
   "perkb": {
      "opening": 1012,
      "mutual_close": 1012,
      "unilateral_close": 1012,
      "delayed_to_us": 1012,
      "htlc_resolution": 1012,
      "penalty": 1012,
      "min_acceptable": 1012,
      "max_acceptable": 88300
   },
   "onchain_fee_estimates": {
      "opening_channel_satoshis": 177,
      "mutual_close_satoshis": 170,
      "unilateral_close_satoshis": 151,
      "htlc_timeout_satoshis": 168,
      "htlc_success_satoshis": 178
   }
}

That means my node will propose 1012 as a starting fee for a mutual close. But what is the starting fee of the other node?

iphone – App deletes all progress after closing

I recently downloaded the game “Lost City” from Apple Arcade and after closing the app it deleted all my progress. At first I thought it was a one time thing but it happened the next time too (and for the other four times I tried it). I really don’t know how can I fix it because it basically makes the game unplayable.
I tried a few things:

  • Reinstalling the app
  • Restoring data from iCloud (it says I have no data saved from this app)
  • Deleting the app, then restarting the phone and installing the app again

Also, Game Center saved my achievements and high score, IDK if it’s relevant but it’s something. I’m out of ideas, any help?

mysql 5.7 – MySQLdb._exceptions.OperationalError: (2006, ”) when closing a SQL query. Is it because of the connection?

Salut les administrateurs ! I have a question (and an issue) When closing my SQL query in my ETL I get a connection error while it seemed I was able to get connected:

    c.execute("""
        UPDATE `{table_name}` 
        SET `{column_name}` = CONCAT('hash_', {expression})
        WHERE {pk_name} IN ({ids})
    """.format(
        table_name=table_name, column_name=column_name, expression=expression, pk_name=pk_name,
        ids=','.join(ids)
    ))

    print('.', end='', flush=True)

Indeed, I get:

(venv) C:UsersantoiDocumentsProgrammingWorkdata-tools>python -m etl.main
2021-06-29 10:59:37.814133 - Connecting to database hozana_data...
2021-06-29 10:59:37.822142 - Connecting to archive database hozana_archive...
2021-06-29 10:59:38.046134 - Start ETL main process
2021-06-29 10:59:38.046134 - `users` table:
2021-06-29 10:59:38.046134 - Hashing column `users`.`email:` done.
2021-06-29 10:59:38.054091 - Hashing column `users`.`email_notification:`Traceback (most recent call last):
  File "C:UsersantoiDocumentsProgrammingWorkdata-toolsetltaskanonymization.py", line 17, in hash_column
    c.execute("""
  File "C:UsersantoiDocumentsProgrammingWorkdata-toolsvenvlibsite-packagesMySQLdbcursors.py", line 183, in execute
    while self.nextset():
  File "C:UsersantoiDocumentsProgrammingWorkdata-toolsvenvlibsite-packagesMySQLdbcursors.py", line 137, in nextset
    nr = db.next_result()
MySQLdb._exceptions.OperationalError: (2006, '')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:UsersantoiAppDataLocalProgramsPythonPython39librunpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:UsersantoiAppDataLocalProgramsPythonPython39librunpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:UsersantoiDocumentsProgrammingWorkdata-toolsetlmain.py", line 52, in <module>
    main()
  File "C:UsersantoiDocumentsProgrammingWorkdata-toolsetlmain.py", line 24, in main
    anonymization.main()
  File "C:UsersantoiDocumentsProgrammingWorkdata-toolsetltaskanonymization.py", line 59, in main
    hash_column('users', 'email_notification', 'user_id', True)
  File "C:UsersantoiDocumentsProgrammingWorkdata-toolsetltaskanonymization.py", line 50, in hash_column
    print('.', end='', flush=True)
  File "C:UsersantoiDocumentsProgrammingWorkdata-toolsvenvlibsite-packagesMySQLdbconnections.py", line 239, in __exit__
    self.close()
MySQLdb._exceptions.OperationalError: (2006, '')

I thought it was when the client cannot send a query to the server, most likely because the server itself has closed the connection. However I thought there was already a connection:

introducir la descripción de la imagen aquí

Even more there are also these lines at the beginning:

2021-06-29 10:59:37.814133 - Connecting to database hozana_data...
2021-06-29 10:59:37.822142 - Connecting to archive database hozana_archive...

So when I get a MySQLdb._exceptions.OperationalError: (2006, '') when closing a SQL query. Is it because of the connection?

database – How do you work with closing pools/connections?

I wanted to know when you are done processing some query or transaction do you usually close a connection only? do you close the pool? or do you close both? Does it even matter which one you close? What happens under the hood when you do all three of these cases (if there even is a difference). I’d appreciate it since I’ve been looking at the mariadb documentation and I see there are methods for closing both a pool and a connection and usually you instantiate opening one connection in the pool as far as I know and you need to close it when you are done using it.

https://github.com/mariadb-corporation/mariadb-connector-nodejs/blob/master/documentation/promise-api.md#promise-api

I’d appreciate the guidance! Thank You!

magento2 – Magento 2.3.6 is removing Html closing tag inserted by Custom JS in Block

Something strange is happening and probably I’m missing something realy simple… but can’t understand what:

adding a custom js in a block, that add an element to the DOM. The element has several children, and I’m opening and closing tags of each children.
However, when I run the script the closing tags are gone, and all the children are embedded to each other (and I’ve checked debugging from chrome console)
I’ve tested this simple script as an example:

const parent = document.getElementById('#parent');
parent.innerHTML = "<div><div>sibling1</div><div>sibling2</div></div>";

It should render:

<div "#parent">
    <div>
        <div>sibling1</div>
        <div>sibling2</div>
    </div>
</div>

but I see all the closing tags are gone when I debug it:

parent.innerHTML = "<div><div>sibling1<div>sibling2";

which results in

<div "#parent">
    <div>
        <div>sibling1
            <div>sibling2
            </div>
        </div>
    </div>
</div>

What is happening? What is eating up my closing tags?

I’ve testes several ways to generate this innerHTML and always ends up the same.

thank you!

20.04 – Ubuntu won’t completely ignore lid closing

TLDR: I’ve tried changing both logind and upower configuration files to ignore lid closing action and it still keeps detecting it and acting on it.

I’m trying to use an old laptop as a local Plex server and download content via remote qBitTorrent client. This needs the laptop to be continuously running and accessible.

If I closed the lid the laptop went to suspension mode and therefore it was unaccessible by other devices on the network. I googled the way out of that, but it will keep somehow disabling the laptop and sending it into “half-suspended” mode or something like that. If I lift the lid it gets back to working quickly, but nor Plex or qBitTorrent remote UI will be accessible during the lid closed state.

I’ve tried changing every Lid action to “ignore” on both logind and upower files and still nothing. I’m on Ubuntu 20.04 on an old Lenovo netbook.

I did run the “restart” commands for both configuration changes.

The behaviour I want to get is exactly as it works in Windows, the lid goes down and system doesn’t even care about it, not even screen dim or anything. Screen going off would be cool, but Idc if it doesn’t happen, I just want the laptop to still be accessible in the network with the lid down.

Thanks a lot in advance! :]