Skip to content

Instantly share code, notes, and snippets.

Questions are not from any actual exam!!!
Q: Create a job that calculates pi to 2000 decimal points using the container with the image named perl
and the following commands issued to the container: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
Once the job has completed, check the logs to and export the result to pi-result.txt.
Solution:
@shitana
shitana / generate_toc.rb
Created February 17, 2019 20:24 — forked from albertodebortoli/generate_toc.rb
Generate Markdown TOC
#!/usr/bin/env ruby
File.open("your_file.md", 'r') do |f|
f.each_line do |line|
forbidden_words = ['Table of contents', 'define', 'pragma']
next if !line.start_with?("#") || forbidden_words.any? { |w| line =~ /#{w}/ }
title = line.gsub("#", "").strip
href = title.gsub(" ", "-").downcase
puts " " * (line.count("#")-1) + "* [#{title}](\##{href})"
@shitana
shitana / cRecurseFtp.py
Last active August 31, 2016 16:09 — forked from flibbertigibbet/recurse_ftp.py
Recursively fetch files from an FTP server directory. Here, it's downloading all the zip files found in or beneath the parent directory.
#!/usr/bin/env python
from ftplib import FTP
import os
class cRecursive:
my_dirs = [] # global
my_files = [] # global
all_dirs = [] # global
curdir = '' # global