xanthus 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +30 -13
- data/bin/xanthus +5 -5
- data/lib/xanthus/dataverse.rb +2 -2
- data/lib/xanthus/job.rb +1 -0
- data/lib/xanthus/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b68bca4da63a675d577927075d1e8fa1564a20d57fe14e00d83a541e6b6eb933
|
4
|
+
data.tar.gz: f402f3eeffeab33da922c72b21192ebac5699cd484e6aadcebcf8646acb8bf37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 044b3da1fde72d38abb7ca6c864545ff6d18cd132ebcf283b1851f5ea30f94279083374e598020030aa241a2e8c4c737d17d1a9e443fe9a93d22531ba5e2e9a4
|
7
|
+
data.tar.gz: e1fd0f315b26ecffa1a00dcc92665e49764bfc83b89cc3122033ca24fbb3f6ef6435e89d4fee1d212256169945775cfd99091f1457334171d3b14e02ef10642e
|
data/README.md
CHANGED
@@ -181,12 +181,6 @@ The user must provide such a script.
|
|
181
181
|
In our case, we automatically generate attack scripts using `wget-attack-script-gen.py`.
|
182
182
|
`Xanthus` allows users to provide logic to generate scripts or simply provide scripts to run during the experiment.
|
183
183
|
|
184
|
-
## Xanthus
|
185
|
-
|
186
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/xanthus`. To experiment with that code, run `bin/console` for an interactive prompt.
|
187
|
-
|
188
|
-
TODO: Delete this and the text above, and describe your gem
|
189
|
-
|
190
184
|
### Installation
|
191
185
|
|
192
186
|
Add this line to your application's Gemfile:
|
@@ -205,18 +199,41 @@ Or install it yourself as:
|
|
205
199
|
|
206
200
|
### Usage
|
207
201
|
|
208
|
-
|
202
|
+
```
|
203
|
+
xanthus version | return Xanthus version number.
|
204
|
+
xanthus dependencies | installation instructions for system dependencies.
|
205
|
+
xanthus init <project name> | initialize a new project.
|
206
|
+
xanthus run | run .xanthus file in the current folder.
|
207
|
+
```
|
209
208
|
|
210
209
|
### Development
|
211
210
|
|
212
|
-
|
213
|
-
|
214
|
-
|
211
|
+
To add more features in `Xanthus`,
|
212
|
+
clone this repository
|
213
|
+
```
|
214
|
+
git clone https://github.com/tfjmp/xanthus
|
215
|
+
cd xanthus
|
216
|
+
```
|
217
|
+
and build the gem by running
|
218
|
+
```
|
219
|
+
gem build xanthus
|
220
|
+
```
|
221
|
+
To install this gem locally on your machine, you can also run
|
222
|
+
```
|
223
|
+
gem install xanthus
|
224
|
+
```
|
225
|
+
After you add a new feature (and test it yourself), you can release a new version of `Xanthus`.
|
226
|
+
First, please update the version number in `lib/xanthus/version.rb`, tag the repository `git tag -a x.x.x -m 'x.x.x'`, and push the tag `git push --tags`.
|
227
|
+
Then you can run
|
228
|
+
```
|
229
|
+
gem push xanthus-x.x.x.gem
|
230
|
+
```
|
231
|
+
This last step publishes the gem at [https://rubygems.org/gems/xanthus](https://rubygems.org/gems/xanthus).
|
215
232
|
|
216
|
-
###
|
233
|
+
### Contribution
|
217
234
|
|
218
|
-
|
235
|
+
We welcome bug reports and pull requests on GitHub at https://github.com/[USERNAME]/xanthus.
|
219
236
|
|
220
237
|
### License
|
221
238
|
|
222
|
-
|
239
|
+
This gem is available as an open source project under the [MIT License](https://opensource.org/licenses/MIT).
|
data/bin/xanthus
CHANGED
@@ -12,12 +12,12 @@ elsif (instruction == 'init' && !param1.nil?)
|
|
12
12
|
elsif (instruction == 'run')
|
13
13
|
load('./.xanthus')
|
14
14
|
elsif (instruction == 'help')
|
15
|
-
puts 'xanthus version | return version number.'
|
16
|
-
puts 'xanthus
|
17
|
-
puts 'xanthus init <project name> |
|
18
|
-
puts 'xanthus run | run .xanthus file
|
15
|
+
puts 'xanthus version | return Xanthus version number.'
|
16
|
+
puts 'xanthus dependencies | installation instructions for system dependencies.'
|
17
|
+
puts 'xanthus init <project name> | initialize a new project.'
|
18
|
+
puts 'xanthus run | run .xanthus file in the current folder.'
|
19
19
|
elsif (instruction == 'dependencies')
|
20
|
-
puts 'You need to install the following software on your system for
|
20
|
+
puts 'You need to install the following software on your system for Xanthus to run:'
|
21
21
|
puts 'git (see https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)'
|
22
22
|
puts 'git lfs (see https://help.github.com/en/articles/installing-git-large-file-storage)'
|
23
23
|
puts 'virtualbox (see https://www.virtualbox.org/wiki/Downloads)'
|
data/lib/xanthus/dataverse.rb
CHANGED
@@ -117,7 +117,7 @@ json = %Q{
|
|
117
117
|
f.write(self.dataset_json)
|
118
118
|
end
|
119
119
|
puts "Creating dataverse #{@dataset_name} in #{@repo} at #{@server}..."
|
120
|
-
output = `curl -H X-Dataverse-key:#{@token} -X POST #{@server}/api/dataverses/#{@repo}/datasets --upload-file dataset.json`
|
120
|
+
output = `curl --speed-time 15 --speed-limit 1000 --retry 50 --retry-max-time 0 -H X-Dataverse-key:#{@token} -X POST #{@server}/api/dataverses/#{@repo}/datasets --upload-file dataset.json`
|
121
121
|
puts output # needed to escape curl output
|
122
122
|
parsed = JSON.parse(output)
|
123
123
|
@doi = parsed['data']['persistentId']
|
@@ -146,7 +146,7 @@ json = %Q{
|
|
146
146
|
end
|
147
147
|
|
148
148
|
def add_file_to_dataverse name, description, folder
|
149
|
-
output = `curl -H X-Dataverse-key:#{@token} -X POST -F "file=@#{name}" -F 'jsonData={"description":"#{description}","directoryLabel":"#{folder}","categories":["Data"], "restrict":"false"}' "#{@server}/api/datasets/:persistentId/add?persistentId=#{@doi}"`
|
149
|
+
output = `curl --speed-time 15 --speed-limit 1000 --retry 50 --retry-max-time 0 -H X-Dataverse-key:#{@token} -X POST -F "file=@#{name}" -F 'jsonData={"description":"#{description}","directoryLabel":"#{folder}","categories":["Data"], "restrict":"false"}' "#{@server}/api/datasets/:persistentId/add?persistentId=#{@doi}"`
|
150
150
|
puts output
|
151
151
|
end
|
152
152
|
|
data/lib/xanthus/job.rb
CHANGED
@@ -45,6 +45,7 @@ module Xanthus
|
|
45
45
|
File.open('provision.sh', 'w+') do |f|
|
46
46
|
f.write(script)
|
47
47
|
end
|
48
|
+
script = 'echo "nothing to do"'
|
48
49
|
script = self.output_script(machine, @outputs[machine]) unless @outputs[machine].nil?
|
49
50
|
File.open('before_halt.sh', 'w+') do |f|
|
50
51
|
f.write(script)
|
data/lib/xanthus/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xanthus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Pasquier
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-04-
|
12
|
+
date: 2020-04-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|