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
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
// 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
<?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
<?php | |
/** | |
* Photograph | |
* | |
* @package Main | |
* @subpackage Basic | |
* @author Faizan Ayubi | |
*/ | |
class Photograph extends DatabaseObject { | |
protected static $table_name = "photographs"; |
NewerOlder