There are five types:
- Dummy
- Stub
- Spy
- Mock
- Fake
package com.boohoo.esbdefused.metrics; | |
import java.util.Arrays; | |
import java.util.concurrent.TimeUnit; | |
import com.codahale.metrics.Counter; | |
import com.codahale.metrics.Gauge; | |
import com.codahale.metrics.Histogram; | |
import com.codahale.metrics.Meter; | |
import com.codahale.metrics.MetricRegistry; |
ArrayList<String> list = new ArrayList<>(); | |
String configs = params.getConfigurationIds(); // TODO: CSV list payload | |
if (configs != null && !configs.trim().isEmpty()) { // TODO: compare with call to StringValidator.isEmptyString() at line 5 | |
// split the list and put all items into the list | |
if (!StringValidator.isEmptyString(configs)) { // TODO: method body like: string == null || string.trim().isEmpty() | |
String[] feld = configs.split(","); | |
if (feld != null) { | |
if (feld.length > 0) { | |
for (String dummy : feld) { | |
String tmp = dummy.trim(); |
<?php | |
// Context: I'm trying to argue that DI (and DIC) are great, and DIC libs suck. | |
// Happy to be proven wrong! | |
final class Router { | |
private $dependencies; | |
public function __construct (Dependencies $dependencies) { | |
$this->dependencies = $dependencies; | |
// You might say that this is Service Locator, but it's not. This router is toplevel, | |
// and toplevel must have access to dependencies. After that it can all just bubble nicely using proper DI. |
#!/bin/sh | |
# Use socat to proxy git through an HTTP CONNECT firewall. | |
# Useful if you are trying to clone git:// from inside a company. | |
# Requires that the proxy allows CONNECT to port 9418. | |
# | |
# Save this file as gitproxy somewhere in your path (e.g., ~/bin) and then run | |
# chmod +x gitproxy | |
# git config --global core.gitproxy gitproxy | |
# | |
# More details at http://tinyurl.com/8xvpny |
chrome://ublock0/content/dashboard.html
trello.com###board .sticker
alias g10psn='glances --time 10 --process-short-name' | |
#alias vmpm="VBoxManage showvminfo $(cat .vagrant/machines/$(vagrant status | sed -n 3p | awk '{print $1}')/virtualbox/id) | grep ^NIC | grep 'host port'" | |
alias vmpm='vname=`vagrant status | awk "NR==3 {print \\$1}"`; vid=`cat .vagrant/machines/\$vname/virtualbox/id`; VBoxManage showvminfo $vid | grep "^NIC.*host port"' |
; Spawn fcgiwrap as the user owning the git repositories, with a socket writeable by nginx | |
[fcgi-program:fcgiwrap_gitolite] | |
command = /usr/sbin/fcgiwrap | |
user = gitolite | |
socket = unix:///var/run/supervisor/%(program_name)s.sock | |
socket_owner = gitolite:nginx | |
socket_mode = 0770 |
echo "Probing SSH Servers for updating known_hosts file..." | |
SERVER_LIST=(server1.example.org server2.example.org) | |
for h in ${SERVER_LIST[*]}; do | |
ip=$(dig +short $h) | |
echo "Update known_hosts for ${h} with IP ${ip}" | |
ssh-keygen -R $h -f /home/vagrant/.ssh/known_hosts |
1. Change root password after server provision | |
2. Create unprivileged user | |
3. Create SSH key pair on client machine and ssh-copy-id to user | |
4. Adjust /etc/ssh/sshd_config: | |
PermitRootLogin no | |
PubkeyAuthentication yes | |
AllowUsers %user% | |
PasswordAuthentication no | |
TCPKeepAlive no | |
UsePAM no |