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 unittest | |
from pyramid import testing | |
from paste.deploy.loadwsgi import appconfig | |
from webtest import TestApp | |
from mock import Mock | |
from sqlalchemy import engine_from_config | |
from sqlalchemy.orm import sessionmaker | |
from app.db import Session |
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
First extract Elastic Search from tarball. (Make sure you are running the latest java version) | |
Then cd into the folder and type: | |
bin/plugin -install river-jdbc -url http://bit.ly/1iovWV9 | |
Get the latest version of the JDBC river for elastic search from https://github.com/jprante/elasticsearch-river-jdbc ( or from the url above) | |
Download a JDBC driver jar from your vendor's site (here MySQL) and put the jar into the folder of the plugin $ES_HOME/plugins/river-jdbc. | |
For MySQL, the JDBC driver can be obtained from http://dev.mysql.com/downloads/connector/j/ |
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" | |
"strconv" | |
"strings" | |
) | |
type Maze struct { | |
x [5][5]int |
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
#include <sys/wait.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <string.h> | |
int | |
main(int argc, char *argv[]) | |
{ | |
int pipefd[2]; | |
pid_t cpid; |
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
//Copied from https://groups.google.com/forum/#!msg/golang-nuts/dEfqPOSccIc/hoq8jdPTBIcJ | |
package main | |
import( | |
"crypto/rand" | |
"crypto/tls" | |
"io/ioutil" | |
"log" | |
"net" |
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 ( | |
"github.com/gorilla/websocket" | |
"io" | |
"log" | |
"net/http" | |
) | |
func handler(w http.ResponseWriter, r *http.Request) { |
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" | |
"strconv" | |
"github.com/extemporalgenome/slug" | |
) | |
type person struct { |
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
HOSTIP=`netstat -rn | grep "^0.0.0.0 " | cut -d " " -f10` | |
/home/vagrant/recond -marksman=http://$HOSTIP:3000 -nats=tcp://$HOSTIP:4222 & | |
echo "recond started..." |
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" | |
"os" | |
"os/exec" | |
"syscall" | |
) | |
func main() { |
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 | |
// @lizrice, mostly copied from @doctor_julz: https://gist.github.com/julz/c0017fa7a40de0543001 | |
import ( | |
"fmt" | |
"os" | |
"os/exec" | |
"syscall" | |
) |
OlderNewer