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
# GIST: "pw_from_console.rb" under "https://gist.github.com/drhuffman12" | |
# If you're dealing with a Java character array (such as password characters that you read from the console), you can convert it to a JRuby string with the following Ruby code: | |
jconsole = Java::java.lang.System.console() | |
password = jconsole.readPassword() | |
ruby_string = '' | |
password.to_a.each {|c| ruby_string << c.chr} | |
# .. do something with 'password' variable .. | |
puts "password_chars: #{password_chars.inspect}" |
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
# Official site for the Ruby language: "https://www.ruby-lang.org/" | |
class C1 | |
attr :a, :b | |
def initialize(a) | |
@a = a | |
end | |
def self.hi | |
puts 'hello world' |
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/ruby | |
# FILENAME: av_splitter.rb | |
# | |
# DESCRIPTION: Convert and split an audio/video file into 5 minute intervals of the specified target format and compression quality. | |
# | |
# USAGE: | |
# Put your audio/video files into the "in" sub-folder, then run the 'audio_splitter.rb' ruby script w/syntax: | |
# ruby -s audio_splitter.rb <format_out> '<bit_rate_info>' <debug_level> | |
# |
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
# Download Oracle Jdk 8 for Linux 32bit from:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-arm-downloads-2187472.html | |
# ... The download should be a file like: jdk-8u33-linux-arm-vfp-hflt.tar.gz | |
# Download JRuby from: http://www.jruby.org/download | |
# ... The download should be a file like: jruby-bin-1.7.18.tar.gz, jruby-bin-9.0.0.0.pre1.tar.gz | |
# Install 'GNURoot' and 'GNURoot Wheezy x86' from app store, see: | |
# [gnuroot app](https://play.google.com/store/apps/details?id=champion.gnuroot&hl=en) | |
# [gnuroot repo](https://github.com/corbinlc) | |
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
# | |
apt-get update | apt-get upgrade | |
# Install ant and dependancies. [Ignore errors about "libjli.so" missing; it appears to be a soft vs hard float java issue. We will replace Java in a later step.] | |
apt-get install ant -y | |
# Download Oracle Jdk 8 for Linux 32bit from: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html | |
# ... The download should be a file like: jdk-8u20-linux-i586.tar.gz |
NewerOlder