Skip to content

Instantly share code, notes, and snippets.

extern mod openssl = "openssl";
extern mod extra;
use crypto = openssl::crypto::symm;
use extra::hex::FromHex;
#[test]
fn test_aes_zeroes_key() {
let key = "00000000000000000000000000000000".from_hex().unwrap();
let plaintext = "80000000000000000000000000000000".from_hex().unwrap();
let ciphertext = "3ad78e726c1ec02b7ebfe92b23d9ec34".from_hex().unwrap();
$ cargo-lite install --git https://github.com/bjz/cgmath-rs.git
note: Inferred pkgname cgmath-rs from path https://github.com/bjz/cgmath-rs.git
Traceback (most recent call last):
File "/tmp/cargo-lite/bin/cargo-lite", line 587, in <module>
main(opts)
File "/tmp/cargo-lite/bin/cargo-lite", line 573, in main
pkg.install(args=rustcargs)
File "/tmp/cargo-lite/bin/cargo-lite", line 497, in install
force=force)
File "/tmp/cargo-lite/bin/cargo-lite", line 289, in install
strict graph {
subgraph "South America" {
CL -- BR;
CL -- PE;
CO -- CL;
CO -- BR;
CO -- VE;
CO -- PE;
CO -- EC;
BR -- PE;
ubuntu@ip-10-74-149-134:~$ mkdir rust-buildbox
ubuntu@ip-10-74-149-134:~$ cd rust-buildbox/
ubuntu@ip-10-74-149-134:~/rust-buildbox$ vim Dockerfile
ubuntu@ip-10-74-149-134:~/rust-buildbox$ docker build -t rust-buildbox .
ubuntu@ip-10-74-149-134:~/rust-buildbox$ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
rust-buildbox latest be231641cce2 18 seconds ago 1.277 GB
ubuntu 14.04 c4ff7513909d 11 days ago 213 MB
ubuntu@ip-10-74-149-134:~/rust-buildbox$ docker run -t -i rust-buildbox /bin/bash
root@45ac8578f983:/# cd /home/rust/
@zokier
zokier / 2048.py
Last active August 29, 2015 14:17 — forked from justecorruptio/2048.py
import os
import tty
tty.setcbreak(0)
M = [''] * 16
def G(v):
p = [''] * 4
u = list(filter(str, v))
i = 3
@zokier
zokier / hello.rc
Created April 19, 2012 14:34
rustc --test fails
use std;
#[link(
name="rust_hello",
vers="0.1",
author = "zokier",
url="http://github.com/zokier/rust_hello",
uuid="6240d465-7dba-4aa8-9053-027a1b12ecc4"
)];
import pygame, time, random, sys, copy, os
from pygame.locals import *
t2 = 0
nor = 0
pc = [[[1, 1], [1, 1]], [[1, 0], [1, 0], [1, 1]], [[0, 1], [0, 1], [1, 1]], [[1], [1], [1], [1]], [[0, 1, 1], [1, 1, 0]], [[1, 1, 0], [0, 1, 1]], [[1, 1, 1], [0, 1, 0]]]
cols = [(0, 0, 0), (100, 100, 100), (10, 100, 225), (0, 150, 220), (0, 220, 150), (60, 200, 10), (180, 210, 5), (210, 180, 10), (100, 200, 170)]
pygame.init()
pygame.display.set_mode((320, 240))
sk = pygame.display.get_surface()
f = [[1] + [0 for x in range(8)] + [1] for x in range(19)] + [[1 for x in range(10)]]
@zokier
zokier / AES_over_IRC.rb
Created June 15, 2012 14:13 — forked from b1nary/AES_over_IRC.rb
AES and some more encryptions over IRC
#!/usr/bin/ruby
require 'socket'
require "base64"
require "open3"
server = "localhost"
port = "6667"
nick = "Nickname#{rand(5000)}"
channel = "#channel"
@zokier
zokier / gist:2980473
Created June 23, 2012 23:00
literal overflow
#include <stdio.h>
int main(int, char**)
{
if (4294967296 != 4294967296LL)
puts("Literal overflows");
else
puts("Literal does not overflow");
}
void (*yesno_cb)(bool);
void yn_tavern_room(bool b)
{
if (b)
set_player_location(&loc_room_offline);
else
set_player_location(&loc_tavern_bartender);
}