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
# source: https://help.github.com/articles/removing-sensitive-data-from-a-repository/ | |
# these arguments will: | |
# | |
# force Git to process, but not check out, the entire history of every branch and tag | |
# remove the specified file, as well as any empty commits generated as a result | |
# overwrite your existing tags | |
# | |
# can only do one file at a time |
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
$ 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
# 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
<?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
# 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 |
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 the file database | |
$ sudo /usr/libexec/locate.updatedb | |
# If you would like to have the command updatedb to get a more consistent behavior between your Linux and Mac environment you can symlink it to /usr/local/bin. | |
$ ln -s /usr/libexec/locate.updatedb /usr/local/bin/updatedb |