devops_system_util_profiler 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 21824b8e4dc12c3aa639e67f19d1278d3326a272a55a8599cc957da4cf1de354
4
+ data.tar.gz: ba5900dfc7afe19feb1bdec1fce0d5606f4941ef2688cb284543b78ce665a487
5
+ SHA512:
6
+ metadata.gz: 6d82b401acd4abfca87d9b332164d3a7ebd181ca295a785546cd23f8d43ae19f5f39ce318aae3cb66e842899c2abf1b8240e63a3c4aae10ef99ede9083e08dad
7
+ data.tar.gz: 0fb5545f9741bbda36958c4aa7f3138fbaa846e6488f63e746c93fafb7da3056578b43243e6e686514e32832257bcee8547e23d2af29fd1a15a02649c795bf14
@@ -0,0 +1,54 @@
1
+ class DevopsSystemUtil
2
+ def initialize(dir_path, backup_dir_path, file_extension)
3
+ @dir_path = dir_path
4
+ @backup_dir = backup_dir_path
5
+ @extension = file_extension
6
+ end
7
+ def geneatepath
8
+ dir_storage = Dir.open(@dir_path)
9
+ dir_path = @backup_dir.to_s
10
+ file_storage_copy = dir_storage.each{|each| \
11
+ puts "cp -r " + each + " " + dir_path + "/" + "backup" + each \
12
+ if each.end_with?(@extension)}
13
+ file_storage_move = dir_storage.each{|each| \
14
+ puts "mv " + each + " " + dir_path + " " + "backup" + each \
15
+ if each.end_with?(@extension)}
16
+ return file_storage_copy, file_storage_move
17
+ end
18
+ def getsystemInfo
19
+ return `uname -a`.to_s
20
+ end
21
+ def memory
22
+ return `memory_pressure`.split("\n")
23
+ end
24
+ def user
25
+ return `whoami`.to_s
26
+ end
27
+ def changepermission(directory_path)
28
+ @directory = directory_path
29
+ exec("sudo chown -R $(whoami) @directory")
30
+ end
31
+ def checksystemversion
32
+ return `sh --version`
33
+ end
34
+ def directorycheck
35
+ return `ls -la`.split("\n")
36
+ end
37
+ def filesearch(dir_path,file_extension)
38
+ @dir = Dir.open(dir_path)
39
+ @file_ext = file_extension
40
+ file_list = Array.new()
41
+ @dir.each{|each| file_list.push(each) if each.end_with?(@file_ext)}
42
+ return file_list
43
+ end
44
+ def generate_push_ssh(dir_path, file_extension, remote_server, remote_address)
45
+ dir_string = dir_path
46
+ @dir = Dir.open(dir_path)
47
+ @file = file_extension
48
+ @remote = remote_server
49
+ @remote_add = remote_address
50
+ generating_path = Array.new()
51
+ @dir.each{|each| generating_path.push(dir_string + each) if each.end_with?(@file)}
52
+ generating_path.map{ |n| "scp -r" + " " + n + " " + @remote + ":" + @remote_add}.each{ |each| puts each}
53
+ end
54
+ end
metadata ADDED
@@ -0,0 +1,45 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: devops_system_util_profiler
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Gaurav Sablok
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-09-02 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description:
14
+ email:
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/devops_system_util_profiler.rb
20
+ homepage: https://github.com/sablokgaurav/devops_system_util_profiler
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubygems_version: 3.4.19
40
+ signing_key:
41
+ specification_version: 4
42
+ summary: devops system utility profiler for bioinformatics that does all the task
43
+ required in the bioinformatics such as moving files, finding files, generating
44
+ ssh and everything
45
+ test_files: []