Better HN
topnewbestaskshowjobs
Log inSign up

yuuta

434 karma · joined Mar 26, 2021 (5y ago) · 57 submissions

Just a student interested in computer science. Use Java / C. https://blog.yuuta.moe
Submissions

1.

Nginx access log to standard output is not as easy as using /dev/stdout(blog.yuuta.moe ↗)

2 points · by yuuta · 2y ago · discuss

comment 3y ago · link · parent

RIP

comment 3y ago · link · parent

I never trusted Signal due to https://github.com/net4people/bbs/issues/60

comment 3y ago · link · parent

Ever since Microsoft acquisition

comment 3y ago · link · parent

Still no #embed

comment 3y ago · link · parent

That's a pretty good article, but I expect more in-depth information on booting modern Intel CPUs ... I am very interested in modern UEFI / BIOS firmware development and how do they bring up x86 CPUs, but unfortunately there are very little source (I guess, except for EDK2), and the majority (?) of x86 firmwares are proprietary. Booting x86 is much more complicated than writing a linker script with a vector table for your microcontroller ... so, this seems very interesting.

comment 3y ago · link · parent

I have been running my homelab for 2 ~ 3 years, and I never considered rpi to be one of the servers ... It is just for toys or some "high school robots" stuff, with 0% availability and are very fragile. How many times your SD card fail / filesystem break / undervolt occurs / accidentally short-circuit? If you want to have a host running Linux 24 * 7, go with a used Thin Client on eBay (they are at least x86). If you are like me who want to build a rack at home, go with some used PowerEdge / ProLiant gears from eBay. They do way better things than your Pi (with BMC, Xeon cores, and ECC memory, possibly), and they are cheaper as well (my PowerEdge R520 servers only cost less than C$200 each). These machines have proper CPU, hard drive, and power supply. Do not use a Pi unless you are building some IoT experiments that require GPIOs.

comment 3y ago · link · parent

I'm always using the Enterprise edition. No such crap.

Microsoft should treat consumers better.

comment 3y ago · link · parent

Better way: use Get-AppxProvisionedPackage and Remove-AppxProvisionedPackage during OOBE to remove them for all users.

Bonus: Use these cmdlets on a offline mounted WIM image to build a custom image without bloats.

comment 3y ago · link · parent

It may be better if we have something similar to (pseudocode) for kernel APIs:

  struct uptime_t u = {
  
      .time = 0
  
  };

  ioctl(open("/proc/uptime"), GET_UPTIME, &uptime);

comment 3y ago · link · parent

Indeed. Parsing files is a less robust way compared to calling some APIs or at least parsing some files with a schema (e.g. JSON or XML). For example, uptime(1) on Linux:

% strace uptime 2> /tmp/strace && grep proc /tmp/strace

17:35:24 up 3 days, 7:47, 1 user, load average: 2.29, 1.85, 1.56

openat(AT_FDCWD, "/usr/lib/libprocps.so.8", O_RDONLY|O_CLOEXEC) = 3

openat(AT_FDCWD, "/proc/self/auxv", O_RDONLY) = 3

openat(AT_FDCWD, "/proc/sys/kernel/osrelease", O_RDONLY) = 3

openat(AT_FDCWD, "/proc/self/auxv", O_RDONLY) = 3

openat(AT_FDCWD, "/proc/uptime", O_RDONLY) = 3

openat(AT_FDCWD, "/proc/loadavg", O_RDONLY) = 4

comment 3y ago · link · parent

NT and Unix are completely different OS. You cannot develop Windows programs the Unix way, and vice versa.

comment 4y ago · link · parent

Very impressive ... I hope I can get a /24.

comment 4y ago · link · parent

I don't see the whole point. It's like creating yet-another-ntp-implementation while other well-known implementations are known to be working good and safely on billions of devices.

It is easier to report a security issue to ntpd or chrony instead of creating a new one.

comment 4y ago · link · parent

Benefits:

* Unified protocol to manage networking facilities

* iproute2 for FreeBSD, deprecating ifconfig(1) stuff

16.

FreeBSD Supports Netlink(7) and Iproute2(cgit.freebsd.org ↗)

2 points · by yuuta · 4y ago · 1 comment

comment 4y ago · link · parent

Note: it does not do any optimization, but delegating this task to the C compiler.

18.

Alternative Rust compiler producing C(github.com ↗)

2 points · by yuuta · 4y ago · 1 comment

19.

YouTube-dl has an interpreter for a subset of JavaScript in 870 lines of Python(twitter.com ↗)

473 points · by yuuta · 4y ago · 155 comments

comment 4y ago · link · parent

I had been using Xournal++ for a year, and it is truly amazing.

comment 4y ago · link · parent

With the same or even cheaper price, you can get a much more powerful and enterprise grade refurbished rack server on eBay.

comment 4y ago · link · parent

Thank you. I'm using sshfs every day to remotely access my computer and servers from my laptop. Although it's slow, it works. I'm considering to switch to NFS instead.

comment 4y ago · link · parent

rofi is pretty good though.

comment 4y ago · link · parent

No. It's based on Gtk, but unfortunately it's Windows version does not have the Windows look and feel, so it feels a little bit wired.

comment 4y ago · link · parent

I had been using Xournal++ for several months, and it was amazing. The only problem is that it cannot select and copy texts from the PDF, but this is scheduled in the next release. Looking forward to it.

For hardware, I'm using Wacom 672. It has pretty good Linux drivers.

comment 4y ago · link · parent

Useless use of dd: dd if=/path/to/file of=/dev/stdout

comment 4y ago · link · parent

First, setup a pair of tunnels. There are multiple tutorials doing this. You could check Arch Linux Wiki of how to. On my setup, I assigned a pair of /31 addresses to each side just for the internal communication.

Then, if you want to use IPv4 NAT, set up SNAT and DNAT. I'm taking Linux's iptables for an example: on the VPS:

iptables -t nat -A PREROUTING -d <VPS Public IP>/32 -p tcp --dport port -j DNAT --to-destination <IP of another side of the WireGuard tunnel> iptables -t nat -A POSTROUTING -o <VPS Internet facing NIC> -j MASQUERADE

The first statement sets SNAT on IPv4 TCP (UDP is also possible) on a specified port. All packets going into this machine (dst = VPS public IP) will go into the other side of your WireGuard tunnel. -d <VPS Public IP>/32 makes sure that the packets forwarding to the VPN side won't get NATed. If you need multiple ports or protocols, just duplicate this line.

The second statement sets DNAT on the VPS. It makes the packets from your VPN side goes to the outside (sorry I'm not an expert in networking principals so that's my understanding).

On your local side, you just set up the tunnel and set your machine's default gateway to your VPS's tunnel IP address. Make sure you add a static route to your VPS's public address (WireGuard Endpoint) if you are connecting WireGuard using an IPv4 endpoint or it will get routed to your tunnel and you will disconnect.

I also sometimes setup IPv6 tunnels without NAT. On the VPS I just setup a WireGuard interface with /64 and assign each peer a /128. No NAT is needed for this case.

comment 4y ago · link · parent

Why not WireGuard? WireGuard + SNAT (port forwarding on the VPS) + DNAT (route the packets back) does the same thing, and it's faster than using SSH to do HTTP reverse proxy.
12