解决:Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart

星期二, 2015-04-07 | Author: Lee | JAVA-and-J2EE | 没有评论 12,436 views

装了apache-maven-3.2.3-bin 并做好配置,在eclipse中新建maven工程时报错:

Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart:RELEASE from any of the configured repositories.
Could not resolve artifact
Missing org.apache.maven.archetypes:maven-archetype-quickstart:pom:RELEASE

解决办法:在本地库中装载maven-archetype-quickstart

1.从http://mirrors.ibiblio.org/pub/mirrors/maven2/org/apache/maven/archetypes/maven-archetype-quickstart/
或者国内的镜像
http://maven.oschina.net/content/groups/public/org/apache/maven/archetypes/maven-archetype-quickstart/
下载最新版maven-archetype-quickstart-1.1.jar

2.cmd窗口执行mvn install:install-file -DgroupId=org.apache.maven.archetypes -DartifactId=maven-archetype-quickstart -Dversion=1.1 -Dpackaging=jar -Dfile=maven-archetype-quickstart-1.1.jar

即可

Tags: ,

Mac下启动和停止Mysql及查看端口

星期三, 2015-03-18 | Author: Lee | JAVA-and-J2EE, mac | 没有评论 11,856 views

启动Mysql服务

sudo /Library/StartupItems/MySQLCOM/MySQLCOM start

停止Mysql服务

sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop

重启Mysql服务

sudo /Library/StartupItems/MySQLCOM/MySQLCOM restart

查看是否启动成功可以输入:netstat -an -p tcp 看到3306端口启动成功
//—————————————————————
打开终端,输入:
vim ~/.bash_profile
输入 i
然后粘贴以下内容

# mysql
alias mysql=’/usr/local/mysql/bin/mysql’
alias mysqladmin=’/usr/local/mysql/bin/mysqladmin’
# ls
alias ls=’ls -G’

按ESC键
输入 :x
重新启动终端程序

在终端中 直接输入 mysql 就可以进入mysql

Tags: ,

http协议的手游通信安全构想

星期一, 2015-02-16 | Author: Lee | JAVA-and-J2EE, linux, 游戏开发 | 没有评论 3,717 views

手游中使用http协议,很容易被劫包,获取对应的api接口地址和参数信息,用于篡改数据等制作脱机外挂等.

提升安全必须要做的事情,记忆下一个初步的构想方案.

1. api+key+时间戳+随机key(按照一定算法得出),MD5后生成摘要
2. 如果抓包拿到封装后的地址,照样可以封包访问,所以需要在服务端做限制,对于同一个请求只有第一次访问是有效的
3. 为了前端的反编译安全性,封装成.so包进行调用(提升破解门槛)

对只提供手机api的手机后台服务应用也适用

Tags: ,

Navicat 导出mysql数据库的时候出现 “Cannot proceed because system tables used by Event Scheduler

星期六, 2015-02-14 | Author: Lee | linux, php | 没有评论 4,239 views

用navicat 遭遇 “Cannot proceed because system tables used by Event Scheduler were found damaged at server start” .

使用的APMServ MySQL的集成环境(工具是好用但是找对应的文件是有点麻烦,我还是比较喜欢独立安装各个的支持,追求效率的话可以忽略)

在网上找了下要用什么upgrade什么exe升级下即可,没有找到对应的执行文件,在网上找到一个对应的执行sql即可的方法,如下:

