Skip to content

Instantly share code, notes, and snippets.

View kymtwyf's full-sized avatar
:octocat:

Wu Yongfeng kymtwyf

:octocat:
View GitHub Profile
@kymtwyf
kymtwyf / windows CRLF LF .md
Created July 19, 2017 01:33
Windows 下使用git的换行符问题, windows, CRLF, LF, git, .gitattributes

关于windows环境下CRLF line deliminator 的说明

  1. git 有一个config 叫core.autocrlf 如果设置为true的话, windows下git会在
  • checkout的时候把LF转换为CRLF (如果这时用eslint的linebreak-style进行较难的话会报错 message: 'Expected linebreaks to be 'LF' but found 'CRLF'. (linebreak-style)' )
  • push 的时候把CRLF转换为LF (这样保证服务器上还是LF)
  • 解决办法如2,3描述
  1. .gitattributes这个文件里面可以控制git在clone代码时对于line deliminator的转换 添加如下规则:
*.js text eol=lf
@kymtwyf
kymtwyf / remove-touchmove.md
Created April 14, 2017 18:42
mobile web 去掉回弹效果
$("body").on('touchmove', function(e) { e.preventDefault() });
@kymtwyf
kymtwyf / update nginx.md
Created January 7, 2017 09:47
update nginx to latest version in ubuntu
sudo add-apt-repository ppa:nginx/stable
sudo apt-get update
sudo apt-get install nginx

reference

hdiutil convert -format UDRW -o ubuntu-16.04-desktop-amd64 ubuntu-16.04-desktop-amd64.iso

diskutil list

diskutil unmountDisk /dev/disk2

sudo dd if=ubuntu-16.04-desktop-amd64.dmg of=/dev/disk2 bs=1m
@kymtwyf
kymtwyf / soot error.md
Created July 5, 2016 14:57
soot Exception in thread "main" java.lang.RuntimeException: Could not load classfile: java.lang.CharSequence

reference I met a exception when execution as instructions on soot homepage

soot Exception in thread "main" java.lang.RuntimeException: Could not load classfile: java.lang.CharSequence

This is caused by a high version of JDK(1.8.0)

switching to a lower version of jdk (1.6 or 1.7) solves this problem

cheers!~

@kymtwyf
kymtwyf / nifi-fail.md
Created June 29, 2016 16:25
org.apache.nifi.StdErr Failed to start web server: "Too many open files" //

Nifi 报错: [NiFi logging handler] org.apache.nifi.StdErr Failed to start web server: 打开的文件过多

reference reference2

Added to /etc/security/limits:

* hard nofile 50000
@kymtwyf
kymtwyf / 阿里云Aliyun Access denied; you need (at least one of) the SUPER privilege(s) for this operation.md
Last active June 25, 2016 02:01
阿里云Aliyun Access denied; you need (at least one of) the SUPER privilege(s) for this operation.md

Aliyun Reference 按照他提供的方法:

  1. 去掉DEFINER=root@`% 类似的子句
sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/ ' your.sql > your_revised.sql
  1. 检查 SQL 文件,去除下面类似的语句
@kymtwyf
kymtwyf / tmp_overflow.md
Created April 29, 2016 03:37
overflow 1.0M 1.0M 0 100% /tmp

Reference when executing df -hl shows /tmp is mounted on overflow :

overflow          1.0M  1.0M     0 100% /tmp

If your “/tmp” mount on a linux filesystem is mounted as overflow (often sized at 1MB), this is likely due to you not specifying “/tmp” as its own partition and your root filesystem filled up and “/tmp” was remounted as a fallback. To fix this after you’ve cleared space, just unmount the fallback and it should remount at its original point:

sudo umount overflow

###update sudo apt-get udpate

###install pip sudo apt-get install python-pip

###install zbar sudo apt-get install python-zbar