Hacker Newsnew | past | comments | ask | show | jobs | submit | more johnisgood's favoriteslogin

Somewhat related, it is something I have been trying to figure out, and I did, successfully! This information might help others.

You can create a standalone binary from .tcl files by using KitCreator and sdx (Starkit Developer eXtension). You need to wrap your Tcl script into a .kit file (a virtual filesystem), then combine it with a Tcl runtime to produce a native ELF (or Windows) binary. Optionally, you can encrypt your Tcl code with AES (e.g., using openssl enc) before embedding it, and decrypt it at runtime via a custom loader. The result is a self-contained executable that runs anywhere Tcl is supported. :)

I have a script for it!

  Standalone encrypted application created:
  -> /tmp/tcl/app.run
  -> AES KEY (hex): 95a8a95e8322344b808ebd3fd3986b5b
  -> AES IV  (hex): 69eac67341d2657a0b00d3006addb131
  -> To run it: ./app.run

  $ ./app.run
  Hello world from binary!
  $ file app.run
  app.run: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=f3fabb748cc7e61c2fafc7c288f282db2f6de0c7, for GNU/Linux 3.2.0, stripped
The generated app.run is 10 MB and ldd shows it only needs "linux-vdso", "libm", "libc", and "ld-linux-*".

Useful links (taken from my script):

  TCL_VERSION="9.0.1"
  TCL_SRC_URL="https://sourceforge.net/projects/tcl/files/Tcl/${TCL_VERSION}/tcl${TCL_VERSION}-src.tar.gz"
  SDX_KIT_URL="https://chiselapp.com/user/aspect/repository/sdx/uv/sdx-20110317.kit"
  TCLLIB_URL="https://github.com/tcltk/tcllib/archive/refs/heads/main.zip"
I wonder if there is a more recent sdx, although it still works.

FWIW, the steps are:

  1. Download and build Tcl
  2. Clone KitCreator and build Tclkit
  3. Download SDX
  4. Create the loader ($VFS_DIR/main.tcl)
  5. Download and extract Tcllib (optional)
  6. Copy any modules you want from Tcllib (optional)
  7. Add dummy assets to $VFS_DIR/assets/data.json (has a specific format) (probably optional)
  8. Wrap and generate .kit and final .run ELF (you need 2 Tclkit binaries, just duplicate it)
If you have any questions, let me know!

---

I have used critcl before, but can't find my code anymore. :( It is good stuff though.


Major differences that I can think of between the two are (with regarding to warts and ease of use):

PHP 8 uses exceptions with a unified Error hierarchy, there are type errors, division by zero, certain parse errors and so on.

PHP 8 has strong support for static typing now, thank goodness.

PHP 8 introduces union types (int|float|null).

PHP 8.1 introduces intersection types (A&B).

PHP 8.1 added the "never" return type.

PHP 8 has less repetitive boilerplate.

PHP 8 has consistent function signatures now.

PHP 8 has consistent object/array syntax now (to be honest, some asymmetries remain).

PHP 8 has named arguments for clarity and flexibility.

PHP 8 has the nullsafe operator which simplifies deeply nested null checks.

PHP 8 has arrow functions which makes closures concise and easier to use.

PHP 8 has attributes, e.g. "#[Route("/users")]".

PHP 8 has "match" expressions which is a more predictable, type-safe, and expression-oriented alternative to "switch".

PHP 8 has many more tools for testing and debugging (incl. static analyzers).

PHP 8 has many new functions (incl. utility functions).

PHP 8.1 introduces native enums.

PHP 8.1 has "readonly" properties for enforcing immutability.

PHP 8.1 has cleaner syntax for referencing callables.

PHP 8.1 has "fibers" which enables cooperative multitasking and is a foundational building block for upcoming async/await features.

Global namespace pollution has been pretty much resolved (Composer autoloading[1]).

There are other ecosystem-level improvements such as PSR standards[1], better async story, etc.

This list is non-exhaustive. These are just the improvements that come to mind off the top of my head so I probably missed a lot of other major improvements. PHP 8+ is definitely much easier to use and they greatly reduced PHP's warts. There may be some inconsistencies left here and there, but they are not a deal-breaker IMO, if you even run into them.

[1] https://www.phptutorial.net/php-oop/php-composer-autoload/ (I do not use "dump-autoload"), https://github.com/php-fig/fig-standards/blob/master/accepte..., https://www.php-fig.org/psr/psr-4/ (https://www.php-fig.org/psr/)

---

I strongly recommend taking a fresh look at PHP 8+. It is very different from the PHP you have once known. It is "modern" now. There are lots of deprecations and removal of old warts. I did not like PHP as much ages ago, but it was a pleasure to use PHP 8+.

If you are looking to (re)learn PHP, the book “PHP & MySQL: Novice to Ninja” is a good starting point[1]. There are many other, high-quality books and resources as well.

