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
package main | |
import ( | |
"errors" | |
"fmt" | |
"github.com/takama/daemon" | |
"log" | |
"os" | |
"os/signal" | |
"syscall" |
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
package main | |
import ( | |
"fmt" | |
"github.com/kr/beanstalk" | |
"os" | |
"time" | |
) | |
func main() { |
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
// based based on | |
// http://www.lucaongaro.eu/blog/2012/12/02/easy-two-way-data-binding-in-javascript/ | |
function PropBack() { | |
var prop = [ | |
{ name: 'value', callback: function(obj, content) { jQuery(obj).val(content); } }, | |
{ name: 'html', callback: function(obj, content) { jQuery(obj).html(content); } }, | |
{ name: 'text', callback: function(obj, content) { jQuery(obj).text(content); } }, | |
{ name: 'title', callback: function(obj, content) { jQuery(obj).attr('title', content); } }, | |
{ name: 'name', callback: function(obj, content) { jQuery(obj).attr('name', content); } }, |
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
/path/to/log/file.log { | |
daily | |
compress | |
postrotate | |
kill -HUP `cat /path/to/app/tmp/puma/puma.pid` | |
endscript | |
} |
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 check_s_client | |
server = 'Generel Settings: ' | |
renegotiation = 'Insecure Renegotiation'.colorize(:red) | |
crime = 'SSL Compression Enabled <= CRIME - CVE-2012-4929'.colorize(:red) | |
results = %x(echo "q" | openssl s_client -host #{@server} -port #{@port} 2> /dev/null) # why ? | |
case results.downcase | |
when 'secure renegotiation is supported' | |
renegotiation = 'Secured Renegotiation'.colorize(:green) | |
when 'compression: none' |
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 to_file(*block) | |
raise ArgumentError.new('You must use block') unless block_given? | |
f = open('/tmp/to_file', 'a+') | |
yield f | |
f.close | |
end | |
to_file do |f| | |
f.puts 'Hello World' | |
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
require 'fiddle' | |
openssl = Fiddle.dlopen('/usr/lib/libssl.so') | |
SSL_library_init = Fiddle::Function.new( | |
openssl['SSL_library_init'], | |
[], | |
Fiddle::TYPE_INT | |
) | |
SSL_library_init.call # no parameters so no () requires |
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 'rubygems' | |
require 'ffi' | |
module SSHSocket | |
extend FFI::Library | |
ffi_lib_flags :now, :global | |
ffi_lib 'libssh' | |
attach_function :ssh_init, [], :int | |
attach_function :ssh_bind_new, [], :pointer |
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
genpasswd() { | |
local l=$1 | |
[ "$l" == "" ] && l=20 | |
tr -dc "A-Za-z0-9_%^&*()\`/[]{}|" < /dev/urandom | head -c ${l} | xargs | |
} | |
genpasswd 52 |
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
%define rubyver 2.2.0 | |
%define debug_package %{nil} | |
Name: ruby | |
Version: %{rubyver} | |
Release: 1%{?dist} | |
License: Ruby License/GPL - see COPYING | |
URL: http://www.ruby-lang.org/ | |
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) | |
BuildRequires: readline-devel ncurses-devel gdbm-devel glibc-devel tcl-devel unzip openssl-devel db4-devel byacc make libyaml-devel valgrind-devel gmp-devel clang |