Day: May 24, 2018

Mysql: 禁用ONLY_FULL_GROUP_BY, 如何关闭ONLY_FULL_GROUP_BY, Error related to only_full_group_by when executing a query in MySql

  错误描述: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'support_desk.mod_users_groups.group_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by   解决方法,即使取消(disable) only_full_group_by 方法1: 在mysql命令行: mysql> set g… Read More

Shell: linux 批量替换文件内容及查找某目录下所有包含某字符串的文件(批量修改文件内容)

1. sed grep -rl matchstring somedir/ | xargs sed -i 's/string1/string2/g' 例如: 对象:文件夹 grep -rl 'windows' ./path | xargs sed -i 's/windows/linux/g' 2. find 对象:文件 find -name 'test' | xargs perl -pi -e 's|windows|linux|g' 这里使用了perl语言,使用-e加上一段代码,从而批量地将当前目录及所有子目录下的file.log文件中的string1替换成了string2; string支持正则表达式 3. awk grep -i "windows" -r ./path | aw… Read More

PHP: USPS API, USPS 运费计算, USPS接口, USPS Shipping Calculator

项目地址:https://github.com/scottbedard/shipping   USPS Shipping Calculator   安装 Instructions 注册web tools ID:The first step to requesting a shipping quote is injecting your USPS Web Tools ID. use Bedard\Shipping\Usps; $shipment = new Usps('YOUR-WEB-ID'); If you would like to run the calculator on the USPS testing server, call useTesting… Read More

Ubuntu:系统状态栏和菜单消失, 卸载了IBUS系统出错, 重新安装ubuntu unity

  因为折腾输入法,卸载了IBUS,卸载时没仔细看,卸载了所有的IBUS和关联包。结果导致Ubuntu登录后桌面一片空白,什么都没有。左侧启动器没有,上方任务栏也没有,就是桌面登录后假死状态。在网上查询了很多资料,都无法修复,最终只能重新安装Ubuntu unity了。下面是安装过程。 1,Ctrl+alt+T启动终端或者Ctrl+alt+F1登录字符界面,执行以下命令重新安装Ubuntu unity:    sudo apt-get install ubuntu-desktop    sudo apt-get install unity    sudo apt-get instal… Read More