Skip to content

Instantly share code, notes, and snippets.

View dausruddin's full-sized avatar
🏠
Working from home

dausruddin

🏠
Working from home
View GitHub Profile
@dausruddin
dausruddin / curl.php
Last active September 19, 2016 07:17
Curl example with proxy
<?php
$url = 'http://dynupdate.no-ip.com/ip.php';
$proxy = '123.199.146.161:3128';
//$proxyauth = 'user:password';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_PROXY, $proxy);
//curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyauth);
Source: http://vandorp.biz/2012/01/installing-a-lightweight-lxdevnc-desktop-environment-on-your-ubuntudebian-vps/#.V8Tf-qkRVPA
# Make sure Debian is the latest and greatest
apt-get update
apt-get upgrade
apt-get dist-upgrade
# Install X, LXDE, VPN programs
// http://stackoverflow.com/a/7974253
$encoded_url = preg_replace_callback('#://([^/]+)/([^?]+)#', function ($match) {
return '://' . $match[1] . '/' . join('/', array_map('rawurlencode', explode('/', $match[2])));
}, $unencoded_url);