1.正确安装MySQL 2.配置环境变量 export PATH="$PATH":/usr/local/mysql/bin 3.重启终端再进行安装 pip install mysql-python…
比如说我要替换version.txt文件中的version=1.1 为version=1.2,比如test.txt文件内容如下: version=1.1 此时我们会使用sed来替换,如果是涉及比较多的处理,我们会采用脚本实现,比如sed_shell.sh脚本内容如下: #!/bin/bash if [ "x$1" == "x" ]; then    echo please input new version && exitelse    old_ve…
转自:http://painterlin.com/2014/08/10/Using-LaTeX-with-Sublime-and-Skim-for-Mac.html Sublime Text是一款非常优秀的编辑器,速度快,界面简洁,插件众多.并且能跨平台使用,在Mac和Windows上都能完美使用.虽然是一款付费软件,但作者很厚道地给了无限期的试用期限.这一切正如其官网广告词说的那样:The text editor you'll fall in love with. Skim是一款免费轻量的PD…
Mac上配置GTK环境 安装command line工具, 如果安装了Xcode, 就直接跳过该步骤 安装Homebrew 使用brew install pkg-config 使用brew install gtk+3 使用clang编译时, 使用clang 'pkg-config --libs --cflags gtk+-3.0' main.c…
问题一 sed编辑命令:[sed -i 's/a/b/g' test.txt]   报错:sed: 1: "test.txt": undefined label 'est.txt'   解决方案:增加一个备份的追加名[sed -i '.bak' 's/a/b/g' test.txt]   原因:mac强制要求备份,否则报错 当然可以不使用其他备份名字,只是用’',就可以只保留一份 sed -i ‘’ ’s/a/b/g’ test.txt   问题二 sed追加命令:[sed -i ''…
mac上sed和liunx是不一样的,所以有些指令可能不通用,需要将mac上sed替换成gun的: Install Homebrew First, visit Homebrew homepage and follow the installation instructions to install Homebrew. Shortcut: install the latest XCode and then run the following command to install: 1. /usr/…
使用sed批量改文件名 Sed批量去拓展名 |- dev.gb.conll06.raw |- test.gb.conll06.raw |- train.gb.conll06.raw 想要去掉其中的后缀.raw,用个小脚本就可以搞定: for file in `ls`; do mv $file `echo $file | sed 's/\.raw$//'`; done Sed批量添加拓展名 |- dev.gb.conll06 |- test.gb.conll06 |- train.gb.conll…
使用mac进行开发的时候,有时候需要使用adb指令来进行一些操作,但是如果没有配置过Android环境变量,可能会出现adb: command not found的问题,查了一些资料,这里记录一下mac上配置Android环境变量的方法: 打开mac的terminal终端,输入 cd ~/ [进入当前用户的home目录] 输入 touch .bash_profile [如果没有.bash_profile这个文件,则创建一个这个文件] 输入 open .bash_profile [打开我们创建的这…
mac 上运行cassandra出现的java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException: : : unknown error错误解决方法     运行: ./bin/cassandra 得到输出结果: objc[1881]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMach…
不可忽略的备份格式 sed -i 's/hello/world/g' hello.text 上面这行代码,可以在 linux 上运行,作用是将找到的 hello 替换为 world,并且直接保存修改到文件.但是如果在 Mac 上,你会发现这行代码会报错.原因是在 Mac 上,sed 命令直接操作文件的时候,必须指定备份的格式,而在 linux 上,却并没有这个要求. sed -i '' 's/hello/world/g' hello.php 如上面的代码所示,在 -i 之后加上一对引号,来指定备…