CD walkman D-EJ785

淘了个D-EJ785,来听一些买来的唱片CD。

关机

没有关机键,按下停止键(实心方块)后,就相当于关机了,可以进行CD或者电池操作。

G-PROTECTION

G-PROTECTION:防止声音跳动,这个一般是机器震动后者光盘划伤造成。

AVLS

AVLS:AVLS即自动音量限制系统的简称。它的作用就是:控制音量,避免用户在使用耳机收听音乐时因音量过大而导致听力受损。设定为limit时,保护听力,限制最大音量。

MODE

1:单首播放
SHUF:随机播放
PGM:按照喜欢顺序播放

SOUND

BASS1/2:加强的低音模式,BASS2比BASS1低音强

echo命令行和网页方式下base64编码不一致问题

发现的问题

同样的测试内容:chabctimes
在centos7下面:

# echo "chabctimes"|base64
Y2hhYmN0aW1lcwo=

在线测试平台 https://tool.oschina.net/encrypt?type=3 测试如下:

Y2hhYmN0aW1lcw==

根据第三方的验证,下面的内容是通过验证可以正常用的,上面的不行。从对比看,下面跟上面的结果比较,末尾倒数第2个字符一个是=一个是o

分析

一阵g搜索,再结合只有尾部一个字符差异,而且所有内容都是倒数第二个差异,所以初步猜测可能是尾部回车换行的差异导致。
经过不同内容的验证,基本确认以上的猜测:在linux环境下echo命令行的模式,比在线的方式多一个尾部的回车换行。
再就回车换行问题进一步进行确认,因为是1个字符也会多回车换行,还不是经典的76字符回车换行问题,所以怀疑是echo的问题,经搜索,确认是echo的问题。

解决

在echo中增加参数-n 去掉结尾回车换行,验证OK:

echo -n "chabctimes"|base64

centos下privoxy安装及使用

下载

###下载安装文件
wget http://www.privoxy.org/sf-download-mirror/Sources/3.0.26%20%28stable%29/privoxy-3.0.26-stable-src.tar.gz
tar -zxvf privoxy-3.0.26-stable-src.tar.gz
cd privoxy-3.0.26-stable

privoxy-3.0.26-stable 是目前最新的稳定版,建议在下载前去 Privoxy 官网下载页 检查一下版本。

新建用户

Privoxy 强烈不建议使用 root 用户运行,所以我们使用 useradd privoxy 新建一个用户.

安装

autoheader && autoconf
./configure
make && make install

配置

```vi /usr/local/etc/privoxy/config```

找到以下两句,确保没有注释掉

listen-address 127.0.0.1:8118   # 8118 是默认端口,不用改,下面会用到
forward-socks5t / 127.0.0.1:0 . # 这里的端口写 shadowsocks 的本地端口(注意最后那个 . 不要漏了)

启动

privoxy --user privoxy /usr/local/etc/privoxy/config

开启系统代理

配置 /etc/profile

vi /etc/profile

添加下面两句:

export http_proxy=http://127.0.0.1:8118       #这里的端口和上面 privoxy 中的保持一致
export https_proxy=http://127.0.0.1:8118

运行以下:

source /etc/profile

测试生效

curl www.google.com

返回一大堆 HTML 则说明 shadowsocks 正常工作了。

wordpress更新时弹出ftp登录

原因

因为更新本身就是对本地文件的更新覆盖,而wordpress的更新程序无法完成本地文件更新所以就会出现ftp的方式提示,所以就是文件的更新权限问题。

权限检查

因为是wordpress的php部分的逻辑负责更新,所以就是查看这部分php的运行用户权限。如果我们的php是运行在fpm模式,这个我们可以用:

ps aux |grep  php-fpm

这条指令来查看,输出第一列就是当前归属的用户组信息。然后我们对当前的wordpress根目录或者主题插件的目录进行用户权限修改:

 chown -R xxx:xxx /DDD

xxx为用户和组,DDD为需要更新权限的目录,-R表示递归所有子目录。

mysql 中文乱码

默认:
mysql> show variables like "character_set%";
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | latin1                     |
| character_set_connection | latin1                     |
| character_set_database   | latin1                     |
| character_set_filesystem | binary                     |
| character_set_results    | latin1                     |
| character_set_server     | latin1                     |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)
*************************************************************
*************************************************************
1.修改/etc/my.cnf文件,改成这样:
[mysqld]
default-character-set=utf8
init_connect='SET NAMES utf8'
[client]
default-character-set=utf8
2./etc/init.d/mysqld restart 重新启动mysql;
mysql重启后字符集更改仍然生效。
mysql> show variables like "character_set%";
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | utf8                       |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | utf8                       |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)
*************************************************************
*************************************************************
注意执行命令:
SET NAMES 'utf8';
它相当于下面的三句指令:
SET character_set_client = utf8;
SET character_set_results = utf8;
SET character_set_connection = utf8;

cosmic 编译器未调用函数优化

Q. Can the compiler automatically remove unused functions from my application?

A. Yes, the default behavior includes all code linked however, you can add the +split compiler command line option to split the object into multiple sections. i.e. One section per function such that individual functions may be removed by the linker if they are not called. You then mark one or more segments in the link command file with the -k (keep) option to specifiy which segments need to be kept. Typically, you just need to add the -k segment option to the segment containing the vecotr table. This usually coversl all of the applications call trees.

stvd-cosmic

myeclipse 2013 deploy path 修改

文件路径:./.settings/org.eclipse.wst.common.component:

<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="web">
<wb-resource deploy-path="/" source-path="/WebRoot" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/>
<property name="context-root" value="web"/>
<property name="java-output-path" value="/web/WebRoot/WEB-INF/classes"/>
</wb-module>
</project-modules>