Linux iad1-shared-b7-18 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
Apache
: 67.205.6.31 | : 216.73.216.47
Cant Read [ /etc/named.conf ]
8.2.29
fernandoquevedo
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
lib /
ruby /
vendor_ruby /
moneta /
adapters /
[ HOME SHELL ]
Name
Size
Permission
Action
memcached
[ DIR ]
drwxr-xr-x
mongo
[ DIR ]
drwxr-xr-x
activerecord.rb
4.47
KB
-rw-r--r--
cassandra.rb
3.37
KB
-rw-r--r--
client.rb
2.05
KB
-rw-r--r--
cookie.rb
967
B
-rw-r--r--
couch.rb
3.85
KB
-rw-r--r--
datamapper.rb
2.34
KB
-rw-r--r--
daybreak.rb
1.17
KB
-rw-r--r--
dbm.rb
615
B
-rw-r--r--
file.rb
3.18
KB
-rw-r--r--
fog.rb
1.54
KB
-rw-r--r--
gdbm.rb
606
B
-rw-r--r--
hbase.rb
3.06
KB
-rw-r--r--
leveldb.rb
929
B
-rw-r--r--
lmdb.rb
2.17
KB
-rw-r--r--
localmemcache.rb
766
B
-rw-r--r--
lruhash.rb
2.69
KB
-rw-r--r--
memcached.rb
385
B
-rw-r--r--
memory.rb
450
B
-rw-r--r--
mongo.rb
225
B
-rw-r--r--
null.rb
668
B
-rw-r--r--
pstore.rb
1.97
KB
-rw-r--r--
redis.rb
2.35
KB
-rw-r--r--
restclient.rb
1.31
KB
-rw-r--r--
riak.rb
1.69
KB
-rw-r--r--
sdbm.rb
606
B
-rw-r--r--
sequel.rb
3.74
KB
-rw-r--r--
sqlite.rb
2.68
KB
-rw-r--r--
tdb.rb
609
B
-rw-r--r--
tokyocabinet.rb
1.38
KB
-rw-r--r--
tokyotyrant.rb
3.24
KB
-rw-r--r--
yaml.rb
238
B
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : activerecord.rb
require 'active_record' require 'thread' module Moneta module Adapters # ActiveRecord as key/value stores # @api public class ActiveRecord include Defaults supports :create, :increment attr_reader :table @table_mutex = ::Mutex.new @table_refcount = {} class << self def release(table) @table_mutex.synchronize do if (@table_refcount[table] -= 1) <= 0 remove_const(table.name.sub(/^.*::/, '')) @table_refcount.delete(table) end end end def get(options) name = 'Table_' << options.inspect.gsub(/[^\w]+/) do $&.unpack('H2' * $&.bytesize).join.upcase end @table_mutex.synchronize do table = if const_defined?(name) const_get(name) else create(name, options) end @table_refcount[table] ||= 0 @table_refcount[table] += 1 table end end private def create(name, options) table = Class.new(::ActiveRecord::Base) const_set(name, table) table.table_name = options[:table] || 'moneta' table.primary_key = :k if options[:connection] begin table.establish_connection(options[:connection]) rescue tries ||= 0 (tries += 1) < 3 ? retry : raise end end table.connection_pool.with_connection do |conn| unless table.table_exists? conn.create_table(table.table_name, id: false) do |t| # Do not use binary key (Issue #17) t.string :k, null: false t.binary :v end conn.add_index(table.table_name, :k, unique: true) end end table rescue remove_const(name) raise end end # @param [Hash] options # @option options [String] :table ('moneta') Table name # @option options [Hash] :connection ActiveRecord connection configuration def initialize(options = {}) @table = self.class.get(options) end # (see Proxy#key?) def key?(key, options = {}) @table.connection_pool.with_connection do !@table.where(k: key).empty? end end # (see Proxy#load) def load(key, options = {}) @table.connection_pool.with_connection do record = @table.select(:v).where(k: key).first record && record.v end end # (see Proxy#store) def store(key, value, options = {}) @table.connection_pool.with_connection do record = @table.select(:k).where(k: key).first_or_initialize record.v = value record.save value end rescue tries ||= 0 (tries += 1) < 10 ? retry : raise end # (see Proxy#delete) def delete(key, options = {}) @table.connection_pool.with_connection do if record = @table.where(k: key).first record.destroy record.v end end end # (see Proxy#increment) def increment(key, amount = 1, options = {}) @table.connection_pool.with_connection do @table.transaction do if record = @table.where(k: key).lock.first value = Utils.to_int(record.v) + amount record.v = value.to_s record.save value elsif create(key, amount.to_s, options) amount else raise 'Concurrent modification' end end end rescue tries ||= 0 (tries += 1) < 10 ? retry : raise end # (see Proxy#create) def create(key, value, options = {}) @table.connection_pool.with_connection do record = @table.new record.k = key record.v = value record.save true end rescue # FIXME: This catches too many errors # it should only catch a not-unique-exception false end # (see Proxy#clear) def clear(options = {}) @table.connection_pool.with_connection do @table.delete_all end self end # (see Proxy#close) def close self.class.release(@table) @table = nil end end end end
Close