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
dummy |
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
$ sudo fastboot devices | |
FA6A20303377 fastboot | |
$ sudo ./flash-all.sh | |
target reported max download size of 536870912 bytes | |
sending 'bootloaderb' (32728 KB)... | |
OKAY [ 0.836s] | |
writing 'bootloaderb'... | |
(bootloader) Valid bootloader version. | |
OKAY [ 1.600s] |
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
extern crate os_pipe; | |
extern crate mio; | |
extern crate nix; | |
use os_pipe::*; | |
use mio::*; | |
use mio::unix::EventedFd; | |
use nix::fcntl::*; | |
use std::io::prelude::*; | |
use std::os::unix::io::*; |
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 hashlib | |
b = 256 | |
q = 2**255 - 19 | |
l = 2**252 + 27742317777372353535851937790883648493 | |
def H(m): | |
return hashlib.sha512(m).digest() | |
def expmod(b,e,m): |
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
extern crate futures; | |
use futures::{Future, Poll, Async}; | |
use std::time::Duration; | |
use std::thread; | |
use std::sync::Arc; | |
use std::sync::atomic::{AtomicBool, Ordering}; | |
struct Sleep { |
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 | |
d="$(mktemp -d)" | |
# Make a git repo with one file in it. | |
mkdir "$d/good" | |
cd "$d/good" | |
git init | |
echo good > file.txt | |
git add -A |
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
x = 5 | |
# ============================== | |
# 1 and x will always divide the number, so no need to check those. so check 2 through x-1. | |
# | |
# i variable is trad. the "iteration count(er)" | |
# try to print all the numbers you will need to check in the primality test | |
i=0 | |
while i<(x-2): |
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
extern crate byteorder; | |
use byteorder::{ByteOrder, LittleEndian}; | |
type Digest = [u8; OUTBYTES]; | |
pub const BLOCKBYTES: usize = 128; | |
pub const OUTBYTES: usize = 64; | |
pub const KEYBYTES: usize = 64; | |
pub const SALTBYTES: usize = 16; |
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 itertools | |
import random | |
def cycle_len(boxes, num): | |
steps = 1 | |
position = num | |
while boxes[position] != num: | |
steps += 1 | |
position = boxes[position] | |
return steps |
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 <sodium.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#define BUFSIZE 65536 | |
#define HASHSIZE 32 | |
int main() { | |
if (sodium_init() == -1) { | |
return 1; |