upx for macos 之源码编译
UPX (the Ultimate Packer for eXecutables)是一款先进的可执行程序文件压缩器,压缩过的可执行文件体积缩小50%-70% ,这样减少了磁盘占用空间、网络上传下载的时间和其它分布以及存储费用。
...
UPX (the Ultimate Packer for eXecutables)是一款先进的可执行程序文件压缩器,压缩过的可执行文件体积缩小50%-70% ,这样减少了磁盘占用空间、网络上传下载的时间和其它分布以及存储费用。
...
清除mp3文件中自带的专辑(album),艺术家(artist),流派(genre)等元数据。
ffmpeg -i "test.mp3" -b:a 320k -map_metadata -1 -y "out.mp3"
-map_metadata -1 表示清除所有元数据
因为需要mediainfo支持http协议,在老的版本中是不支持的,所以只能自己动手编译了。
系统:ubuntu 14.04 (其他版本可能会有少许改动)
...收集一些ssh登陆常见的问题,方便快速解决问题。
cat /var/log/secure
cat /var/log/message
无论你遇到任何奇葩的sshd问题,你先执行上面的命令查看下日志。
Authentication refused:bad ownership or modes for dircetory /root
chmod 700 /root
id_ras 权限为600
...使用openssl生产自签名证书,用于https测试。
#1.生成根证书密钥
$ openssl genrsa -out ca.key 4096 #建议长度为4096,1024长度已经被列为不安全。
#2.生成自签名根证书
$ openssl req -new -x509 -days 3650 -key ca.key -out ca.crt #这里在输入CommonName的时候输入名称而不是域名或者ip,就是证书上显示的颁发者,虽然是自签名证书,但是尽量让证书看起来标准一些
$ openssl genrsa -out server.key 4096
高版本的Chrome浏览器会要求设置 subjectAltName
,如果没有设置SAN会报证书错误
centos自带的repo是不会自动更新每个软件的新版本,所以无法通过yum方式安装MySQL的高版本,所以一般通过社区rpm包安装。
rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
yum repolist enabled | grep "mysql.*-community.*"
yum -y install mysql-community-server
systemctl enable mysqld
systemctl start mysqld
mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Enter current password for root (enter for none):
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.
Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] Y
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] n
... skipping.
By default, MySQL comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] n
... skipping.
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] Y
... Success!
All done! If you've completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!
Cleaning up...
Supervisor是用Python开发的一套通用的进程管理程序,能将一个普通的命令行进程变为后台daemon,并监控进程状态,异常退出时能自动重启。
...
不小心误删libc.so.6
安装完成后, 建立软链指向glibc-2.14, 执行如下命令:
$ rm -rf /lib64/libc.so.6
// 先删除先前的libc.so.6软链
$ ln -s /opt/glibc-2.14/lib/libc-2.14.so /lib64/libc.so.6
注意:删除libc.so.6之后可能导致系统命令不可用的情况, 可使用如下方法解决:
...yum无法使用带https的源
yum install epel-release
运行以上命令之后,安装其他软件就报错。
[Errno 14] problem making ssl connection Trying other mirror.
Trying other mirror
Error: Cannot retrieve repository metadata (repomd.xml) for repository: xxxx. Please verify its path and try again
经过google查询,发现似乎是ssl证书的原因。
...php 安装最新rabbitmq扩展
yum install cmake gcc gcc-c++ make openssl-devel
wget https://github.com/alanxz/rabbitmq-c/archive/v0.9.0.zip
unzip v0.9.0.zip
cd rabbitmq-c-0.9.0/
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/rabbitmq-c-0.9.0/
make && make install
wget http://pecl.php.net/get/amqp-1.9.4.tgz
tar zxf amqp-1.9.4.tgz
cd amqp-1.9.4
/usr/bin/phpize
./configure --with-php-config=/usr/bin/php-config --with-amqp --with-librabbitmq-dir=/usr/local/rabbitmq-c-0.9.0
#由于rabbitmq-c编译出来的lib目录是lib64,所以我们要做一些小的修改
vim Makefile
#将 AMQP_SHARED_LIBADD = -Wl,-rpath,/usr/local/rabbitmq-c-0.9.0/lib -L/usr/local/rabbitmq-c-0.9.0/lib -lrabbitmq
#修改为 AMQP_SHARED_LIBADD = -Wl,-rpath,/usr/local/rabbitmq-c-0.9.0/lib64 -L/usr/local/rabbitmq-c-0.9.0/lib64 -lrabbitmq
make && make install
vi /usr/local/php/etc/php.ini
#增加
extension = /usr/lib64/php/modules/amqp.so
systemctl restart php-fpm