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
| from flask import Flask | |
| from flask.ext.hopak import FlaskHopak | |
| from flask.ext.pymongo import PyMongo | |
| import models | |
| def create_app(): | |
| # Create flask app | |
| app = Flask(__name__) |
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
| #ifndef TEXR_CROSS_H | |
| #define TEXR_CROSS_H | |
| #if TARGET_OS_IPHONE | |
| #define IPHONE 1 | |
| #else | |
| #define IPHONE 0 | |
| #endif | |
| #define on_iphone(x) {} |
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 ("log"; "os"; "net"; "bufio";"crypto/tls";"crypto/x509") | |
| var caPool *x509.CertPool; | |
| var tlsConf tls.Config; | |
| func connLoop(conn net.Conn) { | |
| sconn := tls.Server(conn, &tlsConf); | |
| err := sconn.Handshake(); |
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
| #!/bin/sh | |
| set -e | |
| CLI=./cli | |
| if [ ! -e ~/.texr.cert ]; then | |
| TD=$(mktemp -d) | |
| openssl genrsa 2048 > ${TD}/key.priv 2> /dev/null | |
| openssl rsa -in ${TD}/key.priv -pubout -out ${TD}/key.pub 2>/dev/null |
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
| import os | |
| import msgpack | |
| import socket | |
| def cmd(name): | |
| def cmd(f): | |
| f._cmd_name = name | |
| return f | |
| return cmd |
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 net.texr.mobile; | |
| import java.io.IOException; | |
| import java.io.InputStream; | |
| import java.io.OutputStream; | |
| import java.util.ArrayList; | |
| import org.msgpack.MessagePack; | |
| import org.msgpack.packer.Packer; | |
| import org.msgpack.type.Value; |
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
| mport socket | |
| msg = '''OPTIONS sip:texr.net SIP/2.0 | |
| Via: SIP/2.0/UDP texr.net;branch=z9hG4bK5cb072362f08f6a3 | |
| Content-Length: 0 | |
| From: "neko" <sip:[email protected]>;tag=4158f3dc | |
| To: "neko" <sip:[email protected]> | |
| User-Agent: pygay | |
| CSeq: 55216 OPTIONS | |
| Max-Forwards: 70 |
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
| input_fd = open("key.dat", O_RDONLY); | |
| if(input_fd < 0) { | |
| fprintf(stderr, "failed to open data file\n"); | |
| return 1; | |
| } | |
| lseek(input_fd, 38, SEEK_SET); | |
| memset(data, 0, 1024); | |
| have = read(input_fd, data, 1024); | |
| if(have < 100) { |
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
| #include "stdio.h" | |
| #include "string.h" | |
| #include "gost89.h" | |
| #include "gosthash.h" | |
| #include "util.h" | |
| #include <fcntl.h> | |
| #include <sys/types.h> | |
| #include <sys/uio.h> | |
| #include <unistd.h> |
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
| var asn1 = require('asn1.js'); | |
| var broken = function() { | |
| var B = asn1.define('B', function() { | |
| this.seq().obj( // NO implicit tag here | |
| this.key('b').octstr() | |
| ); | |
| }); | |
| var A = asn1.define('Bug', function() { |
OlderNewer