This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_real_ipaddress() { | |
if (!empty($_SERVER['HTTP_CLIENT_IP'])) { | |
return $_SERVER['HTTP_CLIENT_IP']; | |
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { | |
return $_SERVER['HTTP_X_FORWARDED_FOR']; | |
} | |
return $_SERVER['REMOTE_ADDR']; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (array_key_exists("signed_request", $_REQUEST)) { | |
$signed_request = $_REQUEST["signed_request"]; | |
list($encoded_sig, $payload) = explode(".", $signed_request, 2); | |
$data = json_decode(base64_decode(strtr($payload, "-_", "+/")), true); | |
$app_data = json_decode($data['app_data'], true); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_real_ipaddress() { | |
if (!empty($_SERVER['HTTP_CLIENT_IP'])) { | |
return $_SERVER['HTTP_CLIENT_IP']; | |
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { | |
return $_SERVER['HTTP_X_FORWARDED_FOR']; | |
} | |
return $_SERVER['REMOTE_ADDR']; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generate private key | |
openssl genrsa -des3 -out server.key 1024 | |
# Generating the CSR (certificate signing request): | |
openssl req -new -key server.key -out server.csr | |
# Generating the self signed certificate: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service ntp stop && date -s "`date`" && service ntp start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ bundle exec irb | |
>> require 'resque' | |
>> Resque.redis = 'redis://username:password@regisip:9201/' | |
>> Resque::Worker.all.each {|w| w.unregister_worker} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Bluetooth for VirtualBox | |
--delay 5 | |
set question to display dialog "Manage Bluetooth for ... " buttons {"VirtualBox", "Cancel", "Mac OS"} default button "Cancel" cancel button "Cancel" with icon caution with title "Bluetooth" giving up after 30 | |
set answer to button returned of question | |
if answer is equal to "VirtualBox" then | |
-- delay 30 | |
try |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>be.noort.purge</string> | |
<key>Program</key> | |
<string>/usr/bin/purge</string> | |
<key>LowPriorityIO</key> | |
<true/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo ln /usr/bin/gcc /usr/bin/gcc-4.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem install libv8 |