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
#assuming we have already on mongo terminal | |
// this will resulting no row | |
> db.users.find({'email':'[email protected]'}).pretty() | |
// copying Greg's data and store it into temp variable 'marjuqi' | |
> marjuqi = db.users.findOne({'email':'[email protected]'}) | |
// generate new unique ID for 'marjuqi' data | |
> marjuqi._id = new ObjectId() |
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
# GRAB/EXPORT DATABASE | |
mongodump -d <database_name> -o <directory_backup> | |
# RESTORE/IMPORT | |
mongorestore -d <database_name> <directory_backup> | |
STEPS : | |
assuming we have already log into the server. |
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
# lets assume that we have something like below structure of /usr/bin folder | |
# on our Centos 7 | |
# | |
# this indicate that we've installed 2 version of php : 5.6 and 7.2 | |
# | |
# here is the example source that shows us how to install multiple php version on Centos 7: | |
# https://cloudwafer.com/blog/installing-multiple-versions-of-php-on-centos/ | |
# | |
# |
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
https://httpd.apache.org/docs/2.4/vhosts/examples.html | |
https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-centos-7 | |
https://www.rootusers.com/how-to-configure-an-apache-virtual-host/ |
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 | |
# created by marjuqi, sept 2018 | |
red=$'\e[1;31m' | |
green=$'\e[1;32m' | |
yellow=$'\e[1;33m' | |
blue=$'\e[1;34m' | |
endcolor=$'\e[0m' |
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
DevOps-Troubleshooting CHECK-list | |
check log files (if any) | |
check file accessability | |
file existence (name and path) | |
file ownership | |
file permission | |
check credentials |
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
how to find list of git commits that affecting/changed specific file | |
# show list commit with diff/changes detail | |
git log -p -- __PATH_TO_FILE__ | |
# show list commit without diff/changes detail |
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
^(ht{2}ps?:\/\/|w{3}\.)(w{3})?([a-z0-9\-]+\.?)+(\/[a-zA-Z0-9\-\.=?&^%#@_]+)*\/?$ | |
===================================== | |
example of matched/valid URL : | |
===================================== | |
http://yourdomain.com |
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
# this commands will Find 10 Larget Files under 'your_target_directory' | |
find 'your_target_directory' -printf '%s %p\n'| sort -nr | head -10 | |
# example : | |
find /var/logs/ -printf '%s %p\n'| sort -nr | head -10 |
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
# sometime we need to know when exactly a command executed | |
# on a linux-based computer | |
# so we need to adjust bashrc file : | |
# | |
echo 'export HISTTIMEFORMAT="%d/%m/%y %T "' >> ~/.bashrc | |
source ~/.bashrc | |
# output example of `history` command BEFORE bashrc adjusment | |
888 sudo monit -t |