Skip to content

Instantly share code, notes, and snippets.

@thiagotalma
thiagotalma / main-local.php
Last active May 15, 2018 17:20
PhpStorm Protocol (Win)
<?php
'modules' => [
'debug' => [
'class' => 'yii\debug\Module',
'traceLink' => function ($trace) {
$path = str_replace('/srv/www/myproject/', 'D:\\www\\myproject\\', $trace['file']);
return '<a href="phpstorm://open?url=file://' . $path . '&line=' . $trace['line'] . '">' . $path . ':' . $trace['line'] . '</a>';
},
]
]
find . -type d -name ".svn"|xargs rm -rf 删除当前目录及子目录下的svn文件
svn st | awk '{if ($1 == "?") {print $2} }' | xargs svn add svn添加所有新增文件
find . -type d -exec chmod 700 {} \; 修改所有目录访问权限
find . -type f -exec chmod 600 {} \; 修改所有文件访问权限
find . -name "*.php" -exec php {} \; 执行所有的php文件
grep -rli "helper('itags')" * | xargs -i@ sed -i "s/helper('itags')/helper('core')/g" @ 将所有文件中包含的某字符串替换成另一字符串
grep -rli --include=*.php.dec '?><?php' . | xargs -i@ sed -i "s/?><?php/<?php/g" @
pcregrep -MHrin --color "addOrder.*\n.*1442470135100001" . 多行搜索(跨行)
set quote="'" ; phpgrep -i '\(select\|update\|delete\|insert\).*;\("\|${quote}\)' . 搜索以分号;结尾的SQL语句
@hayderimran7
hayderimran7 / gist:9246dd195f785cf4783d
Created February 13, 2015 22:38
How to solve "sudo: no tty present and no askpass program specified" when trying to run a shell from Jenkins
Running shell scripts that have contain sudo commands in them from jenkins might not run as expected. To fix this, follow along
Simple steps:
1. On ubuntu based systems, run " $ sudo visudo "
2. this will open /etc/sudoers file.
3. If your jenkins user is already in that file, then modify to look like this:
jenkins ALL=(ALL) NOPASSWD: ALL
4. save the file by doing Ctrl+O (dont save in tmp file. save in /etc/sudoers, confirm overwrite)
5. Exit by doing Ctrl+X
6. Relaunch your jenkins job
@parhamr
parhamr / 0: Magento 1.12 Enterprise multi-store cluster configuration.md
Last active October 13, 2023 14:20
A highly available, fault tolerant, distributed, and load balanced LEMP cluster.