Skip to content

Instantly share code, notes, and snippets.

View ruverav's full-sized avatar

Rubén Verdute ruverav

View GitHub Profile
@ryanjbonnell
ryanjbonnell / wp-config.php
Created March 12, 2014 15:51
WordPress Config: Use X-Forwarded-For HTTP Header to Get Visitor's Real IP Address
// Use X-Forwarded-For HTTP Header to Get Visitor's Real IP Address
if ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
$http_x_headers = explode( ',', $_SERVER['HTTP_X_FORWARDED_FOR'] );
$_SERVER['REMOTE_ADDR'] = $http_x_headers[0];
}
@patrocle
patrocle / Nginx + Apache reverse proxy REAL IP.md
Last active April 25, 2024 15:02
Real IP for Apache (Nginx reverse proxy)

NGINX 1.10 + APACHE 2.4 real IP for reverse proxy

Edit nginx conf

default.conf or what you want

vim /etc/nginx/conf.d/default.conf

add proxy_set_header for php files

@tkon99
tkon99 / guide.md
Last active June 13, 2024 21:53
Use Mosh on Windows from the Command Prompt

Hi all. After wanting true color support in Mosh (to use Brow.sh), I also wanted to integrate it more tightly with Windows. Since I reckon more people will be wanting to accomplish this, here is a guide.

  1. Install Linux Subsystem for Windows if you haven't already (https://docs.microsoft.com/en-us/windows/wsl/install-win10) (I use Ubuntu)
  2. Make sure you can execute bash from a CMD prompt.
  3. Go into the bash environment by executing bash ~ in CMD prompt
  4. Install Mosh-dev (for up-to-date version) from https://launchpad.net/~keithw/+archive/ubuntu/mosh-dev by doing sudo add-apt-repository ppa:keithw/mosh-dev then sudo apt-get update
  5. Create a new mosh.bat file on your Desktop with the following contents
@echo off