Skip to content

Instantly share code, notes, and snippets.

View liuxd's full-sized avatar
🗿
Hi, there.

Allen Liu liuxd

🗿
Hi, there.
  • Tax Traders
  • Auckland, New Zealand
View GitHub Profile

Console

The XSS Auditor refused to execute a script in 'http://XXXXX' because its source code was found within the request. The auditor was enabled as the server sent neither an 'X-XSS-Protection' nor 'Content-Security-Policy' header.

Explaination

That is a browser feather in secure to prevent XSS.If you wanna skip it,give a head like this from server side:

现象:

执行以下命令,想要统计当前目录下所有markdown文件的内容行数。

find . -name "*.md"|xargs cat|wc -l

结果报错了:

xargs: unterminated quote
@liuxd
liuxd / Mac sudoers is world writable.md
Last active August 14, 2018 03:48
[Mac sudoers is world writable] #Mac

Fix permissions of the /etc/sudoers in Finder

  • Go -> Go to Folder..., /etc/sudoers.
  • Right click, Get Info.
  • Unlock the lock in the bottom.
  • set the permissions:
    • system = Read Only
    • wheel = Read Only
    • everyone = No Access
@liuxd
liuxd / content.md
Last active June 18, 2021 04:12
[Bugs] #Tips

Bug记录

代码Bug

  • parse_ini_file(),对于parse_ini_file这个函数来说,ini文件的配置项不加引号的on会被解释为字符串的"1",而同样不加引号的off会被解释为""(空字符串)!2014
  • Memcache::add(),过期时间最多只能设为30天,如果超过这个限制,memcached将不会缓存,但是函数仍然会返回true。2014
  • job的对游标文件的读写没有进行过滤和类型转换,导致错误的记录信息,和错误的读取,甚至有sql注入的危险。2014
  • 设置缓存时写成数组累加的样子,而不是覆盖。导致要缓存的数组越来越大,引起内存爆表。2014
  • 提炼公共函数,没有把原来文件里的函数删掉,导致redeclare错误。2014
  • 数据处理包含了去重逻辑。在单进程是去重是没问题的,但是简单的划分成多进程后,最终结果的去重就不对了。2015
@liuxd
liuxd / 如何评价PHP.md
Last active June 20, 2024 23:14
[PHP is the worst?] #英文翻譯

原文

为啥一些Web开发者说PHP是设计得最烂的语言?

Rasmus Schultz, web开发者,从1998开始用过很多种语言、框架和数据库。

因为这是真的。

现在,我知道因为我不再为PHP辩护而不再受欢迎,请大家见谅。

@liuxd
liuxd / alias.sh
Last active September 5, 2017 07:35
alias config backup.
alias h='vim /etc/hosts'
alias subl="'/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl'"
alias loc="php -S 0.0.0.0:8000"
alias rm="rm -rf "
alias tree="tree -N"
alias ds="find . -name .DS_Store|xargs rm"
alias dh="df -h"
alias up='g add .;g ci -am up'
alias gpush='g push'
alias f='fuck'
@liuxd
liuxd / lean.css
Last active September 7, 2017 01:27
[lean.css] 网页倾斜。
/* 用法:拷贝到对应网页里。 */
body{
-webkit-transform: rotate(-3deg);
-moz-transform: rotate(-3deg);
-o-transform: rotate(-3deg);
padding-top:20px;
}
@liuxd
liuxd / flash-title.html
Created September 7, 2017 00:51
title flash
<!DOCTYPE html>
<html>
<head>
<title>闪烁title</title>
</head>
<body>
<script type="text/javascript" language="javascript">
var flashTitlePlayer = {
//开始闪烁。
//@param string $msg
@liuxd
liuxd / html-editor.html
Created September 7, 2017 00:51
html-editor.html
data:text/html, <html contenteditable>
@liuxd
liuxd / matrix.html
Created September 7, 2017 00:52
matrix.html
<!DOCTYPE HTML>
<html>
<head>
<style>
body {
margin: 0;
padding: 0;
}
canvas {