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
AuthName "Protected" | |
AuthType Basic | |
Require valid-user | |
AuthUserFile /ABSOLUTE_URL/.htpasswd |
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
CREATE OR REPLACE VIEW table_name AS | |
SELECT p.title, c.name FROM post AS p INNER JOIN category AS c ON p.category_id = c.ID; |
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
grep -Rli "words" |
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
UPDATE table | |
SET column = REPLACE(column, ‘search’, ‘replace’); |
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
defaults write com.apple.finder AppleShowAllFiles YES | |
defaults write com.apple.finder AppleShowAllFiles NO |
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
ssh username@hostname |
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
find . -type d -exec chmod 755 {} \; | |
find . -type f -exec chmod 644 {} \; | |
chown -R root:root *; | |
sudo chown -R $(whoami) . | |
sudo chmod -R 777 . |
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
# Compress | |
tar -cvf folder.tar folder/ | |
gzip folder.tar | |
# Extract | |
tar -xvf folder.tar | |
gzip -d folder.tar.gz |
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
<IfModule mod_rewrite.c> | |
Options -MultiViews | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^(.*)$ index.php [QSA,L] | |
</IfModule> | |
<IfModule !mod_rewrite.c> | |
<IfModule mod_alias.c> | |
RedirectMatch 302 ^/$ /index.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
## Function | |
function rgar( $array, $name ) | |
{ | |
if ( isset($array[$name]) ) | |
{ | |
return $array[$name]; | |
} | |
return ''; | |
} |
NewerOlder