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 | |
namespace CMTelecom\Messaging; | |
/** | |
* Code Examples | |
*/ | |
// initiate | |
$sendMessage = new CMSendMessage('<INSERT PRODUCT TOKEN HERE>', 'SenderID'); |
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
# Recover deleted files from 'git rm' | |
$ git fsck --lost-found --unreachable | |
# PS. Recovered files are in '.git/lost-found/other' |
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
-- Let’s start by making a new user within the MySQL shell: | |
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password'; | |
-- Sadly, at this point newuser has no permissions to do anything with the databases. In fact, if newuser even tries to login (with the password, password), they will not be able to reach the MySQL shell. | |
-- Therefore, the first thing to do is to provide the user with access to the information they will need. | |
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost'; | |
--The asterisks in this command refer to the database and table (respectively) that they can access—this specific command allows to the user to read, edit, execute and perform all tasks across all the databases and tables. | |
-- Once you have finalized the permissions that you want to set up for your new users, always be sure to reload all the privileges. | |
FLUSH PRIVILEGES; |
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 fetch origin | |
$ git reset --hard origin/master # be aware; this will destroy local work that does not ywt exist in the repository |
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
# 1. stage the file you forgot to add to the previous commit | |
# 2. run the below mentiond command | |
$ git commit --amend –C HEAD |
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 every file in the current directory recursively based on a wildcard. | |
$ find . -name '._*' -type f -delete |
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 -rnw '/path/to/somewhere/' -e "pattern" | |
# (path/ must absolute!) | |
# -r or -R is recursive, | |
# -n is line number, and | |
# -w stands for match the whole word. | |
# -l (lower-case L) can be added to just give the file name of matching files. | |
# along with these, --exclude, --include, --exclude-dir or --include-dir flags could be used for efficient searching: |
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 <path> -type f -exec md5sum {} + > sums.md5 |
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
# MAC | |
$ du -sh /directory/to/search/*/ | sort -n -r | |
# UNIX | |
$ du -hc --max-depth=1 . | sort -n -r | |
# du: | |
# -s, --summarize Display only a total for each argument. | |
# -h, --human-readable Append a size letter such as `M' for megabytes to each size. | |
# Powers of 1024 are used, not 1000; `M' stands for 1,048,576 bytes |
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
# SeLinux doesn't like if files are moved from one place to another. | |
# if were to copy the file than SeLinux will have no problem with it whatsoever. | |
# If you do run into issues; | |
// will give you overview of all SeLinux permissions | |
// files need to match `httpd_sys_content_t` | |
$ ls -lZ | |
// I'm not that familiar with SeLinux BUT here is way to fix the permission for a file | |
$ mv <filename> /tmp |
OlderNewer