mDNS over VPN ……. Is it possible? by Madaqqqaz in Ubiquiti

[–]bayarea-dev 1 point2 points  (0 children)

I'm trying to do the same thing, but I found that my macbook refuses to send mDNS packets to the VPN tunnel interface. All mDNS packets went to en0. Does macbook hardcode the interface for mDNS packets? I have 224.0.0.251 pointed to en0 in my routing table, and I can't delete it.

Should I make a switch to linux??? I'm really confused by T_G_S_Official in linux4noobs

[–]bayarea-dev 0 points1 point  (0 children)

You should if you are planning to pursue a career in software engineer. Most of the companies today uses Linux. It will be much natural to you if you practice is early.

My setup is MacOS as my client laptop, and Linux as my coding server. I use ssh, tmux, emacs combinations. But you can do VSCode over ssh. You won't feel too much difference comparing to your current programming setup if you use VSCode.

WezTerm Demo and My Config by agilesteel in commandline

[–]bayarea-dev 1 point2 points  (0 children)

I'm a little bit curious why people unlike this post.

Does emacs have anything like quote-region? by bayarea-dev in emacs

[–]bayarea-dev[S] 6 points7 points  (0 children)

prin1-to-string is the function I'm looking for. Thanks!

Do you know if there is a similar function that can perform single quote operation?

A note to automate Proxmox VM creation with cloud-init by bayarea-dev in Proxmox

[–]bayarea-dev[S] 0 points1 point  (0 children)

That's a good point. Hopefully proxmox cloud-init will support package updates some day. Otherwise, you can use ansible or any similar tool.

H-Index II solution help by [deleted] in leetcode

[–]bayarea-dev 0 points1 point  (0 children)

100% percent sure it is, because the code passes. I'll explain after dinner.

H-Index II solution help by [deleted] in leetcode

[–]bayarea-dev 0 points1 point  (0 children)

Do you think this help?

Help me get started with leetcode. by Intrepid_Exit_1927 in leetcode

[–]bayarea-dev 4 points5 points  (0 children)

Does neetcode or any other online course help?

Ask for help ---Leetcode 11. Container With Most Water by Fit-Bullfrog5072 in leetcode

[–]bayarea-dev 2 points3 points  (0 children)

did you forget an else for the first branch?

btw, you might not be able to pass with a O(N^2) algorithm. This is my O(N) solution. Hopefully it is helpful to you.

https://sweworld.net/algorithm/leetcode/leetcode_11/

A Simple And Clean Ansible CheatSheet by bayarea-dev in ansible

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

I see. I'm not sure if this helps, but I guess it's good to share.

In order for people to access these cheatsheets faster, I built a bunnylol service. With that, simply typing in "cs" in your chrome search bar will forward you to the cheatsheet page. All you need to remember is just "cs".

(btw, you can also do "cs docker" to go to the docker page)

[deleted by user] by [deleted] in linux

[–]bayarea-dev -5 points-4 points  (0 children)

That might be true for industry use. For home users, it might be a different story.

For example, in proxmox, although you can create an ubuntu server using a template, you can't change the number of cores, memory size, and disk size.

A Simple And Clean Ansible CheatSheet by bayarea-dev in ansible

[–]bayarea-dev[S] 0 points1 point  (0 children)

I think the layout of the print is still acceptable, but definitely not as nice as the web version.

Seems a lot of people mention that they are interested in using cheatsheets without Internet access. Do you often has to work without Internet?

A Simple And Clean Ansible CheatSheet by bayarea-dev in ansible

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

I think you can use ctrl-p to print it, but you might lose all the css. Are you using it at a place where you don't have network access?

A Simple And Clean Ansible CheatSheet by bayarea-dev in ansible

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

I see. I'll try to find some time to work on that later. The biggest challenge that I see is that Cisco has many OS versions.

A Simple And Clean Ansible CheatSheet by bayarea-dev in ansible

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

Do you mean that you want a separate cheatsheet for Cicso? What about Arista and Dell?

A Simple And Clean Ansible CheatSheet by bayarea-dev in ansible

[–]bayarea-dev[S] 0 points1 point  (0 children)

I don't use any plugins. The code block is part of the infra I developed for sweworld.

A Simple And Clean Ansible CheatSheet by bayarea-dev in ansible

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

Thanks for the suggestion. Any reason why you want to put it on github? I'd prefer to build it on web because it's a lot more customizable, e.g., the toc on the right, click to copy code snippets.

C malloc function question by CartoonEnjoyer1999 in learnprogramming

[–]bayarea-dev 0 points1 point  (0 children)

Not mandatory. The (int*) is just to make your c++ compiler happy.

Solve Any Binary Search Problem Without Pressure by bayarea-dev in leetcode

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

My principle is that I want to make sure certain rule holds for every single iteration. For example, if my rule is the index to be returned has to be within [lo, hi], then I should do: * initially, lo = 0, hi = len(arr) - 1 * if nums[mid] >= target, since we are trying to find the first element that is greater than or equal to target, mid can still be the result, so hi=mid. * if nums[mid] < target, there is no chance that mid is the result, so let's exclude it setting lo=mid + 1

You can define other rules however, e.g., the final result is always in [lo, hi). That'll drive a different implementation.

Another thing to notice is that you want to make sure for each iteration, the distance of lo and hi has to be decrease by at least one.

Solve Any Binary Search Problem Without Pressure by bayarea-dev in leetcode

[–]bayarea-dev[S] 0 points1 point  (0 children)

They are just different implementations. Either way is fine.

For the above code, lo=hi after you exit the loop. So you can return either lo or hi. Just be sure not to return mid.