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.13
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 /
share /
doc /
ruby-zip /
examples /
[ HOME SHELL ]
Name
Size
Permission
Action
example.rb
2.6
KB
-rwxr-xr-x
example_filesystem.rb
925
B
-rwxr-xr-x
example_recursive.rb
1.56
KB
-rw-r--r--
gtk_ruby_zip.rb
2.14
KB
-rwxr-xr-x
qtzip.rb
1.91
KB
-rwxr-xr-x
write_simple.rb
170
B
-rwxr-xr-x
zipdialogui.ui
5.03
KB
-rw-r--r--
zipfind.rb
1.47
KB
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : example.rb
#!/usr/bin/env ruby $LOAD_PATH << '../lib' system('zip example.zip example.rb gtk_ruby_zip.rb') require 'zip' ####### Using ZipInputStream alone: ####### Zip::InputStream.open('example.zip') do |zis| entry = zis.get_next_entry print "First line of '#{entry.name} (#{entry.size} bytes): " puts "'#{zis.gets.chomp}'" entry = zis.get_next_entry print "First line of '#{entry.name} (#{entry.size} bytes): " puts "'#{zis.gets.chomp}'" end ####### Using ZipFile to read the directory of a zip file: ####### zf = Zip::File.new('example.zip') zf.each_with_index do |entry, index| puts "entry #{index} is #{entry.name}, size = #{entry.size}, compressed size = #{entry.compressed_size}" # use zf.get_input_stream(entry) to get a ZipInputStream for the entry # entry can be the ZipEntry object or any object which has a to_s method that # returns the name of the entry. end ####### Using ZipOutputStream to write a zip file: ####### Zip::OutputStream.open('exampleout.zip') do |zos| zos.put_next_entry('the first little entry') zos.puts 'Hello hello hello hello hello hello hello hello hello' zos.put_next_entry('the second little entry') zos.puts 'Hello again' # Use rubyzip or your zip client of choice to verify # the contents of exampleout.zip end ####### Using ZipFile to change a zip file: ####### Zip::File.open('exampleout.zip') do |zip_file| zip_file.add('thisFile.rb', 'example.rb') zip_file.rename('thisFile.rb', 'ILikeThisName.rb') zip_file.add('Again', 'example.rb') end # Lets check Zip::File.open('exampleout.zip') do |zip_file| puts "Changed zip file contains: #{zip_file.entries.join(', ')}" zip_file.remove('Again') puts "Without 'Again': #{zip_file.entries.join(', ')}" end ####### Using ZipFile to split a zip file: ####### # Creating large zip file for splitting Zip::OutputStream.open('large_zip_file.zip') do |zos| puts 'Creating zip file...' 10.times do |i| zos.put_next_entry("large_entry_#{i}.txt") zos.puts 'Hello' * 104_857_600 end end # Splitting created large zip file part_zips_count = Zip::File.split('large_zip_file.zip', 2_097_152, false) puts "Zip file splitted in #{part_zips_count} parts" # Track splitting an archive Zip::File.split('large_zip_file.zip', 1_048_576, true, 'part_zip_file') do |part_count, part_index, chunk_bytes, segment_bytes| puts "#{part_index} of #{part_count} part splitting: #{(chunk_bytes.to_f / segment_bytes * 100).to_i}%" end # For other examples, look at zip.rb and ziptest.rb # Copyright (C) 2002 Thomas Sondergaard # rubyzip is free software; you can redistribute it and/or # modify it under the terms of the ruby license.
Close