This file contains 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 | |
/** | |
* Attempt to wrap Http Authentication into a separate class... | |
* | |
* Ideas and some code from FuelPHP Controller_Rest | |
* https://github.com/fuel/fuel/blob/develop/fuel/core/classes/controller/rest.php | |
* | |
*/ |
This file contains 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
#add existing to git | |
git init | |
git add . | |
git remote add origin [email protected]:USERNAME/REPONAME.git | |
git push -u origin master | |
#remove svn | |
find . -name '.svn' -type d -print0 | xargs -0 rm -rf | |
git commit -a -m 'removing svn files' |
This file contains 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
svn | git | |
svn revert | git reset --hard ;git pull OR git stash;git pull;git stash pop | |
svn commit -m 'message' | git commit -m 'message';git push | |
svn update | git pull |
This file contains 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
iptables -I INPUT \! --src {ip address} -m tcp -p tcp --dport {port number} -j DROP |
This file contains 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
public function action_memcache(){ | |
$memcache_enabled = extension_loaded("memcache"); | |
dump("Memcache enabled: ".$memcache_enabled); | |
//memcached simple test | |
$memcache = new Memcache; | |
$memcache->connect('localhost', 11211) or die ("Could not connect"); | |
$key = md5('9000'); //something unique | |
for ($k=0; $k<5; $k++) { | |
$data = $memcache->get($key); |
This file contains 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
select COLUMN_NAME from information_schema.COLUMNS where TABLE_NAME='table' |
This file contains 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
wget -c \ | |
http://download.virtualbox.org/virtualbox/4.1.12/VBoxGuestAdditions_4.1.12.iso \ | |
-O VBoxGuestAdditions_4.1.12.iso | |
sudo apt-get install build-essential linux-headers-`uname -r` | |
sudo mount VBoxGuestAdditions_4.1.12.iso -o loop /mnt | |
sudo sh /mnt/VBoxLinuxAdditions.run --nox11 | |
rm *.iso |
This file contains 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 iptables -I INPUT -s 138.162.8.0/24 -j DROP |
This file contains 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
iptables -D INPUT {rule #} |
This file contains 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
svn copy -r [version #] [svnurl]@[version #] . |