Skip to content

Instantly share code, notes, and snippets.

View lazzarello's full-sized avatar

Lee Azzarello lazzarello

View GitHub Profile
@lazzarello
lazzarello / gist:4027073
Created November 6, 2012 19:54
csipsimple build error
-compile:
[javac] Compiling 247 source files to /home/twelvetone/src/CSipSimple/bin/classes
[javac] /home/twelvetone/src/CSipSimple/src/com/csipsimple/utils/CustomDistribution.java:73: package R does not exist
[javac] R.drawable.ic_wizard_ostn, 10,
[javac] ^
[javac] /home/twelvetone/src/CSipSimple/src/com/csipsimple/utils/CustomDistribution.java:74: cannot find symbol
[javac] symbol : class Locale
[javac] location: class com.csipsimple.utils.CustomDistribution
[javac] new Locale[]{ }, true, false,
[javac] ^
@lazzarello
lazzarello / gist:3914702
Created October 18, 2012 21:01
vars.xml
<include>
<!-- Preprocessor Variables
These are introduced when configuration strings must be consistent across modules.
NOTICE: YOU CAN NOT COMMENT OUT AN X-PRE-PROCESS line, Remove the line instead.
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
YOU SHOULD CHANGE THIS default_password value if you don't want to be subject to any
toll fraud in the future. It's your responsibility to secure your own system.
@lazzarello
lazzarello / gist:2726964
Created May 18, 2012 18:43
FS gateway XML
</gateway>
<gateway name="tanstagi.net">
<param name="username" value="xxxxx"/>
<param name="password" value="xxxxxxxxxxxx"/>
<param name="extension" value="Local_Extension"/>
<param name="register-transport" value="tls"/>
<param name="contact-params" value="transport=tls"/>
</gateway>
@lazzarello
lazzarello / gist:2314433
Created April 5, 2012 21:44
generate 64 character random string
cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 64
@lazzarello
lazzarello / gist:2076893
Created March 18, 2012 16:31
plaintext recovery from key reuse
#!/usr/bin/ruby
MESSAGES = [
"315c4eeaa8b5f8aaf9174145bf43e1784b8fa00dc71d885a804e5ee9fa40b16349c146fb778cdf2d3aff021dfff5b403b510d0d0455468aeb98622b137dae857553ccd8883a7bc37520e06e515d22c954eba5025b8cc57ee59418ce7dc6bc41556bdb36bbca3e8774301fbcaa3b83b220809560987815f65286764703de0f3d524400a19b159610b11ef3e",
"234c02ecbbfbafa3ed18510abd11fa724fcda2018a1a8342cf064bbde548b12b07df44ba7191d9606ef4081ffde5ad46a5069d9f7f543bedb9c861bf29c7e205132eda9382b0bc2c5c4b45f919cf3a9f1cb74151f6d551f4480c82b2cb24cc5b028aa76eb7b4ab24171ab3cdadb8356f",
"32510ba9a7b2bba9b8005d43a304b5714cc0bb0c8a34884dd91304b8ad40b62b07df44ba6e9d8a2368e51d04e0e7b207b70b9b8261112bacb6c866a232dfe257527dc29398f5f3251a0d47e503c66e935de81230b59b7afb5f41afa8d661cb",
"32510ba9aab2a8a4fd06414fb517b5605cc0aa0dc91a8908c2064ba8ad5ea06a029056f47a8ad3306ef5021eafe1ac01a81197847a5c68a1b78769a37bc8f4575432c198ccb4ef63590256e305cd3a9544ee4160ead45aef520489e7da7d835402bca670bda8eb775200b8dabbba246b130f040d8ec6447e2c767f3d30ed81ea2e4c1404e1315a1010e7229be6636aaa"
@lazzarello
lazzarello / build_insert_statement.rb
Created January 31, 2011 21:08
a generic insert statement builder that takes a table name, an array of keys and an array of values as arguments
def build_insert_statement(table,keys,values)
raise "keys must be an Array" unless keys.kind_of? Array
raise "values must be an Array" unless values.kind_of? Array
raise "table name must be a String" unless table.kind_of? String
statement = "INSERT INTO #{table}("
keys.each do |k|
statement << "#{k},"
end
statement.chop! << ") VALUES("
# ))<>(( huh huh
@lazzarello
lazzarello / alsa multi
Created December 16, 2010 02:44
take two 2 channel PCM streams as different hw devices and make them a single 4 channel stream
pcm.4chan {
type multi
slaves.a.pcm "hw:1,0"
slaves.a.channels 2
slaves.b.pcm "hw:1,1"
slaves.b.channels 2
bindings.0.slave a
bindings.0.channel 0
# do these do the same thing?
directory "/usr/local/src/swftools-0.9.1" do
action :delete
recursive true
only_if "test -d /usr/local/src/swftools-0.9.1"
end
directory "/usr/local/src/swftools-0.9.1" do
action :delete
[2010-05-05 20:39:54] [FixedTimeJob] Child spawned! pid: 21148, job record: 17688948
warning: peer certificate won't be verified in this SSL session
DEPRECATION WARNING: require "activesupport" is deprecated and will be removed in Rails 3. Use require "active_support" instead.. (called from /var/lib/gems/1.8/gems/activesupport-2.3.5/lib/activesupport.rb:2)
/usr/lib/ruby/1.8/net/http.rb:560:in `initialize': Connection refused - connect(2) (Errno::ECONNREFUSED)
from /usr/lib/ruby/1.8/net/http.rb:560:in `open'
from /usr/lib/ruby/1.8/net/http.rb:560:in `connect'
from /usr/lib/ruby/1.8/timeout.rb:53:in `timeout'
from /usr/lib/ruby/1.8/timeout.rb:93:in `timeout'
from /usr/lib/ruby/1.8/net/http.rb:560:in `connect'
from /usr/lib/ruby/1.8/net/http.rb:553:in `do_start'
total_memory = node[:memory][:total]
memory_size = Chef::Search::Query.new.search(:ec2_enums, "id:memory_size").flatten.first
if ( total_memory.to_i <= memory_size['small'].to_i )
set[:postgresql][:shmmax] = "33554432"
set[:postgresql][:shmall] = "2097152"
set[:postgresql][:shmmni] = "4096"
set[:postgresql][:max_connections] = "25"
set[:postgresql][:shared_buffers] = "35MB"
set[:postgresql][:work_mem] = "2MB"