Skip to content

Instantly share code, notes, and snippets.

View scilganon's full-sized avatar
🔥

Maxim Bulyhin scilganon

🔥
View GitHub Profile

Sharing Host VPN with VirtualBox guest

Actually, this already works using VirtualBox’s NAT networking mode in your guest. What doesn’t work is resolving domain names from the guest that are only known in the VPN network.

So if you have a a domain like w3.mycompany.com that only resolves using the VPN’s DNS, you can resolve that name from your host (which is connected to the VPN), but not from your guest by default. You won’t be able to ping w3.mycompany.com from the guest. However, if you try to ping the IP address from your guest, that works.

To solve this, VirtualBox has a nice feature to allow you to set the Host DNS resolver as the DNS proxy of a VirtualBox VM. To configure this, you first need to figure out the id of your VirtualBox VM:

$ VBoxManage list vms
@aidanbon
aidanbon / myParseInt.js
Last active December 30, 2022 08:31
Implementation of the parseInt function.
/**
* myParseInt.js
* My implementation of the parseInt function.
* The function takes a string and returns an integer. i.e. int myParseInt(string str)
*
* Download this file to run the program and test cases:
* % node myParseInt.js
*
* Sample output:
* Correct: "999.4" --> 999
@jboner
jboner / latency.txt
Last active August 1, 2025 22:01
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD