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
require 'ip' | |
grammar BindConf | |
include IP | |
rule entries | |
(zone / key / server)* { | |
%w(zone key server).each do |i| | |
module_eval <<-eot, __FILE__, __LINE__+1 | |
def each_#{i}(&block) |
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
def diag(seize,neuf,inch,pixels) | |
ratio = (seize**2+neuf**2)**0.5 | |
cms = inch*2.54 | |
taille = [seize, neuf].map {|v| (v*cms/ratio).round(2)} | |
taille << (taille[0]/pixels*10).round(4) | |
taille << pixels*neuf/seize | |
return taille | |
end |
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
(* | |
Module: Named | |
parses /etc/namedb/named.conf | |
Author: Mathieu Arnold <[email protected]> | |
About: Reference | |
This lens tries to keep as close as possible to the bind documentation where | |
possible. An online source being : | |
http://www.freebsd.org/cgi/man.cgi?query=syslog.conf&sektion=5 |
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
require 'socket' | |
require 'openssl' | |
require 'net/ftp' | |
module Net | |
class FTPTLS < FTP | |
def login(user = "anonymous", passwd = nil, acct = nil) | |
@ctx = OpenSSL::SSL::SSLContext.new('SSLv3') | |
@ctx.verify_mode = OpenSSL::SSL::VERIFY_NONE | |
voidcmd("AUTH TLS") |
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 'rubygems' | |
require 'dnsruby' | |
module Dnsruby | |
class RR | |
class DS | |
def rdata_to_string | |
if (@key_tag != nil) |
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/sh | |
if [ -z $1 ] | |
then | |
echo "$0 zones" | |
exit 1 | |
fi | |
for zone in $@ | |
do |
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
<?xml version='1.0' encoding='utf-8' ?> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | |
<html xmlns='http://www.w3.org/1999/xhtml'> | |
<head> | |
<title>Films</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
//<![CDATA[ | |
var start = 9; | |
var end = 23; |
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 | |
input = $stdin.readlines.map do |l| | |
l.chomp! | |
title = true | |
l.split(/\s+/).inject([""]) do |acc, a| | |
if /^\d?\d:\d\d$/ =~ a | |
title = false | |
acc << a.sub(/^0/, '') | |
elsif title |
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
tell application "System Events" | |
repeat | |
delay 0.05 | |
try | |
click UI element "Suivant" of window 1 of application process "iTunes" | |
end try | |
end repeat | |
end tell |
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
function isRIBvalid(banque, guichet, compte, clef) { | |
var tab= "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; | |
var tab1="123456789123456789234567890123456789".split(""); | |
while (compte.match(/\D/) != null) | |
compte=compte.replace(/\D/, tab1[tab.indexOf(compte.match(/\D/))]); | |
var compte=parseInt(compte, 10); | |
a=banque % 97; | |
a=a*100000+parseInt(guichet, 10); | |
a=a%97; | |
a=a*Math.pow(10, 11) + compte; |