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 config --global http.sslVerify false | |
``` | |
#~/.gitconfig | |
[alias] | |
co = checkout | |
br = branch | |
ci = commit | |
st = status | |
hist = log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short | |
type = cat-file -t |
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
http://www.hackersgarage.com/install-mod_proxy-apache-module-on-whmcpanel-ceentos-linux-server.html | |
Installation : | |
Check Apache current version : | |
/usr/local/apache/bin/httpd -v | |
Output : | |
Server version: Apache/2.2.19 (Unix) |
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
Try this first: | |
git checkout master | |
(If you're on a different branch than master, use the branch name there instead.) | |
If that doesn't work, try... | |
For a single file: | |
git checkout HEAD /path/to/file |
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 ./ -type f -exec sed -i 's/find/replace/g' {} \; |
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
Run all tests | |
```python | |
#file __init__.py | |
def load_tests(loader, standard_tests, pattern): | |
# top level directory cached on loader instance | |
this_dir = os.path.dirname(__file__) + '/tests' | |
package_tests = loader.discover(start_dir=this_dir, pattern=pattern) | |
standard_tests.addTests(package_tests) | |
return standard_tests | |
``` |
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
What you're seeing is probably because the server serving the static files is using the "sendfile()" syscall, which is broken with the VirtualBox file system. You need to disable sendfile() usage in your server. For Apache: | |
EnableSendfile off | |
And for nginx: | |
sendfile 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
perl -i -p -e 's/search/replace/' filename; |
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 <folder> -type d -exec chmod 755 {} \; | |
find <folder> -type f -exec chmod 644 {} \; |
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 old files and calculate their size in Mb | |
find ./logs/* -type f -mtime +180 -exec du -ks {} \; | cut -f1 | awk '{total=total+$1}END{print total/1024}' |
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
$fileSystem = new Filesystem(); | |
$fileSystem->mkdir($target); | |
$directoryIterator = new \RecursiveDirectoryIterator($source, \RecursiveDirectoryIterator::SKIP_DOTS); | |
$iterator = new \RecursiveIteratorIterator($directoryIterator, \RecursiveIteratorIterator::SELF_FIRST); | |
foreach ($iterator as $item) { | |
if ($item->isDir()) { | |
$targetDir = $target.DIRECTORY_SEPARATOR.$iterator->getSubPathName(); | |
$fileSystem->mkdir($targetDir); | |
} else { |
OlderNewer