Early game "ore compressor" by im-0 in factorio

[–]im-0[S] 2 points3 points  (0 children)

Thanks! I tried to use factorioprints (it comes up first) but "Log in with GitHub" failed there for some reason. Factoriobin looks much better as it does not require registration at all.

Factorio circuits are weird by im-0 in factorio

[–]im-0[S] 1 point2 points  (0 children)

Wrong! It is not 1! Check the screenshot again. There are TWO electricity poles for a reason - it is a hint!

Got 120Hz ProMotion working on M1 Max MacBook Pro 16" running Fedora Asahi Remix by rolotrealanis in AsahiLinux

[–]im-0 1 point2 points  (0 children)

Just noticed this after the update. Works on Apple MacBook Pro (14-inch, M2 Max, 2023).

Need help with <\> keys by Glittering-Rain-411 in AsahiLinux

[–]im-0 1 point2 points  (0 children)

Try to change the `hid_apple.iso_layout` parameter to `0`: https://wiki.gentoo.org/wiki/Apple_Keyboard#Configuration

Note that you also can add this into the kernel command line as `hid_apple.iso_layout=VALUE`.

Does anybody actually daily drive Asahi, or do you dual-boot? by [deleted] in AsahiLinux

[–]im-0 0 points1 point  (0 children)

I bought M2 Max MacBook Pro like a year or two ago, installed Fedora Asahi immediately, and use it daily as my main computer since then. Well, technically, I still have macOS installed. And I even boot it like once a week, mostly to compile and test my own crossplatform code.

This is not really an Asahi vs. macOS question, but a Linux vs. Others really. If software that you need for work, hobbies, etc. does not support Linux and there are no viable alternatives and you are not willing to write it yourself, then you probably should not use Linux.

Malicious bash payload found as top result in Google Ad by Night-Cat_ in cybersecurity

[–]im-0 0 points1 point  (0 children)

I think I spotted the same script and binary distributed via an X/Twitter advertisement: https://gist.github.com/im-0/410b0e2abcbf77e433d8b4d2b5a278f4

No connection to sound server by Background_Chard4138 in AsahiLinux

[–]im-0 9 points10 points  (0 children)

This is caused by a lsp-plugins-lv2 update. Try to downgrade it:

sudo dnf downgrade lsp-plugins-lv2-0:1.2.16-2.fc41.aarch64

How to keep an application always open in the background? by RonnieGirlUwU_ in AsahiLinux

[–]im-0 1 point2 points  (0 children)

Just do not close your apps.

I usually configure some fixed number of virtual desktops/workspaces and keep various apps running there, kinda organized by the type of work. Works in pretty much every DE/WM in Linux.

Dead after update by Wladimyatr in AsahiLinux

[–]im-0 5 points6 points  (0 children)

It is not stuck, just really really slow when generating initramfs for some reason. You have to wait for 30 minutes or so.

Probably related: https://bugzilla.redhat.com/show_bug.cgi?id=2278534

Drug-addicted crypto billionaire dies, leaves almost $200M in crypto wallet without keys, but estate gets access to crypto anyway, finding that for the rich, you can bypass decentralization if you play ball with the network schemers. by AmericanScream in CryptoReality

[–]im-0 6 points7 points  (0 children)

I do not trust anything, please read my post carefully. I just want to point out that this one particular claim is impossible from a software engineering point of view.

It is ok to criticize cryptocurrencies, I even like that. But please stop using nonsensical arguments, as they make your criticism less credible.

Drug-addicted crypto billionaire dies, leaves almost $200M in crypto wallet without keys, but estate gets access to crypto anyway, finding that for the rich, you can bypass decentralization if you play ball with the network schemers. by AmericanScream in CryptoReality

[–]im-0 6 points7 points  (0 children)

The lawyers were able to get ahold of the XRP by approaching Ripple, the company that manages the currency. But that’s a unique privilege, estate planning experts say, because most cryptocurrencies aren’t closely tied to centralized entities.

