TCP_Secure_Connection
status: NO_STATUS | CONNECTED | UNCONFIRMED | CONFIRMED
identifier: UID, autoincremented across all connections in TCP_Server
public_key: PK of the connection (taken from handshake)
connections: inited with zeros, keeps links to clients to communicate with
NUM_CLIENT_CONNECTIONS: (256 - NUM_RESERVED_PORTS)
NUM_RESERVED_PORTS: 16
struct {
uint8_t status; /* 0 if not used, 1 if other is offline, 2 if other is online. */
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
version: '2' | |
networks: | |
custom: | |
driver: bridge | |
ipam: | |
driver: default | |
config: | |
- | |
subnet: 172.16.238.0/24 |
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
use nom::*; | |
use cookie_factory::*; | |
use bytes::BytesMut; | |
use std::io; | |
use tokio_io::codec::{Decoder, Encoder}; | |
trait FromBytes : Sized { | |
fn from_bytes(i: &[u8]) -> IResult<&[u8], Self>; | |
} |
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
use nom::*; | |
use cookie_factory::*; | |
use bytes::BytesMut; | |
use std::io; | |
use tokio_io::codec::{Decoder, Encoder}; | |
trait FromBytes : Sized { | |
fn from_bytes(i: &[u8]) -> IResult<&[u8], Self>; | |
} |
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 | |
# author: sir@cmpwn.com | |
# Run ./snake.sh | |
# Arrow keys or wasd to move | |
c=`tput cols`;L=`tput lines` | |
let x=$c/2;let y=$L/2;d=0;le=3;t="$y;$x";i=0;j=0;S=0 | |
A(){ let i=($RANDOM%$c);let j=($RANDOM%$L);};A | |
B(){ printf $*;};C(){ B "\x1B[$1";};D(){ C "$1H";} | |
F(){ D "0;0";C 2J;C "?25h";printf "GAME OVER\nSCORE: $S\n";exit;};trap F INT |
Эта статья - квинтэссенция срача.
Q. Безопасен ли Rust? Можно ли его использовать в проде?
A. Институт программных систем Общества Макса Планка плотно занимается этой проблемой в проекте под названием RustBelt. На январь 2018 формально(sic!) доказаны следующие постулаты:
- Система типов, принципы владения (ownership), времени жизни (lifetime) корректны
- Программа безопасна, если все участки кода внутри
unsafe
безопасны
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
humbug@home:~/zetox$ git diff | cat | |
diff --git a/Cargo.toml b/Cargo.toml | |
index 9206765..b4f0b15 100644 | |
--- a/Cargo.toml | |
+++ b/Cargo.toml | |
@@ -33,7 +33,7 @@ bytes = "0.4" | |
byteorder = "1" | |
futures = "0.1" | |
log = "0.4" | |
-sodiumoxide = "0.0.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
language: rust | |
os: | |
- linux | |
- osx | |
rust: | |
- 1.26.0 | |
- stable | |
- beta | |
- nightly |
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] | |
name = "stack_string" | |
version = "0.1.0" | |
authors = ["Roman Proskuryakov <humbug@deeptown.org>"] | |
edition = "2018" | |
[dependencies] | |
libc = { version = "0.2", default-features = false } | |
heapless = { version = "0.4" } |
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 common; | |
use common::measure_and_print; | |
use std::collections::{BinaryHeap, HashMap}; | |
use std::io; | |
#[derive(Debug, Eq, PartialEq)] | |
enum NodeKind { | |
Leaf(u8), | |
Branch(Box<Node>, Box<Node>), |
OlderNewer