进入mysql的系统库,执行sql:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
DROP TABLE IF EXISTS `event`;
CREATE TABLE `event` (
  `db` CHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
  `name` CHAR(64) NOT NULL DEFAULT '',
  `body` longblob NOT NULL,
  `definer` CHAR(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
  `execute_at` datetime DEFAULT NULL,
  `interval_value` INT(11) DEFAULT NULL,
  `interval_field` enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') DEFAULT NULL,
  `created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `modified` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
  `last_executed` datetime DEFAULT NULL,
  `starts` datetime DEFAULT NULL,
  `ends` datetime DEFAULT NULL,
  `status` enum('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL DEFAULT 'ENABLED',
  `on_completion` enum('DROP','PRESERVE') NOT NULL DEFAULT 'DROP',
  `sql_mode` SET('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '',
  `comment` CHAR(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
  `originator` INT(10) UNSIGNED NOT NULL,
  `time_zone` CHAR(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM',
  `character_set_client` CHAR(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `collation_connection` CHAR(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `db_collation` CHAR(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `body_utf8` longblob,
  PRIMARY KEY (`db`,`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Events';

Tags: ,

WP-Syntax代码高亮插件的美化和难选中修复

星期三, 2015-01-14 | Author: Lee | html5, pagemaker, wordpress | 没有评论 2,919 views

上次发了一个服务器安装的配置脚本信息,由于脚本比较多,发现浏览的时候用鼠标很难选择一直不知道是什么原因;

期间尝试了去除ad广告部分和统计的js代码,可是问题依旧,无意间更换了wp-syntax的css文件竟然解决了此问题;

也不太想深究其中原因,只把美化后的css代码贴出:
这一段代码替换wp-syntax/css/wp-syntax.css里的内容即可
› 继续阅读

Tags: ,

Nginx 1.6.2 + PHP 5.5.20 + MySQL 5.6.10 在 CentOS64 下的编译安装

星期二, 2015-01-06 | Author: Lee | linux | 没有评论 4,197 views

实际安装可以最新Nginx1.10.11 和php5.5.38 mysq5.7
更新时间到 2017-03-01

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
1.系统预先配置
yum install wget
yum install pcre
yum install openssl*
yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers make
yum -y install gd gd2 gd-devel gd2-devel
/usr/sbin/groupadd www
/usr/sbin/useradd -g www www
ulimit -SHn 65535
mkdir -p /ia/data/
cd /ia/data/
wget http://ftp.exim.llorien.org/pcre/pcre-8.32.tar.gz
tar -zxvf pcre-8.32.tar.gz 
mkdir tgz
mv pcre-8.32* tgz/
mkdir installsoft
cd installsoft/
wget http://nginx.org/download/nginx-1.6.2.tar.gz
tar xzvf nginx-1.6.2.tar.gz 
cd nginx-1.6.2
./configure --user=www --group=www --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/ia/data/tgz/pcre-8.32 --with-http_realip_module --with-http_image_filter_module
make
make install
/usr/local/webserver/nginx/sbin/nginx -V
 
 2、安装 MySQL:
wget http://downloads.mysql.com/archives/mysql-5.6/mysql-5.6.10-linux-glibc2.5-x86_64.tar.gz
tar zxvf mysql-5.6.10-linux-glibc2.5-x86_64.tar.gz
mv mysql-5.6.10-linux-glibc2.5-x86_64 /usr/local/webserver/mysql
/usr/sbin/groupadd mysql
/usr/sbin/useradd -g mysql mysql
mkdir -p /Data/data/mysql/data
yum install libaio
 
 
/usr/local/webserver/mysql/scripts/mysql_install_db --basedir=/usr/local/webserver/mysql --datadir=/ia/data/mysql/data --user=mysql
 
##mysql 5.7更新了初始化方式会有默认密码生成 使用 --initialize-insecure 会不生成root密码否则注意看密码
/usr/local/webserver/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/webserver/mysql --datadir=/ia/data/mysql/data 
 
sed -i "s#/usr/local/mysql#/usr/local/webserver/mysql#g" /usr/local/webserver/mysql/bin/mysqld_safe
GRANT ALL PRIVILEGES ON *.* TO 'ia_admin'@'localhost' IDENTIFIED BY '12345678';
GRANT ALL PRIVILEGES ON *.* TO 'ia_admin'@'127.0.0.1' IDENTIFIED BY '12345678';
GRANT ALL PRIVILEGES ON *.* TO 'ia_admin'@'%' IDENTIFIED BY '12345678';
##忘记密码重置的配置 my.cnf 添加
#skip-grant-tables
#skip-networking
 
#后续mysql5.7登录mysql执行
ALTER USER 'root'@'localhost' IDENTIFIED BY '12345678';
update user set authentication_string=PASSWORD("12345678") where User='root';
##修改成功后 可以启用GRANT去新增用户,会让强制改下root密码再执行
 
3、安装PHP依赖库
mkdir -p /usr/local/webserver/libs/
wget http://www.ijg.org/files/jpegsrc.v9.tar.gz     
tar zxvf jpegsrc.v9.tar.gz
cd jpeg-9/
./configure --prefix=/usr/local/webserver/libs --enable-shared --enable-static --prefix=/usr/local/webserver/libs
make
make install
cd ../
 
wget http://prdownloads.sourceforge.net/libpng/libpng-1.6.2.tar.gz
tar zxvf libpng-1.6.2.tar.gz
cd libpng-1.6.2/
./configure --prefix=/usr/local/webserver/libs
make
make install
cd ../
 
wget http://download.savannah.gnu.org/releases/freetype/freetype-2.4.12.tar.gz
tar zxvf freetype-2.4.12.tar.gz
cd freetype-2.4.12/
./configure --prefix=/usr/local/webserver/libs
make
make install
cd ../
 
 
wget "http://downloads.sourceforge.net/mhash/mhash-0.9.9.9.tar.gz"
wget "http://downloads.sourceforge.net/mcrypt/libmcrypt-2.5.8.tar.gz"
wget "http://downloads.sourceforge.net/mcrypt/mcrypt-2.6.8.tar.gz"
 
 
tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8/
./configure --prefix=/usr/local/webserver/libs
make
make install
cd libltdl/
./configure --prefix=/usr/local/webserver/libs --enable-ltdl-install
make
make install
cd ../../
 
 
tar zxvf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9/
./configure --prefix=/usr/local/webserver/libs
make
make install
cd ../
 
vi /etc/ld.so.conf
 
添加:
/usr/local/webserver/libs/lib
 
然后:
ldconfig
 
 
tar zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8/
export LDFLAGS="-L/usr/local/webserver/libs/lib -L/usr/lib"
export CFLAGS="-I/usr/local/webserver/libs/include -I/usr/include"
touch malloc.h
./configure --prefix=/usr/local/webserver/libs --with-libmcrypt-prefix=/usr/local/webserver/libs
make
make install
cd ../
 
4、编译安装PHP 5.5
wget http://cl1.php.net/get/php-5.5.20.tar.gz/from/this/mirror
tar zxvf php-5.5.20.tar.gz
cd php-5.5.20/
export LIBS="-lm -ltermcap -lresolv"
export DYLD_LIBRARY_PATH="/usr/local/webserver/mysql/lib/:/lib/:/usr/lib/:/usr/local/lib:/lib64/:/usr/lib64/:/usr/local/lib64"
export LD_LIBRARY_PATH="/usr/local/webserver/mysql/lib/:/lib/:/usr/lib/:/usr/local/lib:/lib64/:/usr/lib64/:/usr/local/lib64"
 
ln -s /usr/local/webserver/mysql/lib/libmysqlclient.so.20.3.4 /usr/local/webserver/mysql/lib/libmysqlclient_r.so
 
./configure --prefix=/usr/local/webserver/php --with-config-file-path=/usr/local/webserver/php/etc --with-mysql=/usr/local/webserver/mysql --with-mysqli=/usr/local/webserver/mysql/bin/mysql_config --with-iconv-dir --with-freetype-dir=/usr/local/webserver/libs --with-jpeg-dir=/usr/local/webserver/libs --with-png-dir=/usr/local/webserver/libs --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-fpm --enable-mbstring --with-mcrypt=/usr/local/webserver/libs --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-opcache --with-pdo-mysql --enable-maintainer-zts
 
make
make install
cp php.ini-development /usr/local/webserver/php/etc/php.ini
 
##生产环境推荐
cp php.ini-production /usr/local/webserver/php/etc/php.ini
cd ../
ln -s /usr/local/webserver/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
如果是5.7的mysql做软链接
ln -s /usr/local/webserver/mysql/lib/libmysqlclient.so.20 /usr/lib/libmysqlclient.so.20
 
mv /usr/local/webserver/php/etc/php-fpm.conf.default /usr/local/webserver/php/etc/php-fpm.conf
 
##一定记得修改 php-fpm.conf 的启动组为www(把对应的nobody修改下,否则php文件无法接收)
 
 5、编译安装PHP扩展
wget http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz
tar zxvf autoconf-latest.tar.gz
cd autoconf-2.69/
./configure --prefix=/usr/local/webserver/libs
make
make install
cd ../
 
wget http://pecl.php.net/get/memcache-2.2.7.tgz
tar zxvf memcache-2.2.7.tgz
cd memcache-2.2.7/
export PHP_AUTOCONF="/usr/local/webserver/libs/bin/autoconf"
export PHP_AUTOHEADER="/usr/local/webserver/libs/bin/autoheader"
/usr/local/webserver/php/bin/phpize
./configure --with-php-config=/usr/local/webserver/php/bin/php-config
make
make install
cd ../
 
 
  打开 /usr/local/webserver/php/etc/php.ini 查找 ; extension_dir = "ext"
  在其后增加一行:
extension = "memcache.so"

Tags: , , ,

写在新年的致词

星期六, 2015-01-03 | Author: Lee | 体味生活 | 2 Comments 2,675 views

又一年的钟声已经敲响,回望2014年的踪迹:页游和手游的初进

1.页游:<烽火连城> 关于大秦帝国的ARPG的网页游戏的上线,一路的辛苦研发运营

2.手游:接收原版基于u3d+c 的射击类休闲的改版和调整,待上线

3.手游:自主研发 卡牌类游戏 u3d+java 进行中

在游戏行业有6年的摸爬滚打,一切努力,尽工作之事.

番外:

1.GTD 任务+工单 记录待处理的事情的记录和跟进系统的 开发(为克服自己的拖延和事情的遗忘而作的系统开发)

2.想法太多,行动太少,(果然是年龄大了,有想法了,发现专注力太差,不太想动,为了以后不后悔要立即行动,新年新动作,努力自己)

flash流媒体视频合成(F4M格式)

星期一, 2014-12-15 | Author: Lee | computer, flash | 没有评论 7,619 views

朋友发过来一个视频希望录制和下载下载,找了下工具借助此工具成功下载和合成;

去缓存拿到对应的流媒体的url地址,可以下载下来也可以通过url的方式进行合成;

推荐下载指定码率的 流媒体文件再进行合成,缓存中直接拿到的可能码率不同,合成的文件无法播放等,谨记.

项目地址:https://github.com/K-S-V/Scripts

本地下载:AdobeHDS.php And Scripts-master

Usage:

php AdobeHDS.php --manifest "your_manifest_url" --delete

MyVideo-Seg1-Frag1.f4f, MyVideo-Seg1-Frag2.f4f………MyVideo-Seg1-Frag99.f4f

php AdobeHDS.php MyVideo-Seg1-Frag

You can use script with following switches:

 --help              displays this help
 --debug             show debug output
 --delete            delete fragments after processing
 --fproxy            force proxy for downloading of fragments
 --play              dump stream to stdout for piping to media player
 --rename            rename fragments sequentially before processing
 --update            update the script to current git version
 --auth      [param] authentication string for fragment requests
 --duration  [param] stop recording after specified number of seconds
 --filesize  [param] split output file in chunks of specified size (MB)
 --fragments [param] base filename for fragments
 --manifest  [param] manifest file for downloading of fragments
 --outdir    [param] destination folder for output file
 --outfile   [param] filename to use for output file
 --parallel  [param] number of fragments to download simultaneously
 --proxy     [param] proxy for downloading of manifest
 --quality   [param] selected quality level (low|medium|high) or exact bitrate
 --referrer  [param] Referer to use for emulation of browser requests
 --start     [param] start from specified fragment
 --useragent [param] User-Agent to use for emulation of browser requests

Tags: ,

js MD5或者SHA1加密遭遇Cannot read property ‘words’ of undefined

星期六, 2014-11-29 | Author: Lee | ajax, html5 | 没有评论 7,781 views

使用 CryptoJS.SHA1(“Message”) 或者 CryptoJS.MD5(“Message”) 加密密码

再使用jquery 的ajax的post提交遭遇Cannot read property ‘words’ of undefined 的情况

在官方查到解决办法:(解决方法也很简单 转成字符串即可)
摘录原文:
Ahh, it’s because the hash you get back is an object (see [https://code.google.com/p/crypto-js/#The_Hasher_Output The Hasher Output]). And when you pass an object to jQuery’s data property, then jQuery tries to convert it to a query string.

You’ll need to make sure the hash has been serialized to a string. For example:

{ key: CryptoJS.SHA1(“Message”) + ” }

– or –

{ key: CryptoJS.SHA1(“Message”).toString() }

Tags:

消息队列参数调整和查看

星期二, 2014-11-11 | Author: Lee | linux | 没有评论 5,003 views

查看消息队列信息部分:
ipcs -l

调整队列和共享内存参数部分: vi /etc/sysctl.conf

查看当前 消息队列标识符打开的数量: ipcs|awk '/msqid/{a=NR}END{print NR-a}'

相关操作知识:

ipcs可用来显示当前Linux系统中的共享内存段、信号量集、消息队列等的使用情况。
命令示例:
ipcs -a或ipc 显示当前系统中共享内存段、信号量集、消息队列的使用情况;
ipcs -m 显示共享内存段的使用情况;
ipcs -s 显示信号量集的使用情况;
ipcs -q 显示消息队列的使用情况;
ipcrm可用来删除对应的共享内存段、信号量、消息队列;
命令示例:
ipcrm -s semid 删除对应的信号量集
ipcrm -m shmid 删除对应的共享内存段
ipcrm -q msqid 删除对应的消息队列

ipcrm本身只能实现单个资源的删除,利用以下命令可实现批量删除:(root 替换为对应的系统用户用户名)

1.ipcs -s|grep root|cut -d" " -f2|xargs -n1 ipcrm -s
2.ipcs -s|awk '/root/{print $2}'|xargs -n1 ipcrm -s
3.ipcs -s|awk '/root/{system("ipcrm -s "$2)}'
4.for i in echo `ipcs|grep root|cut -d" " -f2`; do ipcrm -s $i; done

Tags:

Search

文章分类

Links

Meta