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
#define _GNU_SOURCE | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <signal.h> | |
#include <time.h> | |
#include <sys/types.h> | |
#include <unistd.h> | |
#include <sys/syscall.h> | |
#include <stdbool.h> | |
#include <limits.h> |
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/zsh | |
emulate -L zsh | |
setopt err_exit warn_create_global no_unset | |
#setopt xtrace | |
#typeset -i UL_MAX=215040 | |
#typeset -i UL_MAX=20480 # kbit/s | |
#typeset -i UL_MAX=16384 # kbit/s | |
typeset -i UL_MAX=17408 # kbit/s | |
#typeset -i UL_MAX=1800 |
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 <stdint.h> | |
#include <stdio.h> | |
#include <string.h> | |
int main() { | |
unsigned char foo_arr[9]; | |
memset(foo_arr, 0, 9); | |
unsigned char *foo = foo_arr; | |
uint8_t a = 0xDE; | |
uint64_t b = 0xDEEFBEADDEEFBEADLL; |
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 <stdint.h> | |
#include <stdio.h> | |
#include <string.h> | |
int main() { | |
unsigned char foo_arr[9]; | |
memset(foo_arr, 0, 9); | |
unsigned char *foo = foo_arr; | |
uint8_t a = 0xDE; | |
uint64_t b = 0xDEEFBEADDEEFBEADLL; |
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 <string.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
class string { | |
public: | |
string( const char *str ) : m_str(strdup(str)) {} | |
string( int i ) { | |
asprintf(&m_str, "%d", i); |
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
#!/usr/bin/env ruby | |
require 'getoptlong' | |
include Process | |
include Signal | |
$ignored_signals = ["CLD"] | |
def usage(strm) | |
strm.puts <<-EOF |
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/zsh | |
emulate -L zsh | |
setopt err_exit warn_create_global no_unset | |
#setopt xtrace | |
function parse_elem { | |
local obj cur="$1" in_recovery="$2" | |
if [[ -z "$cur" ]]; then | |
read -r cur || return 1 | |
ret_delim=$'\n' |
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
Mysql2::Error - MySQL server has gone away: | |
/var/www/pub/photohunt/.bundle/ruby/1.9.1/gems/sequel-3.33.0/lib/sequel/database/logging.rb:53:in `query' | |
/var/www/pub/photohunt/.bundle/ruby/1.9.1/gems/sequel-3.33.0/lib/sequel/database/logging.rb:53:in `block in log_connection_execute' | |
/var/www/pub/photohunt/.bundle/ruby/1.9.1/gems/sequel-3.33.0/lib/sequel/database/logging.rb:28:in `log_yield' | |
/var/www/pub/photohunt/.bundle/ruby/1.9.1/gems/sequel-3.33.0/lib/sequel/database/logging.rb:53:in `log_connection_execute' | |
/var/www/pub/photohunt/.bundle/ruby/1.9.1/gems/sequel-3.33.0/lib/sequel/database/query.rb:509:in `rollback_transaction' | |
/var/www/pub/photohunt/.bundle/ruby/1.9.1/gems/sequel-3.33.0/lib/sequel/adapters/shared/mysql.rb:318:in `rollback_transaction' | |
/var/www/pub/photohunt/.bundle/ruby/1.9.1/gems/sequel-3.33.0/lib/sequel/database/query.rb:271:in `rescue in _transaction' | |
/var/www/pub/photohunt/.bundle/ruby/1.9.1/gems/sequel-3.33.0/lib/sequel/data |
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
Semi-formally, the JSON communicated will follow the following EBNF | |
(https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form) grammar (note | |
that this is only roughly EBNF): | |
(* Valid error codes *) | |
ERR_SUCCESS = 0 (* No error occurred *) | |
ERR_UNSPEC = 1 (* Unspecified error. Message contains additional information *) | |
ERR_NOTAUTH = 2 (* Authorization token invalid *) | |
ERR_GAMEOVER = 3 (* Photohunt competition is over. No judged submissions allowed *) | |
(* Additional error codes will be added during development *) |
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/zsh | |
set -e | |
set -x | |
## Begin group of moves that could be done in parallel | |
# Largest temp size 234901, desire 3422 | |
# Moving swapA-1 (3422) (Final goal) | |
pvmove --alloc anywhere /dev/md2:0-3421 /dev/md1:0-3421 | |
# Largest temp size 89514, desire 103031 | |
# Not enough contiguous temporary room for a multipart pvmove | |
# Moving spaceA-5 (14163) (Final goal) |