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
def vxworks_sum(plaintext) | |
int = 0 | |
0.upto(plaintext.length - 1) do |i| | |
int += plaintext[i] * (i + 1) ^ (i + 1) | |
end | |
int | |
end |
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
def sum_to_pw(int) | |
out = "%u" % ((int * 31695317) & 0xffffffff) | |
out.bytes.each_with_index do |b, i| | |
out[i] += '!'[0] if out[i] < '3'[0] | |
out[i] += '/'[0] if out[i] < '7'[0] | |
out[i] += 'B'[0] if out[i] < '9'[0] | |
end | |
out | |
end |
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
def vxworks_sum_to_pw(int) | |
out = "%u" % ((int * 31695317) & 0xffffffff) | |
out.bytes.each_with_index do |b, i| | |
out[i] += '!'[0] if out[i] < '3'[0] | |
out[i] += '/'[0] if out[i] < '7'[0] | |
out[i] += 'B'[0] if out[i] < '9'[0] | |
end | |
out | |
end |
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 <stdlib.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <openssl/evp.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
<?php | |
require "inc/mysql.inc.php"; | |
?> | |
<html> | |
<head><title>Oh, Those Admins!</title></head> | |
<body><center><h1>Oh, hi!</h1> | |
<?php | |
if (isset($_GET['password'])) { | |
$r = mysql_query("SELECT login FROM admins WHERE password = '" . md5($_GET['password'], true) . "'"); | |
if (mysql_num_rows($r) < 1) |
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 <stdlib.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <openssl/evp.h> | |
// compile with: gcc -lssl find.c |
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
escape ^]] | |
startup_message off | |
defflow auto | |
defscrollback 5000 | |
altscreen on | |
autodetach on | |
msgwait 3 | |
#change the hardstatus settings to give an window list at the bottom of the | |
#screen, with the time and date and with the current window highlighted |
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
require 'socket' | |
listener = TCPServer.new(8888) | |
loop do | |
puts 'waiting for connection...' | |
sock = listener.accept | |
fork do | |
puts 'i am child' | |
filename = sock.gets.split[1] | |
begin |
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
# put this in ~/.irbrc | |
def h(html) | |
File.open('/tmp/irb.html', 'w') { |f| f.write html } | |
`chromium /tmp/irb.html` | |
end | |
Example: | |
% irb |
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
# ripoff of jreese.zsh-theme | |
if [ "$(whoami)" = "root" ]; then NCOLOR="red"; fi | |
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" | |
PROMPT='%m \ | |
$(git_prompt_info)\ | |
%(!.#.%%) ' | |
#PROMPT='%{%{$fg[green]%}%m%{$reset_color%} \ | |
#$(git_prompt_info)\ |