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
git clone [git URL] - to clone the URL from gitlab/github/bitbucket | |
git branch -a - to list current to remote branch | |
git checkout [branch name] - to move/checkout to branch name | |
git status - to view the status of the local files and remote branch files in cloud | |
git diff [file] - to view the different between local and remove file | |
git add [files with a space] - to add new files to the repo | |
git commit -m "commit msg" - to commit with message | |
git push - push the code to the repo | |
# add remote |
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
/var/www/html/var/log/*.log { | |
daily | |
missingok | |
rotate 14 | |
compress | |
notifempty | |
create 0777 magento2-file-username magento2-file-username | |
} |
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
To split the date and time from datetime value | |
$date = strtotime('8/29/2011 11:16:12 AM'); | |
$dat = date('m/d/y', $date); | |
$tme = date('H:m:s A',$date); | |
ucfirst() - makes the first letter of the input string uppercase. | |
upfirst('hello world!') - returns 'Hello world!'; |
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
/var/www/html/var/log/*.log { | |
daily | |
missingok | |
rotate 14 | |
compress | |
notifempty | |
create 0777 www-data www-data | |
} | |
setup cron job |
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
ALTER TABLE master_activity_log CHANGE `from_user_id` `user_id` INT(11); // change column name | |
ALTER TABLE master_activity_log DROP log_date; // remove column | |
ALTER TABLE master_activity_log ADD COLUMN log_datetime DATETIME AFTER after_save; // create new column of existing table | |
Truncate foreign key constraints table : | |
SET FOREIGN_KEY_CHECKS = 0; | |
TRUNCATE TABLE `table name`; | |
SET FOREIGN_KEY_CHECKS=1; |
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 `customer_entity` | |
SET `password_hash` = CONCAT(SHA2('xxxxxxxxYOURPASSWORD', 256), ':xxxxxxxx:1') // change YOURPASSWORD to your password to reset | |
WHERE `entity_id` = 19975 and `email`="gideon.b@domain.com"; |
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
#!/usr/bin/python | |
import MySQLdb | |
import datetime | |
# Open database connection | |
db = MySQLdb.connect("localhost","root","","know_your_beat" ) | |
# prepare a cursor object using cursor() method | |
cursor = db.cursor() |
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 | |
define( 'API_ACCESS_KEY', 'AIzaSyA7TJAvFZrD_asZM92xoWM5u5MD-uMyYH0' ); | |
$registrationIds = array( | |
"cQ8E8TvwQxg:APA91bHGxk5NBPze0_zOTQLif9s5VpOYzCyEvPmFlP3PD5FI6_5LyIVNkTKlfpSS9wy4SpO5iIX7Jdvp3nNLMYvCk6IbNRE_ykplP-Es8ebuJPF_tHhhzVS6TjWS5gDlC0Fp8JIkckNy", | |
"d5ttcEFtdg8:APA91bGu7QvkTkGKi4l6GviGCYgSQsv0bRLmgxlbJCDmM6iBmcOT5XAtwyQ1vprQCeTIkAvXwxb_IlitoQF335ynDyrvZXRTaN8HgDe8WFf__RI06ahec1yx0EbwkuzUI5h_s5WWP_tl" | |
); | |
$msg = array | |
( | |
'body' => 'The Chennai Silks', | |
'title'=> 'Welcome to TCS!', |
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
onselectstart="return false" onpaste="return false;" onCopy="return false" onCut="return false" onDrag="return false" onDrop="return false" autocomplete=off |
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@domain.com -p 22 | |
cd public_html/blogdemo/ | |
wget http://wordpress.org/latest.tar.gz | |
tar xfz latest.tar.gz | |
mv wordpress/* ./ | |
rmdir ./wordpress/ | |
rm -f latest.tar.gz |