EXECL批量转CSV 生成1 2 3 。。。 文件名

Sub SaveToCSVs()

Dim fDir As String

Dim wB As Workbook

Dim wS As Worksheet

Dim fPath As String

Dim sPath As String
Dim i, j, k As Integer

fPath = “\\data\www\fs_audit\joom\allFiles\”

sPath = “\\data\www\fs_audit\joom\”

fDir = Dir(fPath)

Do While (fDir <> “”)

If Right(fDir, 4) = “.xls” Or Right(fDir, 5) = “.xlsx” Then

On Error Resume Next

Set wB = Workbooks.Open(fPath & fDir)

‘MsgBox (wB.Name)

For Each wS In wB.Sheets

wS.SaveAs sPath & i & “.csv”, xlCSV
i = i + 1

Next wS

wB.Close False

Set wB = Nothing

End If

fDir = Dir

On Error GoTo 0

Loop

End Sub

让php support jpeg

需要重新编译
‘./configure’  ‘–prefix=/usr/local/php7’ ‘–with-curl=/usr/local/curl’   ‘–with-gettext’ ‘–with-iconv-dir’ ‘–with-mysql-sock’ ‘–with-kerberos’ ‘–with-libdir=lib64’ ‘–with-libxml-dir’ ‘–with-mysqli’ ‘–with-openssl’ ‘–with-pcre-regex’ ‘–with-pdo-mysql’ ‘–with-pdo-sqlite’ ‘–with-pear’  ‘–with-xmlrpc’ ‘–with-xsl’ ‘–enable-fpm’ ‘–enable-bcmath’ ‘–enable-libxml’ ‘–enable-inline-optimization’ ‘–enable-gd-native-ttf’ ‘–enable-mbregex’ ‘–enable-mbstring’ ‘–enable-opcache’ ‘–enable-pcntl’ ‘–enable-shmop’ ‘–enable-soap’ ‘–enable-sockets’ ‘–enable-sysvsem’ ‘–enable-xml’ ‘–with-fpm-user=www’ ‘–with-fpm-group=www’
再下载安装jpeg
wget http://www.ijg.org/files/jpegsrc.v9b.tar.gz tar xzvf jpegsrc.v9b.tar.gz ./configure –prefix=/usr/local/libjpeg –enable-shared –enable-static make && make install
再去php/ext/gd编译安装
cd /usr/local/src/php-5.6.30/ext/gd #gd的源码目录 /usr/local/php/bin/phpize #生成configure命令 ./configure –with-php-config=/usr/local/php/bin/php-config –with-png-dir –with-freetype-dir –with-jpeg-dir=/usr/lib64 -with-zlib-dir –with-gd make && make install#编译gd
重启php-fpm即可

samba 使用GIT出现权限拒绝问题 无法拉取

In my case, it looks like Git (v 2.6.3) tried to create its own read/write permissions on the Samba drive. This would prevent the pack files and/or objects from getting written (unpack error)

remote: error: unable to write sha1 filename ./objects/pack/pack-<some_hex_string>.pack: Permission denied
remote: fatal: cannot store pack file
error: unpack failed: index-pack abnormal exit
To z:\git\<repo name>
 ! [remote rejected] master -> master (unpacker error)
error: failed to push some refs

I went back and forth on trying to fix. Finally, since I had control of the Samba machine, I added a line to the samba drive config, which says “inherit permissions = yes”. I restarted Samba and tried to push. It worked!

This worked for me since I’m the only person using the Samba server. For others, you may have the play around with “force directory mode” or “force create mode”. You can find the man pages for those over here:

https://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/AccessControls.html

samba中文乱码

可以试下下面的方法

vi /etc/samba/smb.conf
根据locales的设置,修改该文件:
1. 如果locale是zh_CN.UTF-8,做如下设置:
  display charset = UTF-8
  unix charset = UTF-8
  dos charset = UTF-8
2. 如果locale是zh_CN.GBK或zh_CN.gb2312,做如下设置:
  display charset = cp936
  unix charset = cp936
  dos charset = cp936
  重启samba:service samba restart

opcache编译

1
2
3
4
cd /usr/local/src/ZendOptimizerPlus-master
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install

#编辑 php.ini,追加如下内容:

1
2
3
4
5
6
7
8
9
zend_extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/opcache.so
opcache.enable=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
opcache.enable_cli=1

#重启php-fpm

1
service php-fpm restart