DevOps Curriculum

...Ruby: Get started with the greatest programming language made for humans. Note that chapters 16 (RDoc), 23 (Multi Threading) and everything after chapter 27 is irrelevant for now References

...lines and paragraphs, and outputs the result. For example: $ ruby count_words.rb test.txt test.txt has 123 words test.txt has 13 lines test.txt has 4 paragraphs Hint Find out about ARGV.

atlassian.com

...before="2014-7-4" You can use references like "2 years 1 day 3 minutes ago" and "yesterday": git log --after="yesterday...

...go to File → Settings → Appearance and set the "Zoom" option to your liking, e.g. 150%. Everything (UI elements, UI font, editor fonts) should be scaled accordingly. Scaling everything manually (classic...

You can configure RubyMine to manually scale everything. 1. Increase UI size Navigate to Help → Custom VM Options. A file will open. Here, simply add the ide.ui.scale option with...

...rendering and DB query durations Good for spotting problematic endpoints The "Recent requests" screen (1 hour history) Shows individual requests Provides the full list of DB queries per request, color...

makandra Operations

...member list | awk -F ', ' -v member="$member" '{ if ( member == $3 ){ system("etcdctl member remove " $1); system("etcdctl member add " $3 " --peer-urls=" $4); } }' On the faulty node again

techblog.netflix.com

...performance issue: what do you check in the first minute? uptime dmesg | tail vmstat 1 mpstat -P ALL 1 pidstat 1 iostat -xz 1 free -m

...sar -n TCP,ETCP 1 top Also see: How to get a rough picture about a Rails project How to examine an unknown Ruby object

...rename the class and change the column details to fit your purpose. Run it. 1) Deliver attachments through Rails The first way is to store your Carrierwave attachments not in...

...SHA512.hexdigest("--#{Rails.env}--#{model_class_name}--#{model.id}--#{mounted_as}--#{secret}--") # 4 bit per character, so 128 bit for the full hash. Check if still appropriate! hash.slice(0, 32) end end

...the Internet is sparse and not even the Geniuses at the Genius Bar are 100% sure. We found out some things and can explain the backgrounds. tl;dr: when using...

...is only possible with workarounds. Docking stations Whenever you're considering using more than 1 external display, it makes sense to consider using a Docking Station for your Laptop of...

developer.mozilla.org

...of my favorites: console.log takes many arguments E.g. console.log("Current string:", string, "Current number:", 12) Your output can have hyperlinks to Javascript objects E.g. console.log("Check out the current %o...

...of objects) to console.table(). Example: console.table(["apples", "oranges", "bananas"]) prints: (index) Values 0 "apples" 1 "oranges" 2 "bananas" Grouping output in nested, collapsible sections Great for debugging deeply nested or...

it "doesn't use logical negation for include, exhibit A" do expect([1, 2, 3]).to include(3, 4, 5) end it "doesn't use logical negation for...

...include, exhibit B" do expect([1, 2, 3]).not_to include(3, 4, 5) end end Exhibit A fails with: expected [1, 2, 3] to include 4 and 5

...simple as a tuple of start and end state. const keyframes = [ { opacity: 0 }, { opacity: 1 }, ] const animation = element.animate(keyframes, { duration: 1000 }) After the animation has finished, the animation keyframes will...

...that allows you to wait for animations to finish. const animation = element.animate(keyframes, { duration: 1000 }) await animation.finished alert('animation finished!') Side note: When animations are cancelled, the promise is rejected...

In modern Rails versions you can also use ActiveRecord's pluck method. User.active.pluck(:id) => [1, 5, 23, 42] If you are plucking from the id column in particular you can...

User.active.ids => [1, 5, 23, 42] For a DISTINCT selection, use distinct on your scope (not the resulting array). Article.distinct.pluck(:state) # SELECT DISTINCT state FROM articles => ['draft', 'published']

...Use RAILS_ROOT as a placeholder for the remote Rails root directory. # * Append ` || test $? =1;` to grep calls in order to avoid exit code 1 (= "nothing found") # * To be able...

Example Compound selectors like ... .datepicker .prev, .datepicker .next, .datepicker .switch padding-bottom: 1rem ul li, ol li list-style-type: none can be simplified by using the :where...

...pseudo selector ... .datepicker :where(.prev, .next, .switch) padding-bottom: 1rem :where(ul, ol) li list-style-type: none Hint The specificity of :where() is always zero! If you need or...

ü ↔ ü However, they are not the same: 'ä' == 'ä' # false 'ä'.size # 1 'ä'.size # 2 Looking at how those strings are constructed reveals what is going on...

labs.bishopfox.com

irb(main):001:0> require 'json' => true irb(main):002:0> JSON.parse('{"qty": 1, "qty": -1}') => {"qty"=>-1} Character Collision irb(main):009:0> JSON.parse('{"qty": 1, "qty\ud800...

...incomplete surrogate pair at 'qty\ud800": -1}') irb(main):007:0> JSON.parse('{"qty": 1, "qty"": -1}') JSON::ParserError (784: unexpected token at '{"qty": 1, "qty"": -1}') This one was unexpected...

makandra dev

...for the root user and you prefer using a password for root. Solution Step 1 is getting a root mysql shell that allows us to change user credentials. We need...

...MariaDB [mysql]> UPDATE user SET password='', plugin = 'unix_socket' WHERE user='root'; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 Re-read permissions

...the error message is too meaningless to be helpful. Example: Running with gitlab-runner 16.7.0 (102c81ba) on , system ID: Resolving secrets 00:00 Preparing the "shell" executor 00:00

00:01 Running on ... Getting source from Git repository 00:00 bash: line 157: /bin/mkdir: Argument list too long Cleaning up project directory and file based variables...

'instance_foo': api_port: 9200 content: 'index_patterns': ['foobar_*'] 'settings': 'number_of_shards': 1 'number_of_replicas': 0 Attention: This will replace all existing settings of the template. Make...

-H 'Content-Type: application/json' \ -d '{ "index_patterns": [ "foobar.*(" ], "settings": { "index": { "number_of_shards": 1, "number_of_replicas": 0 } } }' Cleanup Now you have fixed the issue for future indices matching...

makandra dev

...tagname.. for "everything after that tag" Example output for spreewald: 60 Tobias Kraze 12 Henning Koch 7 Dominik Schöler 6 Thomas Eisenbarth 5 Martin Straub 3 Minh Hemmer...

1 Manuel Kallenbach 1 Andreas Robecke Alternatives There is a powerful CLI tool called git who...

makandra dev
iamvdo.me

...For example, line-height can be set as a length or a unitless value 1, but the default is normal. OK, but what normal is? We often read that it...

...is (or should be) 1, or maybe 1.2, even the CSS spec is unclear on that point. We know that unitless line-height is font-size relative, but the problem...

github.com

...fly. It offers a #disasm method for further inspection. Destructuring Arrays In Blocks { key: [1,2] }.each { |key, (x, y)| puts "#{x}- #{y}" } Defaulting To Frozen String Literals

Pass A Block To Count count can be used like "count by": [1,2,3].count { |x| x.odd? } Parallel Bundle Install bundle install --jobs 4

...and want to migrate one of your Transforms, e.g. the "number" matcher from above. 1.: Create a new ParameterType based on your existing Transform to "parameter_types.rb" using the Proxy class...

...adds a Transform method to the Cucumber "World" which behaves similar to the Cucumber 1 and 2 transformations. This allows cucumber_factory to keep using your transformations.

...diff for merge requests. There are two options how you can address this: Option 1: exclude from diff Luckily gitlab comes with a solution for this. You can ignore files...