Skip to content

Instantly share code, notes, and snippets.

@THUFIR
THUFIR / gist:2180843
Created March 24, 2012 10:10
log gwene
thufir@dur:~$
thufir@dur:~$
thufir@dur:~$
thufir@dur:~$
thufir@dur:~$
thufir@dur:~$
thufir@dur:~$
thufir@dur:~$
thufir@dur:~$
thufir@dur:~$
@THUFIR
THUFIR / gist:2183195
Created March 24, 2012 13:59
telnet nntp
thufir@dur:~$
thufir@dur:~$ telnet foo.net nntp
Trying 69.16.185.250...
Connected to bar.com.
Escape character is '^]'.
200 Welcome to Baz News Service
group comp.lang.ruby
211 291034 59802 350835 comp.lang.ruby
next
223 59803 <1110475485.063688.123780@o13g2000cwo.googlegroups.com>
@THUFIR
THUFIR / gist:2183658
Created March 24, 2012 14:40
ruby google reader
thufir@dur:~/ruby/reader$
thufir@dur:~/ruby/reader$ ruby reader.rb
[1]+ Stopped ruby reader.rb
thufir@dur:~/ruby/reader$ reader.rb:14:in `<main>': uninitialized constant Google (NameError)
[1]+ Exit 1 ruby reader.rb
thufir@dur:~/ruby/reader$
thufir@dur:~/ruby/reader$ cat reader.rb
require 'rubygems'
thufir@dur:~$
thufir@dur:~$ sudo echo "hostname wrong"
sudo: unable to resolve host dur
hostname wrong
thufir@dur:~$
thufir@dur:~$ cat /etc/hostname
dur
thufir@dur:~$
thufir@dur:~$ cat /etc/hosts
127.0.0.1 localhost
@THUFIR
THUFIR / gist:2192219
Created March 25, 2012 07:51
libruby-nntp
thufir@dur:~$
thufir@dur:~$ type rvm | head -1
rvm is a function
thufir@dur:~$
thufir@dur:~$ rvm --version
rvm 1.10.3 by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.beginrescueend.com/]
thufir@dur:~$
thufir@dur:~$ ruby --version
@THUFIR
THUFIR / gist:2192333
Created March 25, 2012 08:09
ruby-net-nntp
thufir@dur:~/ruby/nntp$
thufir@dur:~/ruby/nntp$ ruby nntp.rb
/home/thufir/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': iconv will be deprecated in the future, use String#encode instead.
nntp..
host...
#<Net::NNTP:0x90d66ec>
/home/thufir/.rvm/gems/ruby-1.9.3-p125/gems/ruby-net-nntp-1.0.0/lib/net/nntp.rb:30:in `logger': uninitialized class variable @@logger in Net::NNTP (NameError)
from /home/thufir/.rvm/gems/ruby-1.9.3-p125/gems/ruby-net-nntp-1.0.0/lib/net/nntp.rb:35:in `debug'
from /home/thufir/.rvm/gems/ruby-1.9.3-p125/gems/ruby-net-nntp-1.0.0/lib/net/nntp.rb:95:in `read_response'
from /home/thufir/.rvm/gems/ruby-1.9.3-p125/gems/ruby-net-nntp-1.0.0/lib/net/nntp.rb:73:in `connect'
@THUFIR
THUFIR / gist:2197677
Created March 25, 2012 15:48
ant telnetd
thufir@dur:~/NetBeansProjects/telnetd-1.0$
thufir@dur:~/NetBeansProjects/telnetd-1.0$
thufir@dur:~/NetBeansProjects/telnetd-1.0$
thufir@dur:~/NetBeansProjects/telnetd-1.0$
thufir@dur:~/NetBeansProjects/telnetd-1.0$
thufir@dur:~/NetBeansProjects/telnetd-1.0$ java -version
java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b04)
Java HotSpot(TM) Client VM (build 22.1-b02, mixed mode)
thufir@dur:~/NetBeansProjects/telnetd-1.0$
@THUFIR
THUFIR / gist:2198265
Created March 25, 2012 16:57
net/telnet
thufir@dur:~/ruby/net_telnet$
thufir@dur:~/ruby/net_telnet$
thufir@dur:~/ruby/net_telnet$ ruby net.rb
trying to connect...
...connected
^C/home/thufir/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/net/telnet.rb:557:in `select': Interrupt
from /home/thufir/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/net/telnet.rb:557:in `waitfor'
from /home/thufir/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/net/telnet.rb:697:in `cmd'
from net.rb:12:in `<main>'
emails = []
File.open("/var/spool/news/alt/test/9").each do |line|
puts line
emails.push(line.scan(/<(.*?)>/).flatten)
end
puts "*"*80
puts emails
class Header
attr_accessor :id
end
header = Header.new
File.open("/var/spool/news/alt/test/9").each do |line|
puts line
case line
when (/^\s*Message-ID:/)
puts "message"