$63 GRAYBYTE WORDPRESS FILE MANAGER $97

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/cpanel/ea-ruby27/src/passenger-release-6.1.2/dev/

HOME
Current File : /opt/cpanel/ea-ruby27/src/passenger-release-6.1.2/dev//parse_file_descriptor_log
#!/usr/bin/env ruby
# Parses a file descriptor log as produced by Passenger,
# and display the file descriptors that are still open
# according to the log.

class ParserApp
  Agent = Struct.new(:name, :fds)
  Entry = Struct.new(:source, :purpose)

  def initialize(path)
    @io = File.open(path, "r")
    @agents = {}
  end

  def close
    @io.close
  end

  def analyze
    @lineno = 1
    while !@io.eof?
      line = @io.readline.strip
      pid, source, message = parse_line(line)

      case message
      when /^Starting agent: (.+)$/
        agent_name = $1
        if (old_pid = find_agent(agent_name))
          warn "#{agent_name} restarted"
          @agents.delete(old_pid)
        end
        @agents[pid] = Agent.new(agent_name, {})

      when /^File descriptor opened: (.+)/
        fd = $1.to_i
        if agent = @agents[pid]
          if agent.fds.has_key?(fd)
            warn "FD #{fd} already opened"
          end
          agent.fds[fd] = Entry.new(source)
        else
          warn "No agent information about #{pid}"
        end

      when /^File descriptor closed: (.+)/
        fd = $1.to_i
        if agent = @agents[pid]
          if agent.fds.has_key?(fd)
            agent.fds.delete(fd)
          else
            warn "FD #{fd} not opened"
          end
        else
          warn "No agent information about #{pid}"
        end

      when /^File descriptor purpose: (.+?): (.+)/
        fd = $1.to_i
        purpose = $2
        if agent = @agents[pid]
          if entry = agent.fds[fd]
            entry.purpose = purpose
          else
            warn "FD #{fd} not opened"
          end
        else
          warn "No agent information about #{pid}"
        end
      end

      @lineno += 1
    end
  rescue EOFError
  end

  def report
    @agents.each_pair do |pid, agent|
      puts
      puts "#{pid}: #{agent.name}"
      puts("-" * 80)
      agent.fds.keys.sort.each do |fd|
        entry = agent.fds[fd]
        printf "%-5d  %-30s  %s\n", fd, entry.source, entry.purpose
      end
    end
  end

private
  def parse_line(line)
    if line =~ /^\[ (.+?) \]: (.+)/
      info = $1
      message = $2
      fragments = info.split(" ")
      pid = fragments[2].sub(/\/.*/, '')
      source = fragments.last
      [pid, source, message]
    else
      nil
    end
  end

  def find_agent(name)
    @agents.each_pair do |pid, agent|
      if agent.name == name
        return pid
      end
    end
    nil
  end

  def warn(message)
    STDERR.puts "Warning:#{@lineno}: #{message}"
  end
end

app = ParserApp.new(ARGV[0])
app.analyze
app.report
app.close

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
16 Mar 2026 5.03 PM
root / root
0755
boost-patches
--
16 Mar 2026 5.03 PM
root / root
0755
ci
--
16 Mar 2026 5.03 PM
root / root
0755
configkit-schemas
--
16 Mar 2026 5.03 PM
root / root
0755
rack.test
--
16 Mar 2026 5.03 PM
root / root
0755
vagrant
--
16 Mar 2026 5.03 PM
root / root
0755
colorize-logs
7.288 KB
28 Jan 2026 6.50 AM
root / root
0755
copy_boost_headers
9.555 KB
28 Jan 2026 6.50 AM
root / root
0755
index_cxx_dependencies.rb
3.936 KB
28 Jan 2026 6.50 AM
root / root
0755
install_scripts_bootstrap_code.rb
1.308 KB
28 Jan 2026 6.50 AM
root / root
0755
list_tests
0.958 KB
28 Jan 2026 6.50 AM
root / root
0755
nginx_version_sha256
2.499 KB
28 Jan 2026 6.50 AM
root / root
0755
parse_file_descriptor_log
2.545 KB
28 Jan 2026 6.50 AM
root / root
0755
ruby_server.rb
6.174 KB
28 Jan 2026 6.50 AM
root / root
0755
runner
0.608 KB
28 Jan 2026 6.50 AM
root / root
0755
show-latest-crashlog-dir
0.766 KB
28 Jan 2026 6.50 AM
root / root
0755

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF