Skip to content

Instantly share code, notes, and snippets.

View corerman's full-sized avatar
🚩

corerman

🚩
View GitHub Profile
@corerman
corerman / tp_run_config
Created April 20, 2018 05:12
thinkphp phpstudy
APACHE支持.htaccess以及 No input file specified解决方案
你的Apache安装文件夹conf里找到httpd.conf文件
索LoadModule rewrite_module modules/mod_rewrite.so 如果前面有注释符号#,请去掉。
搜索Options FollowSymLinks,然后将它下面的AllowOverride None 修改为AllowOverride All;
【1】
没想到遇见了 No input file specified 因为项目用了URL route ,估摸着可能是rewrite的问题。
@corerman
corerman / iframe_auto.js
Created April 7, 2018 09:59
JS:iframe 自动适应内容高度
function reinitIframe() {
var iframe = document.getElementById("main_iframe");
try {
var bHeight = iframe.contentWindow.document.body.scrollHeight;
var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
var height = Math.max(bHeight, dHeight);
iframe.height = height;
@corerman
corerman / PHPStrom 配置Palcon环境.txt
Last active April 5, 2018 13:37
PHPStrom 配置Palcon环境
* https://my.oschina.net/kmwzjs/blog/337199 配置支持Phalcon-tools:
* 在phalcon的官方博客上面说了要把phalcon的ide类库提示单独出来维护,所以在github上的phalcon dev tools已经不再有stubs了。
项目地址放在了https://github.com/phalcon/ide-stubs上。
只要clone下来,再在phpstorm项目中的external libraries添加clone下来的文件夹就行。
参考文章:
https://blog.phalconphp.com/post/phalcon-ide-stubs-repository
package main
import (
"bytes"
"fmt"
"io/ioutil"
"net/http"
"net/url"
)
@corerman
corerman / goTcpListen.go
Created January 15, 2018 09:10
golang network listen
package main
import (
"fmt"
"net"
"time"
"bufio"
)
func handleConnection(conn net.Conn) {
@corerman
corerman / iptables.sh
Created January 10, 2018 14:02
iptables转发:根据ip进行转发
iptables -t nat -A PREROUTING -d 1.2.3.4 -p tcp --dport 3389 -j DNAT --to 192.168.1.1:3389
类似这个的。
1.2.3.4是你的外网IP  192.168.1.1是你想映射到外网的内网服务器。
如果vps有多个ip,可以实现ip之间端口转发
@corerman
corerman / shellService.sh
Created January 6, 2018 07:53
shell service
#!/bin/bash
case "$1" in
"start")
echo "$0 starting...";
privoxy /config;
echo "$0 started...";;
"stop")
echo "$0Stoping...";
killall privoxy;
echo "$0 Stoped...";;
@corerman
corerman / goBlowFish.go
Created January 5, 2018 03:49
golang blowfish 加密算法
package main
import (
"crypto/cipher"
// "github.com/labstack/gommon/log"
"golang.org/x/crypto/blowfish"
"fmt"
)
func main() {
// decrypt()
encrypt()
You can upload data and files with one form using ajax.
PHP + HTML
<?
print_r($_POST);
print_r($_FILES);
?>
<form id="data" method="post" enctype="multipart/form-data">
@corerman
corerman / leftjoin.sql
Created June 14, 2017 01:52
Sql left join
select a.oldman_name,b.org_id
From tbl_assess_oldman_ability a LEFT JOIN tbl_assess_user b
ON a.assess_user_id=b.admin_id
where b.org_id=15