This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git clone git://git.kernel.org/pub/scm/virt/kvm/kvm.git | |
| git clone git://git.kiszka.org/kvm-kmod.git | |
| cd kvm-kmod | |
| ./configure | |
| make LINUX=../kvm clean sync all | |
| modprobe -r kvm_intel | |
| cp ./x86/kvm*.ko /lib/modules/$(uname -r)/kernel/arch/x86/kvm/ | |
| modprobe kvm_intel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'openssl' | |
| require 'base64' | |
| require 'json' | |
| require 'httpclient' | |
| http = HTTPClient.new(:agent_name => useragent) | |
| key = "" #The Private key | |
| login_info = {:guid => "00000000-0000-0000-0000-000000000000", | |
| :password => "PASSWORD", | |
| :username => "USERNAME", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "html/template" | |
| "net/http" | |
| "path/filepath" | |
| "strings" | |
| "io/ioutil" | |
| "github.com/russross/blackfriday" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <body> | |
| <h1>Will's Blog!</h1> | |
| <a href="/{{.File}}"><h2>{{.Title}} ({{.Date}})</h2></a> | |
| <p>{{.Body}}</p> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func handlerequest(w http.ResponseWriter, r *http.Request) { | |
| if (r.URL.Path[1:] == "") { | |
| posts := getPosts() | |
| t := template.New("index.html") | |
| t, _ = t.ParseFiles("index.html") | |
| t.Execute(w, posts) | |
| } else { | |
| f = "posts/" + r.URL.Path[1:] + ".md" | |
| fileread, _ := ioutil.ReadFile(f) | |
| lines := strings.Split(string(fileread), "\n") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| a = append(a, Post{title, date, summary, body, file}) | |
| } | |
| return a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fileread, _ := ioutil.ReadFile(f) | |
| lines := strings.Split(string(fileread), "\n") | |
| title := string(lines[0]) | |
| date := string(lines[1]) | |
| summary := string(lines[2]) | |
| body := strings.Join(lines[3:len(lines)], "\n") | |
| body = string(blackfriday.MarkdownCommon([]byte(body))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| a := []Post{} | |
| files, _ := filepath.Glob("posts/*") | |
| for _, f := range files { | |
| file := strings.Replace(f, "posts/", "", -1) | |
| file = strings.Replace(file, ".md", "", -1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func getPosts() []Post{ | |
| a := []Post{} | |
| files, _ := filepath.Glob("posts/*") | |
| for _, f := range files { | |
| file := strings.Replace(f, "posts/", "", -1) | |
| file = strings.Replace(file, ".md", "", -1) | |
| fileread, _ := ioutil.ReadFile(f) | |
| lines := strings.Split(string(fileread), "\n") | |
| title := string(lines[0]) | |
| date := string(lines[1]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type Post struct { | |
| Title string | |
| Date string | |
| Summary string | |
| Body string | |
| File string | |
| } |
NewerOlder