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 | |
/** | |
* Photograph | |
* | |
* @package Main | |
* @subpackage Basic | |
* @author Faizan Ayubi | |
*/ | |
class Photograph extends DatabaseObject { | |
protected static $table_name = "photographs"; |
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 | |
header("Content-type: application/vnd.ms-word"); | |
header("Content-Disposition: attachment;Filename=document_name.doc"); | |
echo "<html>"; | |
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=Windows-1252\">"; | |
echo "<body>"; | |
echo "<h1>My first document</h1>"; | |
echo "</body>"; | |
echo "</html>"; |
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
// These two need to be declared outside the try/catch | |
// so that they can be closed in the finally block. | |
HttpURLConnection urlConnection = null; | |
BufferedReader reader = null; | |
// Will contain the raw JSON response as a string. | |
String forecastJsonStr = null; | |
try { | |
// Construct the URL for the OpenWeatherMap query |
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. tar a file | |
tar -cf folder.tar folder/ | |
2. Backup database | |
mysqldump -uroot -p database_name > dumpfilename.sql | |
3. transfer files to server | |
wget -m --ftp-user=cloudstuffs --ftp-password=pass123 ftp://ftp.cloudstuffs.com/public_html.tar | |
or | |
scp [email protected]:/home/vijay/webackups/milan/www.tar /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
Change folder permissions and ownership | |
sudo chown -R username:group directory | |
remove all files and folder | |
rm -rf foldername | |
move contents of one foldr to another | |
mv -v public_html/* /home/mannan/web/viraltabloid.in/public_html/ | |
tar a file |
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
Search insert and update | |
INSERT INTO table (id, name, age) VALUES(1, "A", 19) ON DUPLICATE KEY UPDATE | |
name=VALUES(name), age=VALUES(age) |
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
<IfModule pagespeed_module> | |
ModPagespeed on | |
# using commands,filters etc | |
</IfModule> | |
<ifModule mod_deflate.c> | |
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/css text/javascript application/javascript application/x-javascript | |
</ifModule> | |
# BEGIN Expire headers |
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
Backup database | |
mysqldump -uroot -p database_name > dumpfilename.sql | |
Restore database | |
mysql -uroot -p database_name < dumpfilename.sql | |
Checks database for error | |
mysqlcheck chris_wordpress | |
Auto repair databases |
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. change domain owner | |
v-change-domain-owner DOMAIN USER [IP] |
OlderNewer