Tuesday, September 13, 2016

[mysql] How to install mysql in centos

mysql CENTOS 7 installation

安裝 MySQL Repository:

# rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

安裝 MySQL Server, MySQL client 已經包括在 server 套件內:

# yum install mysql-community-server

開機自動啟動 MySQL

# /usr/bin/systemctl enable mysqld

啟動 MySQL

# /usr/bin/systemctl start mysqld

MySQL 預設為空密碼, 執行以下指令修改:

# /usr/bin/mysql_secure_installation




to enter client

$ mysql -uroot

Monday, April 13, 2015

tcp tunnel, old way but easy to use

iOS NSURLRequest does not have cookie info in the allhttpheaderfields api.
I am confused and I think I don't have cookie...but actually there is.
So to get the real sent request header, ether check nshttpcookie by yourself,
or simply use the tcp tunnel to dump the request.


java -classpath soap-2.3.jar org.apache.soap.util.net.TcpTunnelGui 8080 yourserver 8080

although soap is out, I still like this tiny tool. XD


Monday, February 2, 2015

[mongo] delete all data in database

mongo //will start the mongodb shell

show dbs //will list existing databases

use  // is the database you'd like to drop

db //should show  just to be sure I'm working with the right database

db.dropDatabase() //will delete the database and return { "dropped" : "", "ok" : 1 }

Friday, December 5, 2014

build ejabberd mac osx 10.9.5

try to build ejabberd from source on mac osx 10.9.5.
after installing homebrew, autoconf, automaker, libtool, erlang, I still have an error when making.

configure: error: libyaml library was not found

brew install libyaml does not help. and manually download libyaml and make install does not help either. although it's indeed in /usr/local/include

After installing  xcode 6.1 and command line tools for osx 10.9 for xcode 6.1,
the issue is gone. ^_^

Thursday, December 4, 2014

osx install brew autoconf automake

install brew and others in osx

install homebrew first

  ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  brew install autoconf

  brew install automake


Tuesday, July 8, 2014

[ios] how to tell ios binary is 32 or 64 bit


use lipo command
xcrun -sdk iphoneos lipo -info $(FILENAME)

Monday, August 12, 2013

[ios] uiimage low memory warning for large images


when i load a very large image like > 5M jpg, I got low memory warning, and finally crash.

how to downsize a very large image
https://developer.apple.com/library/ios/samplecode/LargeImageDownsizing/Introduction/Intro.html#//apple_ref/doc/uid/DTS40011173