ITeye博客

东升红日辉万里,明泽润物彻古今

hotsunshine · 共 149 篇文章

MiniMagick::Invalid问题identify-im6.q16: not authorized的解决

Ubuntu环境下,在PDF转化为img的时候,出现了错误 MiniMagick::Invalid: `identify /tmp/mini_magick20200313-18654-pe5i58.pdf` failed with error: identify-im6.q16: not authorized `/tmp/mini_magick20200313-18654-pe5i58.pdf' @ error/constitute.c/ReadImage/412. # 修改配置文件 sudo vim /etc/ImageMagick-6/policy.xml # 修改 <policy do…

2020-03-13 14:41 · ruby · 评论(0)

反向代理的nginx日志设置显示源ip

外层代理 A 设置为 location /*** { index hainan.html index.jsp; proxy_set_header Host $host; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; proxy_pass http://代理B的ip地址; …

2018-12-03 14:35 · linux · 评论(0)

ubuntu下中文文件乱码

从windows上传上去的文件名如果是中文会有乱码的情况出现,主要是windows的gbk文件名到linux下的utf8不识别 安装convmv sudo apt-get install convmv 转码 convmv -f GBK -t UTF-8 --notest 文件路径 整个目录下所有文件转码 convmv -f GBK -t UTF-8 --notest -r *

2015-12-01 13:36 · linux · 评论(0)

Redhat远程sftp连接失败

服务器设置ssh之后,远程sftp连接失败 Connection closed by server with exitcode 126 原因是: "/etc/ssh/sshd_config" sshd配置文件中引用的sftp不存在造成的 修改配置文件中的相关配置,改为使用internal-sftp #Subsystem sftp /usr/local/ssh/libexec/sftp-server Subsystem sftp internal-sftp

2015-11-23 09:40 · linux · 评论(0)

Ubuntu下rails程序链接oracle数据库

rails支持oracle数据库连接 一、下载安装(解压)依赖包 下载 instantclient-basic, instantclient-sqlplus and instantclient-sdk zip archives 然后解压到 instantclient_12.1 文件夹下面(文件名字以实际名字为主). 然后把文件移动到 /opt/oracle/instantclient_12.1 下载需要登录oracle账号,并且要同意协议,直接点击下面链接无法下载 如遇版本修改,连接可能失效,请在官网自行搜索下载 32位地址 http://www.oracle.com/technetwork…

2015-09-17 15:32 · rails · linux · 评论(0)

Mac下Eclipse打开layout目录的xml报错java.lang.NullPointerException

Mac下Eclipse打开layout目录的xml报错 java.lang.NullPointerException 解决方案 菜单栏 project -> clean...

2015-08-19 14:31 · android · 评论(0)

wkhtmltopdf 说明文档

wkhtmltopdf 0.9.6 Manual This file documents wkhtmltopdf, a program capable of converting html documents into PDF documents. Contact If you experience bugs or want to request new features please visit http://code.google.com/p/wkhtmltopdf/issues/list, if you have any problems or comments please feel…

2015-08-17 16:56 · linux · 评论(0)

rails查询清除默认排序

User.all.order('id desc ').reorder('') 生成的sql文件 SELECT `users`.* FROM `users`

2015-05-28 21:01 · rails · 评论(0)

gvm安装go编译错误

Cannot find command go after upgrading to go1.4 原因:git版本低 方案: 更新git到最新版本

2015-04-19 23:14 · go · 评论(0)

sunspot-rails无法启动,后台访问404错误

问题是这样的: bundle exec rake sunspot:solr:start RAILS_ENV=production 执行之后日志显示是成功的,但是去做index索引的时候,返回的是错误下面这个错误 Rails app: Solr throwing RSolr::Error::Http - 404 Not Found when executing search 很显然是没有启动成功,上面那个success只是一个假象而已。 解决方案,在config/sunspot.yml中的配置中添加一项: solr_home: solr 注意千万别手欠写成xml 参考地址 http://sta…

2015-03-18 15:20 · rails · 评论(0)

nokogiri的gem安装错误

安装nokogiri错误 Error installing nokogiri: invalid gem: package is corrupt, exception while verifying: undefined method `size' for nil:NilClass (NoMethodError) in /home/user/.rvm/gems/ruby-2.0.0-p598/cache/nokogiri-1.6.6.2.gem 解决方法 rm /home/user/.rvm/gems/ruby-2.0.0-p598/cache/nokogiri-1.6.6.2.gem gem…

2015-02-10 12:56 · rails · 评论(0)

ubuntu设置为unity 2D

vbox安装完ubuntu之后,unity 3d支持不好 编辑配置文件 sudo vim /etc/lightdm/lightdm.conf user-session=ubuntu-2d 如果没有这个文件,添加 [seatdefaults] greeter-session=unity-greeter user-session=ubuntu-2d

2015-01-29 17:06 · linux · 评论(0)

Java中的long类型的秒数转成字符串

Java中的long类型的秒数转成字符串 // published是时间lang值 比如:1419323634391 public String getPublishedStringLong() { String pattern = "yyyy-MM-dd HH:mm:ss"; SimpleDateFormat format = new SimpleDateFormat(pattern); return format.format(new Date(published)); } public String getPublishedString() { String pattern = "yy…

2014-12-26 17:46 · java · 评论(0)

ubuntu中ruby使用文字生成图片以及汉字不显示(或者乱码)的问题

ruby中使用IMGKit这个gem可以完成文字以及html生成图片的功能 使用方法(Linux环境下) 安装gem gem install imgkit gem install wkhtmltoimage-binary 测试 IMGKit.new("你好").to_file('tmp/hello.png') 文字生成图片汉字不显示,或者乱码, 造成这种现象的原因: 1、缺少字体 2、编码声明 编码声明 IMGKit.new("<!DOCTYPE html><html><head><meta charset='UTF-8'></head><body>你好</body></html>").to…

2014-12-23 10:29 · rails · linux · 评论(0)

UITableView去除多余的横线

查什么东西都他妈的要翻*—^^—*墙, 国内的都好渣,把这贴一下 数据不满的时候UITableView会有很多空线,数据加载之前也会有很多横线,去掉的办法就是给他的footer设置一下: [b]For iOS 8., 7. and iOS 6.1[/b] The easiest method is to set the tableFooterView property: [code=ios]- (void)viewDidLoad { [super viewdidload]; // This will remove extra separators from tableview self.ta…

2014-12-01 10:57 · ios · 评论(0)