Install cfssl
# This requires an existing Go environment with GOPATH set
go get -u github.com/cloudflare/cfssl/cmd/...
{ | |
"global": { | |
"check_for_updates_on_startup": true, | |
"show_in_menu_bar": true, | |
"show_profile_name_in_menu_bar": false | |
}, | |
"profiles": [ | |
{ | |
"complex_modifications": { | |
"parameters": { |
apiVersion: extensions/v1beta1 | |
kind: PodSecurityPolicy | |
metadata: | |
name: restricted | |
annotations: | |
seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default' | |
apparmor.security.beta.kubernetes.io/allowedProfileNames: 'runtime/default' | |
seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default' | |
apparmor.security.beta.kubernetes.io/defaultProfileName: 'runtime/default' | |
spec: |
When developing a program in Ruby, you may sometimes encounter a memory leak. For a while now, Ruby has a facility to gather information about what objects are laying around: ObjectSpace.
There are several approaches one can take to debug a leak. This discusses a time-based approach, where a full memory dump is generated every, say, 5 minutes, during a time that the memory leak is showing up. Afterwards, one can look at all the objects, and find out which ones are staying around, causing the
#!/bin/bash | |
# | |
# Author: Sameer Naik <[email protected]> | |
# Gist: https://gist.github.com/sameersbn/dd24dfdd13bc472d11a5 | |
# Short Url (raw): http://goo.gl/iJcvCP | |
# | |
# Installs a bunch of plugins for the docker-redmine image | |
# | |
# Usage: | |
# $ mkdir -p /opt/redmine/data/plugins |
config.middleware.insert_before ActionDispatch::ParamsParser, ::Rack::Robustness do |g| | |
g.no_catch_all | |
# you might need to replace this with JSON::ParserError, depending on your Rails configuration | |
# or you can catch both... | |
g.on(MultiJson::ParseError) { |ex| 400 } | |
g.content_type 'text/plain' | |
g.body{ |ex| ex.message } | |
g.ensure(true) do |ex| | |
env['rack.errors'].write(ex.message) | |
logger.warn(ex.message) |
events { | |
worker_connections 1024; | |
} | |
http { | |
default_type text/html; | |
access_log /dev/stdout; | |
sendfile on; | |
keepalive_timeout 65; |
RSpec.configure do |config| | |
config.before(:suite) do | |
DatabaseCleaner.clean_with(:truncation) | |
end | |
config.before(:each) do | |
DatabaseCleaner.strategy = :transaction | |
end | |
config.before(:each, js: true) do |
Введение
Начать стоит отсюда. Не пугайтесь то, что это книга по незнакомой OS, эти термины практически везде одинаковые и здесь они изложены в понятной для начинающих форме.
http://www.qnx.com/developers/docs/6.4.1/neutrino/getting_started/s1_procs.html
Прочесть нужно треть главы до подраздела "Starting a process", если С не пугает, читайте полностью. После прочтения вы будете понимать, что такое process, thread, mutex, priorites, semaphores, scheduler, contex-switch, kernel states.
Ruby
#!/usr/bin/env sh | |
brew update | |
# upgrade any that were already installed | |
brew upgrade rbenv ruby-build readline openssl | |
# install what's missing | |
brew install rbenv ruby-build readline openssl |