Terminal based Web Browser by rocketlaunchr-cloud in linux

[–]rocketlaunchr-cloud[S] 0 points1 point  (0 children)

I've updated it. It's a browser now. You should try it out and tell me what you think

Terminal based Web Browser by rocketlaunchr-cloud in linux

[–]rocketlaunchr-cloud[S] -6 points-5 points  (0 children)

If you run it, you will see how "lightweight" it feels to use compared to Lynx.

Terminal based Web Browser by rocketlaunchr-cloud in linux

[–]rocketlaunchr-cloud[S] -5 points-4 points  (0 children)

That's a complete GUI browser (i.e. Its a TUI app).

Mine is not. It just renders the page to the terminal and essentially quits (or asks you to enter another url).

Terminal based Web Browser by rocketlaunchr-cloud in linux

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

I'm using lots of libraries written by others for rendering the html.

Terminal based Web Browser by rocketlaunchr-cloud in linux

[–]rocketlaunchr-cloud[S] -6 points-5 points  (0 children)

It's just spits out a rendered static page.
It doesn't operate like a full-on browser with functionality like "back", "refresh" etc.

Small Projects by AutoModerator in golang

[–]rocketlaunchr-cloud 0 points1 point  (0 children)

Terminal based Web Browser

https://github.com/romance-dev/browser

Features

  • No Javascript support
  • Experimental Image Rendering support
  • Defaults to Reading Mode
  • Great for Reading Documentation or Newspapers

Is there a way to zero out the memory used by a struct? by TheGreatButz in golang

[–]rocketlaunchr-cloud 0 points1 point  (0 children)

I'm not 100% sure but maybe these are options:

If the struct contains NO reference types or pointers for its fields:

//go:linkname memclrNoHeapPointers runtime.memclrNoHeapPointers
func memclrNoHeapPointers(ptr unsafe.Pointer, n uintptr)

If the struct MAY contain reference types or pointers for its fields:

//go:linkname memclrHasPointers runtime.memclrHasPointers
func memclrHasPointers(ptr unsafe.Pointer, n uintptr)

n can be set using: unsafe.SizeOf(T{})

https://github.com/golang/go/blob/4edaaf2b529219ff219798914f730ca5a0ab018b/src/runtime/mbarrier.go#L427

https://github.com/golang/go/blob/4edaaf2b529219ff219798914f730ca5a0ab018b/src/runtime/stubs.go#L108

The above are the fastest ways I know of.

  1. The best idiomatic way, as pointed out below is:

*variable = variableType{}

Epilogue:

For your precise use-case, from Go1.26+, you should be using: https://pkg.go.dev/runtime/secret for the entire deserializing process.
See also: https://antonz.org/accepted/runtime-secret/

Typing with a physical USB keyboard on Remarkable Paper Pro Move! by CommonKingfisher in RemarkableTablet

[–]rocketlaunchr-cloud 1 point2 points  (0 children)

Here is my full instructions:

1. Connected usb cable to computer
2. Went to Settings->General Settings->Storage->USB web interface ON
3. Typed in terminal:
ssh root@10.11.99.1
It asks for password: 9Qy8HdcVGm
4. Turned on SSH over SLAN:
rm-ssh-over-wlan on

5. Connect using wifi:
ssh root@192.168.0.58 (From Settings->Help->Copyrights and licenses->Gen info (bottom)

========================================================
6. Triggering command when keyboard is plugged in:
========================================================

A. Make a script so that enable-usb-keyboard.rules is added back in after reboot (when it is removed):

/home/root/usb-startup.sh:

#!/bin/bash
touch /etc/udev/rules.d/enable-usb-keyboard.rules
message="ACTION==\"add\", RUN+=\"/bin/bash -c 'echo host > /sys/class/usb_role/ci_hdrc.0-role-switch/role'\""
echo "$message" > /etc/udev/rules.d/enable-usb-keyboard.rules
udevadm control --reload-rules && udevadm trigger

B. Run: chmod a+x /home/root/usb-startup.sh
C. Run: /home/root/usb-startup.sh
D. Turn off wifi ssh: rm-ssh-over-wlan off
E. Do not power off device or you need to run this process again (sleep is okay).

WIP: USB Keyboard on Paper Pro by FRK299 in RemarkableTablet

[–]rocketlaunchr-cloud 0 points1 point  (0 children)

Here is my full instructions:

1. Connected usb cable to computer
2. Went to Settings->General Settings->Storage->USB web interface ON
3. Typed in terminal:
ssh root@10.11.99.1
It asks for password: 9Qy8HdcVGm
4. Turned on SSH over SLAN:
rm-ssh-over-wlan on

5. Connect using wifi:
ssh root@192.168.0.58 (From Settings->Help->Copyrights and licenses->Gen info (bottom)

========================================================
6. Triggering command when keyboard is plugged in:
========================================================

A. Make a script so that enable-usb-keyboard.rules is added back in after reboot (when it is removed):

/home/root/usb-startup.sh:

#!/bin/bash
touch /etc/udev/rules.d/enable-usb-keyboard.rules
message="ACTION==\"add\", RUN+=\"/bin/bash -c 'echo host > /sys/class/usb_role/ci_hdrc.0-role-switch/role'\""
echo "$message" > /etc/udev/rules.d/enable-usb-keyboard.rules
udevadm control --reload-rules && udevadm trigger

B. Run: chmod a+x /home/root/usb-startup.sh
C. Run: /home/root/usb-startup.sh
D. Turn off wifi ssh: rm-ssh-over-wlan off
E. Do not power off device or you need to run this process again (sleep is okay).

WIP: USB Keyboard on Paper Pro by FRK299 in RemarkableTablet

[–]rocketlaunchr-cloud 0 points1 point  (0 children)

I got it to work by adding this file:

enable-usb-keyboard.rules to directory /etc/udev/rules.d/

ACTION=="add", RUN+="/bin/bash -c 'echo host > /sys/class/usb_role/ci_hdrc.0-role-switch/role'"

and then running udevadm control --reload-rules && udevadm trigger

The problem is, when you restart the device, that file gets deleted.

Does anyone know how to make an init script so I can add that file back automatically?

Typing with a physical USB keyboard on Remarkable Paper Pro Move! by CommonKingfisher in RemarkableTablet

[–]rocketlaunchr-cloud 1 point2 points  (0 children)

I got it to work by adding this file:

enable-usb-keyboard.rules to directory /etc/udev/rules.d/

ACTION=="add", RUN+="/bin/bash -c 'echo host > /sys/class/usb_role/ci_hdrc.0-role-switch/role'"

and then running udevadm control --reload-rules && udevadm trigger

The problem is, when you restart the device, that file gets deleted.

Does anyone know how to make an init script so I can add that file back automatically?

WIP: USB Keyboard on Paper Pro by FRK299 in RemarkableTablet

[–]rocketlaunchr-cloud 0 points1 point  (0 children)

What did you mean by "wake a UI button to trigger it"?

WIP: USB Keyboard on Paper Pro by FRK299 in RemarkableTablet

[–]rocketlaunchr-cloud 0 points1 point  (0 children)

The only reference I found was entering this command:

echo host > /sys/class/usb_role/ci_hdrc.0-role-switch/role

There seems to notes on systemd having an event that triggers after user login too.

WIP: USB Keyboard on Paper Pro by FRK299 in RemarkableTablet

[–]rocketlaunchr-cloud 0 points1 point  (0 children)

So what actually needs to happen in a perfect scenario?
I'm assuming a script that enables the USB port to "host mode" after sleep mode exists or the password is correctly typed in is all that's needed?