[1] Available on libgen. The source code examples from the book are available on GitHub: https://github.com/spbooks/phpmysql7.

---

If you have any specific warts or whatnot, or if you want more resources, please do feel free to let me know.

---

I wrote this comment on my phone, so it is not as detailed and it is not structured as well, but I hope that it will still provide some insight into the differences between legacy PHP and modern PHP.

Happy to answer any questions!


https://policies.google.com/terms?hl=en-US

The service can delete your account without prior notice and without a reason . At any time, your account can be terminated without explanation and without warning by the service.

The Agreement explains they will disclose personal data about you if it is reasonably necessary to comply with applicable law and government requests.

The service can read your private emails . The Service is able to access, scan, review or read all user communications, including private messages, which may contain personal or sensitive data.

Per the service's terms, users may not express negative opinions about them . Criticising, questioning, making objections or complaints about the Service, its staff or anything related to it is prohibited and constitutes a breach of the Terms.

Your data may be processed and stored anywhere in the world . Your data is stored all over the world, including in countries where data protection rules may differ from the ones of the service's jurisdiction or those of your country jurisdiction.

You are tracked via device fingerprinting . Tracking technologies (such as web beacons, tracking pixels...) are employed on users and/or the service assigns a unique ID to a browser or device to track its behaviour.

Terms may be changed any time at their discretion, without notice to you . The Agreements can be updated at any time, including in a way that negatively affects user rights, without notifying before or after the changes.

Instead of asking directly, this Service will assume your consent merely from your usage. . The Service infers your acceptance from your continued usage, instead of prompting you to read the new Terms and asking for direct consent. This doesn’t apply to services that have no way to seek consent from users through their contact details or an account.

Per the service's terms, users may not express negative opinions about them . Criticising, questioning, making objections or complaints about the Service, its staff or anything related to it is prohibited and constitutes a breach of the Terms.


You can do this with ssh (and socat or mkfifo):

  # receiver
  socat UNIX-RECV:/tmp/foobar - | my-command

  # sender
  my-command | ssh host socat - UNIX-SENDTO:/tmp/foobar
You can relay through any other SSH server if your target is behind a firewall or subject to NAT (for example the public service ssh-j.com). This is end-to-end encrypted (SSH inside SSH):

  # receiver
  ssh top-secret@ssh-j.com -N -R ssh:22:localhost:22
  socat UNIX-RECV:/tmp/foobar - | my command

  # sender
  my-command | ssh -J top-secret@ssh-j.com ssh socat - UNIX-SENDTO:/tmp/foobar
