Skip to content

Instantly share code, notes, and snippets.

-> "\"IMPLEMENTATION\" \"dovecot\"\r\n"
-> "\"SASL\" \" CRAM-MD5 DIGEST-MD5\"\r\n"
-> "\"SIEVE\" \"fileinto reject envelope vacation imapflags notify subaddress relational comparator-i;ascii-numeric regex\"\r\n"
-> "\"STARTTLS\"\r\n"
-> "OK \"Dovecot ready.\"\r\n"
<- "STARTTLS\r\n"
-> "OK \"Begin TLS negotiation now.\"\r\n"
<- "AUTHENTICATE \"PLAIN\" \"AHRlc3RAdHJ5cGhvbi...\"\r\n"
-> "\"IMPLEMENTATION\" \"dovecot\"\r\n"
-> "\"SASL\" \"PLAIN LOGIN CRAM-MD5 DIGEST-MD5\"\r\n"
/*
A Minimal Capture Program
This program opens an audio interface for capture, configures it for
stereo, 16 bit, 44.1kHz, interleaved conventional read/write
access. Then its reads a chunk of random data from it, and exits. It
isn't meant to be a real program.
From on Paul David's tutorial : http://equalarea.com/paul/alsa-audio.html
#!/usr/bin/env ruby
# A Minimal Capture Program
# using alsa via ruby-ffi
#
# This program opens an audio interface for capture, configures it for
# stereo, 16 bit, 44.1kHz, interleaved conventional read/write
# access. Then its reads a chunk of random data from it, and exits. It
# isn't meant to be a real program.
#
#!/usr/bin/env ruby
# Make sine wav file
# using sndfile via ruby-ffi
#
# Based on sndfile example
require 'rubygems'
require 'ffi'
@albanpeignier
albanpeignier / gist:113391
Created May 18, 2009 09:18
First preview of ALSA ruby binding
ALSA::PCM::Capture.open("hw:0", self.format(:sample_format => :s16_le)) do |capture|
capture.read do |buffer, frame_count|
self.sndfile.write buffer, frame_count
if frames_to_record
(frames_to_record -= frame_count) > 0
else
true
end
end
end
require 'rubygems'
require 'ffi'
pointer = FFI::MemoryPointer.new(:char, 3)
puts "pointer: #{pointer.inspect} (#{pointer.type_size})"
# => pointer: #<MemoryPointer address=0x1713e50 size=3> (1)
first = pointer + pointer.type_size
puts "first: #{first.inspect}"
# => first: #<Native Pointer address=0x1713e51>
@albanpeignier
albanpeignier / gist:179402
Created September 1, 2009 21:18
First system-builder example
image = DiskImage.new("/var/tmp/system-builder/disk").tap do |image|
image.boot = DebianBoot.new('/var/tmp/system-builder/boot').tap do |boot|
boot.mirror = "http://127.0.0.1:9999/debian"
end
image.boot.configure do |chroot|
chroot.apt_install :puppet
end
end.create
Sox.command do |sox|
sox.input "input1.wav"
sox.input "input2", :type => "ogg"
sox.output "output", :type => "ogg", :compression => 8
sox.effet :trim, :start => 10, :length => 600
end
augtool> print /files/etc/nagios3/cgi.cfg/
/files/etc/nagios3/cgi.cfg/use_authentication = "1"
/files/etc/nagios3/cgi.cfg/use_ssl_authentication = "0"
/files/etc/nagios3/cgi.cfg/authorized_for_system_information = "nagiosadmin"
/files/etc/nagios3/cgi.cfg/authorized_for_configuration_information = "nagiosadmin"
/files/etc/nagios3/cgi.cfg/authorized_for_system_commands = "nagiosadmin"
/files/etc/nagios3/cgi.cfg/authorized_for_all_services = "nagiosadmin"
/files/etc/nagios3/cgi.cfg/authorized_for_all_hosts = "nagiosadmin"
/files/etc/nagios3/cgi.cfg/authorized_for_all_service_commands = "nagiosadmin"
/files/etc/nagios3/cgi.cfg/authorized_for_all_host_commands = "nagiosadmin"
Scenario: Create a chunk with a single label
Given a label exists with timestamp: "17:00:00"
And that label is selected
When I follow "Nouvel extrait à partir de ce repère"
Then I should be on the new chunk page
And the "Horaire de début" datetime should contain "17:00:00"
And the "Horaire de fin" datetime should contain "17:00:00"