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
# make all files 666, all directories 777 | |
# (remove execute, re-set directory-only execute) | |
# [may not work] | |
chmod -R -v a-x+rwX . | |
# all files 666, all directories 755 | |
find $item -type f -print0 | xargs --no-run-if-empty -0 chmod 644 | |
find $item -type d -print0 | xargs --no-run-if-empty -0 chmod 755 | |
# chmod and chown |
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
.s?? | |
.*.s?? |
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
### Perform a search and replace from the commandline | |
$ vim -c '%s`search`replace`g' -c 'wq' *.html | |
### Alternatively, load all your files into vim and use bufdo. Allows you to tweak your search pattern before running the replacement: | |
$ vim *.html | |
/search | |
:bufdo %s``replace`g |
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
LD_LIBRARY_PATH=/opt/python2.7/lib /opt/python2.7/bin/python | |
alias p27="LD_LIBRARY_PATH=/opt/python2.7/lib /opt/python2.7/bin/python" |
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
#!/usr/bin/perl | |
# by entheon, do whatever the hell you want with this file | |
print "\n"; | |
print "**************************\n"; | |
print "*XTERM 256Color Test Chart\n"; | |
print "**************************\n"; | |
print "* 16 = black\n"; | |
print "* 255 = white\n"; |
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
vim $(git diff --name-only | sed -n '2 p') | |
git checkout -f $(git diff --name-only | sed -n '2 p') |
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
vim $(find interface library | xargs grep -RIsl 'Date Display Format' | sort | uniq) |
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
<?php | |
$label = 'test'; | |
$data = array ( | |
'label' => $datum | |
); | |
$logs[] = array($label, $data); | |
foreach ($logs as $log): | |
list($label, $data) = $log; | |
foreach ($data as $key => $value): | |
if (is_array($value)): |
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
SELECT TABLE_ROWS | |
FROM information_schema.tables | |
WHERE table_name='table' | |
AND table_schema = DATABASE(); |
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
mysqldump --no-create-info --extended-insert=FALSE etc. |
OlderNewer