(originally posted on the thread for "beam": https://news.ycombinator.com/item?id=42593135)

I honestly do not know what to do about my financial issues. I do not think raising GoFundMe would go anywere, even though all it really takes is finding 100 people who would not mind donating 10 USD. 1000 USD would be a lot to me. I do not know how to make it viral. I do not want to appeal to people's emotions but it seems like I would have to do that. I want to keep my anonimity too, but that makes it even less likely for people to donate, so I really have no idea what I should do.

This is why documenting is so crucial. Even on a software architecture level.

A few months from now, I'd love to have written down decisions for my current project:

- Why did I decided to use Kysely over Drizzle, Knex, Prisma, TypeORM or other ORM/SQL tool?

- How am I going to do migrations?

- Why am I using one of Deno/Bun over sticking to nodejs?

- Why did I structure the project as a directory per feature over controllers/models/services directories?

- Why did I fork this library and what are the steps to keep this thing updated? Do I plan to upstream my changes? Is there a GitHub issue or PR about it?

- Why am I hosting in one of AWS/GCP/Azure? Why not lambda functions? Why docker?

- Why did I pick this specific distribution of kubernetes over the other also lightweight alternatives?

- Why did I even start this project and what do I aim to accomplish with it?

So I created a # Decisions section in README.md

This way I don't keep doubting my own decisions and wasting time opening 20 documentation tabs to compare solutions yet again.


Dogwood bushes and Rose of Sharon grow rather quickly and make a nice "green screen". They lose some of their coverage in the winter, though, so you way want to mix in a row of evergreens for good measure.

A person is flying a hot air balloon and realises he’s lost. He lowers the balloon and spots a man down below. He shouts:

“Excuse me! Can you help me? I promised a friend I’d meet him, but I have no idea where I am.”

The man replies, “You’re in a hot air balloon, hovering 30 feet above the ground, somewhere between 40 and 41 degrees north latitude and between 59 and 60 degrees west longitude.”

“You must be a Prompt Engineer,” says the balloonist.

“I am,” replies the man. “How did you know?”

“Well,” says the balloonist, “everything you told me is technically correct, but it’s of no use to me and I still have no idea where I am.”

The man below replies, “You must be a Vibe Coder.”

“I am,” says the balloonist. “How did you know?”

"Because you don’t know where you are or where you’re going. You made a promise you can’t keep, and now you expect me to solve your problem. The fact is, you’re in the same position you were in before we met, but now it’s somehow my fault!"


Fedora 42, Helldivers 2

Make sure to change your Steam launch options to:

PULSE_LATENCY_MSEC=84 gamemoderun %command%

This will use gamemode to run it, give it priority, put the system in performance power mode, and will fix any pulse audio static you may be having. You can do this for any game you launch with steam, any shortcut, etc.

It's missing probably 15fps on this card between windows and Linux, and since it's above 100fps I really don't even notice.

It does seem to run a bit better under gnome with Variable Refresh Rate than KDE.


Safe Rust is demonstrably not memory-safe: https://github.com/Speykious/cve-rs/tree/main

> On Android, however, this is not as easy or straightforward and I cannot think of a way to do this, to be honest. That is why I prefer these programs to have Tor bundled and run the hidden service by themselves with a hardened-enough torrc. Ricochet does this on desktop, which I think is the right way to go about this. SimpleX's server (https://github.com/simplex-chat/simplexmq) should do this.

What I do is run Wireguard on my server with a Tor daemon, connect to the WG network on my phone and then access the SOCKS and DNS proxies the Tor daemon exposes.

That way there is no need for Orbot or running Tor on Android at all.


Probably something like "In a strike of great coincidence, we both met because we went walking our dogs at the same temporal coordinate"

> Animated PNGs can't beat GIF nevermind video compression algorithms.

Not entirely true, it depends on what's being displayed, see a few simple tests specifically constructed to show how much better APNG can be vs GIF and {,lossy} webp: http://littlesvr.ca/apng/gif_apng_webp.html

Of course I don't think it generalizes all that well…


Going to the USA as a tourist might be the most stupid action that one can make at this time. Unless you have a dying mother or father, there is absolutely no reason to visit this country. It reminds me of the tourists that used to go to North Korea for fun some years ago, it never was a good idea.

Could you clarify with regarding to .onion? How would I set this up for SimpleX and how would I configure SimpleX to use it, on, say, Android and Linux? I believe to use Tor with SimpleX, you would have to use Orbot, for example. What would I have to set up and how, on Linux? Genuine question. I would much prefer to self-host it.

I would also like to know how I would configure SimpleX on Android to use my own SMP servers.

Edit: I found this: https://simplex.chat/docs/server.html.

And I found:

  # `socks_mode` can be 'onion' for SOCKS proxy to be used for .onion destination hosts only (default)
  # or 'always' to be used for all destination hosts (can be used if it is an .onion server).
  # socks_mode: onion
In any case, I believe what I was looking for is https://simplex.chat/docs/server.html.

Also supported by Forgejo since version 10 (released in January of this year):

https://forgejo.org/2025-01-release-v10-0/#new-features

https://codeberg.org/forgejo/forgejo/pulls/4753


Have you tried 'sudo adb start-server' before running any adb commands?


1. Install android SDK / android studio on your computer.

2. Plug phone in to computer using USBC cable.

3. Answer prompt on phone granting permission to computer.

4. Run adb commands.


> The idea of taking a screenshot of the terminal and then parsing that to determine the true colour support is definitely novel,

A better way to do this is to send `OSC 1 0 ; ? ST` (query foreground color), `OSC 1 1 ; ? ST` (background color), then `OSC 4 ; {n} ; ? ST` where {n} is the nth XTerm color.

See: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h4-O...


You can use a BEAM system to orchestrate other code, too. As ports, port drivers, nifs, c-nodes, just other OS processes spawned and using IPC/sockets. Lots of options. Using Erlang to supervise an OS process doing work perhaps enhances the isolation principles of BEAM.

Hidden volumes or steganography have been around for a while for the explicit purpose of 'plausible deniability': https://www.truecrypt.org

What about:

    source <(cat .env | xargs)
or:

    export $(cat .env | xargs)
And then:

    unset $(cat .env | cut -d= -f1)
?

The last one unsets the environment variables that were set by the first command, ensuring they are not persisted beyond the current shell session.

If you are worried about forgetting to execute it, there are a couple of ways to work around it, depending on your case.


Yes, you can build fully server rendered web apps with Phoenix. You'd need HTML templates for that though, so you shouldn't use the --no-html option.

--no-webpack is deprecated as Phoenix uses esbuild now but see the docs: "--no-esbuild - do not include esbuild dependencies and assets. We do not recommend setting this option, unless for API only applications, as doing so requires you to manually add and track JavaScript dependencies"


There is a vast gap between walled garden cloud service rent seeking and giving away software as open source. In the olden days you could buy software licenses to run it wherever you wanted.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: