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
| // PDO Connection to MySQL | |
| $conn = new PDO('mysql:host=localhost;dbname=yourdbname', 'username', 'password'); | |
| // PDO Connection to PostgreSQL | |
| $conn = new PDO('pgsql:host=localhost;dbname=yourdbname', 'username', 'password'); | |
| // A quick Select Query with For Loop | |
| foreach ($conn->query("SELECT * FROM profile") as $row) | |
| echo $row['fullname']; |
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
| AuthType Basic | |
| AuthName "restricted area" | |
| AuthUserFile /home/prem/html/protect-dir/.htpasswd | |
| require valid-use | |
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
| #!/bin/bash | |
| ### Checking for user | |
| if [ "$(whoami)" != 'root' ]; then | |
| echo "You have no permission to run $0 as non-root user. Use sudo !!!" | |
| exit 1; | |
| fi | |
| ### Configure email and vhost dir | |
| email='[email protected]' # email address of administrator |
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 crypter($maCleDeCryptage="", $maChaineACrypter){ | |
| if($maCleDeCryptage==""){ | |
| $maCleDeCryptage=$GLOBALS['PHPSESSID']; | |
| } | |
| $maCleDeCryptage = md5($maCleDeCryptage); | |
| $letter = -1; | |
| $newstr = ''; | |
| $strlen = strlen($maChaineACrypter); | |
| for($i = 0; $i < $strlen; $i++ ){ |
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($){ | |
| var methods = { | |
| init : function( options ) { | |
| // Create some defaults, extending them with any options that were provided | |
| var settings = $.extend( { | |
| table : '', | |
| field :'', | |
| authentification:false |
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
| $carToDelimite = '@'; | |
| $string = 'this/is/a/string@text-to-delete'; | |
| $newString = substr($string, 0, strpos($string,$carToDelimite)); |
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
| -1- | |
| <VirtualHost *:80> | |
| ServerAdmin webmaster@localhost | |
| DocumentRoot /var/www | |
| <Directory /> | |
| Options FollowSymLinks | |
| AllowOverride None | |
| </Directory> | |
| <Directory /var/www/> |
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
| <!DOCTYPE HTML> | |
| <html> | |
| <head> | |
| <!--[if IE]> | |
| <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> | |
| <![endif]--> | |
| <script> | |
| var els = ['article', 'footer', 'header', 'section', | |
| 'nav', 'menu']; |
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
| mysql -u root -p | |
| USE mysql; | |
| UPDATE user SET password = PASSWORD('new-password') WHERE user = 'root'; | |
| FLUSH PRIVILEGES; |
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
| Pour vider le cache DNS sous Microsoft Windows (Win XP, Win ME, Win 2000 et Win 98) : | |
| Démarrer -> Exécuter -> tapez cmd | |
| Dans la fenêtre DOS, tapez ipconfig /flushdns | |
| Et voilà ! Votre cache DNS a été vidé. | |
| Pour vider le cache DNS sous Linux, il suffit de relancer le processus nscd : | |
| Tapez : |