VirtualBox host IP address and hostname
When you are using NAT Show archive.org snapshot in your virtual machine (which you should), the host's IP address is:
10.0.2.2
You'll need it to access shared folders or your host's web server when testing pages in IE.
Fun fact: You could also use vbox.srv
-- that's the corresponding hostname.
Related cards:
Apache: Require username/password authentication except from a single IP, host or network
You configured authentication in your Apache configuration that requires username and password but you want a single IP address, host or network to allow access without entering credentials you can use the code below.
To allow a network you can u...
Ruby: Extract the hostname from a URL
url = 'http://www.foocorp.com/foo/bar'
URI.parse(url).host
# => www.foocorp.com
Note that this will raise an error if the given argument is not a URL.
If you need the host's full URL without path, query, fragment etc., use [`URI....
How to fix: Unable to read files from a VirtualBox shared host folder
When you want to copy/move from a shared folder (on Windows guests, for example) and it fails with absurd error messages (lots of text or an error about the target being read-only), you are probably running on Guest Additions that no longer match ...
Configuring ActionMailer host and protocol for URL generation
When you generate a URL in a mailer view, ActionMailer
will raise an error unless you previously configured it which hostname to use.
There are t...
Internet Explorer to Start Automatic Upgrades across Windows XP, Windows Vista, and Windows 7
This will hopefully kill IE6 and IE7 for good. The latest available IE for Windows XP is IE8 though.
Stub a request's IP address in a Cucumber scenario
The solution in this card is based on a stack overflow post by Leventix.
If you need to make request come from a fixed IP ...
Use the ALT key in a VirtualBox Windows VM
In Ubuntu your ALT key is locked when you're working in VirtualBox. There are two workarounds for this:
- Press the Windows key in addition to the ALT key
- Run the attached registry file and restart Windows. Your left Windows key is now the ALT ...
Detect city, country from IP address
- You can detect city and country from an IP address by using the GeoLite database. This is a flat file you can copy into your project (~ 20 MB).
- You can access the database using the [geoip](http://geoip....
AWS Public IP Address Ranges Now Available in JSON Form
I am happy to announce that this information is now available in JSON form at https://ip-ranges.amazonaws.com/ip-ranges.json. The information in this file is generated from our internal system-of-record and is authoritative. You can expect it ...
Bash: How to count and sort requests by IP from the access logs
Example
87.140.79.42 - - [23/Jan/2024:09:00:46 +0100] "GET /monitoring/pings/ HTTP/1.1" 200 814 "-" "Ruby"
87.140.79.42 - - [23/Jan/2024:09:00:46 +0100] "GET /monitoring/pings/ HTTP/1.1" 200 814 "-" "Ruby"
87.140.79.41 - - [23/Jan/2024:09...