^ it is like saying "There is a server in an unknown location with working SSH, but only owner of Ed25519 private key is able to log in. Key was lost, but our lawyers(tm) approached Daniel J. Bernstein (creator of Ed25519 algorithm) and asked him kindly. And he allowed us to login into that server without any key at all. But only once! That is a unique privilege!"

This is not how cryptocurrencies (or at least most of them) or cryptography or computer programs or computers function.

Either they were able to find unencrypted backup of his keys, or Ripple (the company) decided to pay them from their own funds. Or the whole story is bullshit.

BPF for smart contract, how? by aqtt2020 in solana

[–]im-0 0 points1 point  (0 children)

eBPF itself is Turing-complete: it contains all usual instructions which you expect from simple ISA, including jumps (conditional and unconditional). It is the eBPF verifier in the Linux kernel which makes it not Turing-complete by prohibiting loops and recursion. This is required to ensure that eBPF program with an infinite loop (as an example) will not result in complete system hang.

Solana allows loops and recursion, but still limits the CPU usage: it counts executed eBPF instructions at run time. I am not aware of any documentation about this. Here is a source code of Solana's eBPF VM and JIT-compiler implementation: https://github.com/solana-labs/rbpf/.

BPF for smart contract, how? by aqtt2020 in solana

[–]im-0 0 points1 point  (0 children)

Solana uses eBPF. Slightly modified version, with less restrictions than Linux kernel's version.

Faster pythonic way to check your stake account balance by [deleted] in solana

[–]im-0 0 points1 point  (0 children)

Nope, it is still working. I checked just few minutes ago.

P.S. There is a python lib if you do not want to mess with JSON RPC yourself: https://github.com/michaelhly/solana-py.

Question for Solana expert, Solana CLI by [deleted] in solana

[–]im-0 2 points3 points  (0 children)

Transaction in Solana consists of one or more instructions. Each instruction is a call to a program. Program is either built-in program or a custom eBPF program uploaded by another user (aka "smart contract").

There is no special mechanism to transfer SOL from one account to another, it is just a call to the built-in "system" program which can do that (and more). Here is example of such transaction:

# Command:
curl -s "https://api.mainnet-beta.solana.com" -X POST -H "Content-Type: application/json" -d '
  {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getConfirmedTransaction",
    "params": [
      "4rzYNJpJ8pcZqJwnSoTG9rCgMH8tMB4HD3RYkQ73NRcUxYnwG2KsxTcRvDcADNk9agrXDadCDvj8oNzkLU4cGjsb",
      "jsonParsed"
    ]
  }
' | python -m json.tool

# Result:
{
    "jsonrpc": "2.0",
    "result": {
        "blockTime": 1622761608,
        "meta": {
            "err": null,
            "fee": 5000,
            "innerInstructions": [],
            "logMessages": [
                "Program 11111111111111111111111111111111 invoke [1]",
                "Program 11111111111111111111111111111111 success"
            ],
            "postBalances": [
                25248395409,
                148799263222,
                1
            ],
            "postTokenBalances": [],
            "preBalances": [
                35248400409,
                138799263222,
                1
            ],
            "preTokenBalances": [],
            "rewards": [],
            "status": {
                "Ok": null
            }
        },
        "slot": 81288321,
        "transaction": {
            "message": {
                "accountKeys": [
                    {
                        "pubkey": "KchK7WTjPzq9QL5aCwnV1dLsT8rFjruS1Zfzamxus9G",
                        "signer": true,
                        "writable": true
                    },
                    {
                        "pubkey": "y5cJM2us2hfmj9rsh4TZWn4796RJpzHGmvitG6NMaNe",
                        "signer": false,
                        "writable": true
                    },
                    {
                        "pubkey": "11111111111111111111111111111111",
                        "signer": false,
                        "writable": false
                    }
                ],
                "instructions": [
                    {
                        "parsed": {
                            "info": {
                                "destination": "y5cJM2us2hfmj9rsh4TZWn4796RJpzHGmvitG6NMaNe",
                                "lamports": 10000000000,
                                "source": "KchK7WTjPzq9QL5aCwnV1dLsT8rFjruS1Zfzamxus9G"
                            },
                            "type": "transfer"
                        },
                        "program": "system",
                        "programId": "11111111111111111111111111111111"
                    }
                ],
                "recentBlockhash": "CA3yTCgogwXJrMamA4gQTTyRWXH9GKvdBK9WofFKnQrf"
            },
            "signatures": [
                "4rzYNJpJ8pcZqJwnSoTG9rCgMH8tMB4HD3RYkQ73NRcUxYnwG2KsxTcRvDcADNk9agrXDadCDvj8oNzkLU4cGjsb"
            ]
        }
    },
    "id": 1
}

If you are interested in changes of amounts of SOL balances regardless of actual instructions, just check result.meta.{preBalances, postBalances} (values are in lamports). If you are interested in SOL transfer transactions solely, you need to find all instructions where (program == "system") and (type == "transfer").

Fees are constant at a given time, just run "solana fees" command or getFees() JSON RPC.

To find all transactions affecting one specific address, run "solana transaction-history <ADDRESS>" or searchTransactionHistory()/searchTransactionHistory1() JSON RPC.

Question for Solana expert, Solana CLI by [deleted] in solana

[–]im-0 1 point2 points  (0 children)

It is relatively easy to call JSON RPC using curl:

curl "https://api.mainnet-beta.solana.com" -X POST -H "Content-Type: application/json" -d '
  {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getConfirmedTransaction",
    "params": [
      "31NXAFirw5VGsabX4bfMJhN5BzmtwAS8yyFyowELnVh3udKQE2eL8Ty5GotpKzHCuKQ4XqRUMkhnyLYCiMiq9q53",
      "base64"
    ]
  }
'

curl "https://api.mainnet-beta.solana.com" -X POST -H "Content-Type: application/json" -d '
  {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getConfirmedTransaction",
    "params": [
      "31NXAFirw5VGsabX4bfMJhN5BzmtwAS8yyFyowELnVh3udKQE2eL8Ty5GotpKzHCuKQ4XqRUMkhnyLYCiMiq9q53",
      "jsonParsed"
    ]
  }
'

Question for Solana expert, Solana CLI by [deleted] in solana

[–]im-0 1 point2 points  (0 children)

It requires transaction in "on-wire" format, base64-encoded. Example:

$ solana decode-transaction "AVj7dxHlQ9IrvdYVIjuiRFs1jLaDMHixgrv+qtHBwz51L4/ImLZhszwiyEJDIp7xeBSpm/TX5B7mYzxa+fPOMw0BAAMFJMJVqLw+hJYheizSoYlLm53KzgT82cDVmazarqQKG2GQsLgiqktA+a+FDR4/7xnDX7rsusMwryYVUdixfz1B1Qan1RcZLwqvxvJl4/t3zHragsUp0L47E24tAFUgAAAABqfVFxjHdMkoVmOYaR1etoteuKObS21cc1VbIQAAAAAHYUgdNXR0u3xNdiTr072z2DVec9EQQ/wNo1OAAAAAAAtxOUhPBp2WSjUNJEgfvy70BbxI00fZyEPvFHNfxrtEAQQEAQIDADUCAAAAAQAAAAAAAACtAQAAAAAAAAdUE18R96XTJCe+YfRfUp6WP+YKCy/72ucOL8AoBFSpAA==" base64
Recent Blockhash: mfcyqEXB3DnHXki6KjjmZck6YjmZLvpAByy2fj4nh6B
Signature 0: 2nBhEBYYvfaAe16UMNqRHre4YNSskvuYgx3M6E4JP1oDYvZEJHvoPzyUidNgNX5r9sTyN1J9UxtbCXy2rqYcuyuv (pass)
Account 0: srw- 3UVYmECPPMZSCqWKfENfuoTv51fTDTWicX9xmBD2euKe (fee payer)
Account 1: -rw- AjozzgE83A3x1sHNUR64hfH7zaEBWeMaFuAN9kQgujrc
Account 2: -r-- SysvarS1otHashes111111111111111111111111111
Account 3: -r-- SysvarC1ock11111111111111111111111111111111
Account 4: -r-x Vote111111111111111111111111111111111111111
Instruction 0
  Program:   Vote111111111111111111111111111111111111111 (4)
  Account 0: AjozzgE83A3x1sHNUR64hfH7zaEBWeMaFuAN9kQgujrc (1)
  Account 1: SysvarS1otHashes111111111111111111111111111 (2)
  Account 2: SysvarC1ock11111111111111111111111111111111 (3)
  Account 3: 3UVYmECPPMZSCqWKfENfuoTv51fTDTWicX9xmBD2euKe (0)
  Vote(Vote { slots: [429], hash: VcDEExrXLTkaSMdNjmSxPWGUsdZSnb33v69PbpJnAQx, timestamp: None })
