This file contains 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
from bottle import route, run, request, default_app, HTTPResponse | |
import mysql.connector | |
@route('/login') | |
def login(): | |
username = request.query.id | |
password = request.query.password | |
connect = mysql.connector.connect(db="test", host="localhost", port=3306, user="root") | |
cur = connect.cursor() |
This file contains 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
#!/bin/bash | |
set -e | |
apt-get install -y snort | |
# get my ip address | |
IPADDR=$(hostname -i) | |
# configure ip address and logging format |
This file contains 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
#!/bin/bash | |
set -e | |
ENDPOINT= | |
# install java 8 | |
add-apt-repository ppa:openjdk-r/ppa | |
apt-get update | |
apt-get install -y openjdk-8-jdk |
This file contains 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
(ns sicp.ch3-3-4) | |
;;; queue | |
(defn make-queue [] | |
(let [q (atom [])] | |
(letfn [(empty-queue? [] | |
(empty? @q)) | |
(front-queue [] | |
(first @q)) | |
(insert-queue! [item] |
This file contains 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
(ns sicp.ch4-1 | |
(:refer-clojure :exclude [apply eval true? false?])) | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;; Evaluator data structures (ch.4.1.3, 4) | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;; procedure | |
(defn tagged-list? [exp tag] | |
(if (seq? exp) |
This file contains 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
// Another logic to find the import path. | |
// If the package is already imported at the other Go file of the same directory, | |
// the import path declared at the file will be used as the import path of the target file. | |
// | |
// Install: | |
// cp findimport.go $GOPATH/src/golang.org/x/tools/imports | |
// go install golang.org/x/tools/cmd/goimports | |
// | |
// Uninstall: | |
// rm $GOPATH/src/golang.org/x/tools/imports/findimport.go |
This file contains 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
import argparse | |
import sys | |
from mitmproxy import ctx | |
class Replacer: | |
def __init__(self, src, dst): | |
self.src, self.dst = src, dst | |
def request(self, flow): | |
if flow.request.host == self.src: |
This file contains 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
--- | |
AWSTemplateFormatVersion: 2010-09-09 | |
Parameters: | |
Param: | |
Type: String | |
Default: v1 | |
Resources: | |
MyCustomResource: | |
Type: Custom::MyResouce | |
Properties: |
This file contains 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 ( | |
"fmt" | |
"log" | |
"os" | |
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |
"k8s.io/client-go/kubernetes" | |
"k8s.io/client-go/tools/clientcmd" |
This file contains 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 ( | |
"fmt" | |
"log" | |
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |
"k8s.io/client-go/kubernetes" | |
"k8s.io/client-go/tools/clientcmd" | |
) |
OlderNewer