Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

beginman BeginMan

🎯
Focusing
Block or report user

Report or block BeginMan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@BeginMan
BeginMan / readme.md
Last active Dec 6, 2018
[linux tips]
View readme.md

在linux中,- 如果单独使用 - 符号,不加任何该加的文件名称时,代表"标准输入"的意思

如下小技巧,nc命令来传输目录下多个文件

# host A, on receiver, go to destination directory and execute:
$ nc -l $port | tar xf -

# host B,on sender
@BeginMan
BeginMan / ddata.go
Created Dec 18, 2017
Implement Read like Reader interface, you can get inspiration from buffer.go
View ddata.go
package main
import (
"io"
"fmt"
)
type Data struct {
stream string
@BeginMan
BeginMan / gtopic.go
Created Dec 17, 2017
Get the latest topics of studygolang.com
View gtopic.go
package main
import (
"log"
"time"
"github.com/PuerkitoBio/goquery"
"github.com/briandowns/spinner"
)
@BeginMan
BeginMan / signal.go
Created Oct 16, 2017
[go signal] #go
View signal.go
package main
import (
"fmt"
"time"
"os"
"os/signal"
"syscall"
)
@BeginMan
BeginMan / access.lua
Created Sep 30, 2017 — forked from mariocesar/access.lua
Nginx Lua script redis based for Basic user authentication
View access.lua
function password_encode(password)
local bcrypt = require 'bcrypt'
return bcrypt.digest(password, 12)
end
function check_password(password, encoded_password)
local bcrypt = require 'bcrypt'
return bcrypt.verify(password, encoded_password)
end
@BeginMan
BeginMan / Dockerfile
Last active Sep 29, 2017
[Docker Ng Lua With China APT Source] #docekr #ng #lua
View Dockerfile
# Version 0.0.1
FROM ubuntu:14.04
MAINTAINER Beginman "xinxinyu2011@163.com"
ARG CHAINA_APT_SOURCE
RUN /bin/bash -c "if [[ ${CHAINA_APT_SOURCE} == ON ]];then sed -i 's#http://archive.ubuntu.com#http://mirrors.163.com#g' /etc/apt/sources.list; fi"
RUN apt-get update
RUN apt-get install -y lua5.1
RUN apt-get install -y liblua5.1-dev
RUN apt-get install -y git
RUN apt-get install -y nginx
@BeginMan
BeginMan / Main.java
Created Sep 28, 2017
[Java File read] #java
View Main.java
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
public class Main {
/**
* 步骤:
* 1. File 创建文件句柄
@BeginMan
BeginMan / READEME.md
Created Apr 8, 2017
Form Validation and Processing in Go
View READEME.md
.
├── main.go
└── templates
    ├── confirmation.html
    └── index.html
@BeginMan
BeginMan / READEME.md
Last active Apr 6, 2017
A snippet collection illustrating some common HTTP responses for Go web applications.
View READEME.md
├── golang-response-snippets.go
├── images
│   └── had.jpg
├── templates
│   ├── index.html
│   ├── layout.html
│   └── render_string.html
View READEME.md
You can’t perform that action at this time.