Bigtomato's Blog


  • Home

  • Archives

fix kernel module in scsi sr_mod at multiple drivers performence

Posted on 2019-07-26 |

I have a program handling multiple cdrom to burn files together running on CentOS 6.9 (kernel 2.6.32). when I decide to upgrade os platform to CentOS 7(kernel >= 3.10) recently, I have found that the performance of this program is decrease.
Eventually I found out that there is a global lock in the sr kernel module. I apply a patch to source code file and replace that module, everything is back to normal.

Read more »

一个小程序

Posted on 2019-07-02 |

07年做的小程序出了一点问题,主要是播放接口变了。(像这种API接口突变,而且拒不兼容之前调用方式的行为真是很恶心。)
把之前尘封的项目从git上拉下来,项目使用的脚手架都比较老了,很多依赖都[deprecated]了。
正好最近很忙,那就重构一下吧。

Read more »

udev can not change Kernel NAME by rules in lastest release Linux

Posted on 2019-03-12 |

In earlier Linux releases, udev can modify kernel name by rules like ……,NAME:="prefix_%k"

But this is not recommended in early version:

NAME

What a network interface should be named.
Also, as a temporary workaround, this is what a device node should be named; usually the kernel provides the defined node name or creates and removes the node before udev even receives any event.
Changing the node name from the kernel’s default creates inconsistencies and is not supported. If the kernel and NAME specify different names, an error is logged. udev is only expected to handle device node permissions and to create additional symlinks, not to change kernel-provided device node names. Instead of renaming a device node, SYMLINK should be used. However, symlink names must never conflict with device node names, as that would result in unpredictable behavior.

In latest version of man udev, NAME can not be modify by rules:

NAME

The name to use for a network interface. The name of a device node can not be changed by udev, only additional symlinks can be created.

Linux_use_shadwosocks_and_privoxy_to_proxy

Posted on 2019-02-14 |

sslocal

1
2
yum install python-pip
pip install shadowsocks
1
vim /etc/shadowsocks.json
1
2
3
4
5
6
7
8
9
10
11
{
"server": "your ip",
"server_port": 443,
"local_address": "127.0.0.1",
"local_port":1080,
"password":"you pass",
"timeout":300,
"method":"aes-256-cfb",
"fast_open": false,
"workers": 10
}
1
sslocal -c /etc/shadowsocks.json -d start

or you can remove -d parameter to run it forntend to see if socks5 can work properly.

Privoxy

1
2
yum install privoxy
vim /etc/privoxy/config

search and uncomment forward-socks5t / 127.0.0.1:9050 . change it into forward-socks5t / 127.0.0.1:1080 .

DO NOT forget . after socks5 address

http & https privoxy

you can use this command to privoxy once in terminal:

1
2
export http_proxy=http://127.0.0.1:8118
export https_proxy=http://127.0.0.1:8118

Or you can add it into your /etc/profile, but I don’t think it’s a good idea.

laravel_and_user_ini_file

Posted on 2019-02-14 |
  1. 如果一直报错,没有任何提示信息,考虑将php的报错log打开

    1
    2
    vim php.ini
    display_errors On
  2. 使用lnmp创建vhost时,会生成一个.user.ini这个文件主要是用来告诉php-fpm的php跨目录访问,因为设定的laravel root path是类似于/home/wwwroot/blog/public这样的,所以这个文件会在public路径下,同时php的访问范围也会限定在public路径下:
    open_basedir=/home/wwwroot/blog/public:/tmp/:/proc/
    但是Laravel这类框架一般会在public访问上级目录中的文件例如../vendor/autoload.php,此时需要修改user.ini中的改为open_basedir=/home/wwwroot/blog:/tmp/:/proc/.

    1
    2
    3
    chatrr -i .user.ini
    vim .user.ini
    chatrr +i .user.ini
此时还会有一个问题是修改.user.ini之后即使重启php-fpm之后,文件也没有生效,页面上依然提示blog路径不在blog/public之下,可能的原因是`fastcgi.conf`这个全局配置文件中的配置覆盖了,此时需要将这行注释掉:
1
2
vim /usr/local/nginx/conf/fastcgi.conf
# fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";
  1. 关于权限设定
    此时访问应该就正常了,关于路径设置:
    1
    2
    3
    chown yourgroup:yourgroup laravel_path(.user.ini可能会影响命令执行,可以先 chattr -i)
    chown www:www -R ./storage
    chown www:www -R ./bootstrap/cache

Bigtomato

A Full Stack Developer.

5 posts
3 tags
© 2019 Bigtomato
Powered by Hexo
|
Theme — NexT.Gemini v5.1.4