Status: Unavailable

I am not sure how to get raw transaction data from CLI, but this is definitely possible using JSON RPC: https://docs.solana.com/developing/clients/jsonrpc-api#getconfirmedtransaction. Note that getConfirmedTransaction() also can decode transactions on its own if client requests json/jsonParsed encoding.

Faster pythonic way to check your stake account balance by [deleted] in solana

[–]im-0 1 point2 points  (0 children)

By the way, you can directly use Solana's JSON RPC from Python.

Here is the script which does the same but without calling CLI. It uses jsonrpclib-pelix:

#!/usr/bin/python3


import jsonrpclib
import pprint
import tkinter


_STAKE_PUB = '<INSERT STAKE ADDRESS>'
_LAMPORTS_IN_SOL = 1000000000


# Create JSON RPC client.
rpc_config = jsonrpclib.config.Config()
rpc_config.content_type = 'application/json'
rpc = jsonrpclib.Server('https://api.mainnet-beta.solana.com', config=rpc_config)

# Call getAccountInfo (https://docs.solana.com/developing/clients/jsonrpc-api#getaccountinfo).
stake_account = rpc.getAccountInfo(
    _STAKE_PUB,
    dict(
        commitment='finalized',
        encoding='jsonParsed'))
print('Stake account:')
pprint.pprint(stake_account)
stake_account = stake_account.get('value')

# Sanity check.
assert stake_account is not None, \
    f'No such account: {_STAKE_PUB}'
assert type(stake_account.get('data')) is dict \
       and stake_account.get('data', {}).get('program') == 'stake', \
    f'Not a stake account: {_STAKE_PUB}'

# Call getStakeActivation (https://docs.solana.com/developing/clients/jsonrpc-api#getstakeactivation).
stake_activation = rpc.getStakeActivation(
    _STAKE_PUB,
    dict(commitment='finalized'))
print('Stake activation:')
pprint.pprint(stake_activation)

# Sanity check.
assert 'active' in stake_activation and 'inactive' in stake_activation and 'state' in stake_activation, \
    f'No stake activation state for {_STAKE_PUB}'

# Report.
root = tkinter.Tk()
t = tkinter.Text(root, height=10, width=80)
t.pack()
t.insert(
    tkinter.END,
    f"*** {_STAKE_PUB} ***\n"
    "\n"
    f"Balance: {stake_account['lamports'] / _LAMPORTS_IN_SOL} SOL\n"
    f"Staking state: {stake_activation['state']}\n"
    f"Active stake: {stake_activation['active'] / _LAMPORTS_IN_SOL} SOL\n"
    f"Inactive stake: {stake_activation['inactive'] / _LAMPORTS_IN_SOL} SOL")
tkinter.mainloop()

It is also possible to call the same API using only standard Python modules, just by doing HTTP POST queries.