Skip to content

Instantly share code, notes, and snippets.

View php-coder's full-sized avatar

Slava Semushin php-coder

View GitHub Profile
@Test(dataProvider = "invalidEmails")
public void emailShouldBeValid(final String invalidEmail, final String expectedMessage) {
page.registerUser(invalidEmail);
assertThat(page).field("email").hasError(expectedMessage);
}
@DataProvider(name = "invalidEmails")
public Object[][] getInvalidEmails() {
final String expectedErrorMessage =
package com.mkyong.zip;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>2.0</version>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.21</version>
</dependency>
@php-coder
php-coder / AddSeriesIT.java
Last active December 12, 2015 04:08
DRY with URLs
driver.get("http://localhost/series/add");
Я согласен, что Perl и его однострочники могут быть удобны, но большинство примеров не очень удачны,
т.к. сделать тоже самое на shell-е может быть куда проще и при этом не нужно знать Perl и
помнить его ключи.
Например:
>cat file.csv | cut -d ';' -f 2 | grep -v afiskon
Легко упрощается до двух комманд:
#!/bin/sh
exec puppet apply --modulepath="$PWD/my/modules" --verbose my/manifests/site.pp "$@"
class my::server {
include my::server::user
include my::server::sudo
}
# Run 2 containters on different consoles:
# $ sudo /opt/rkt/rkt run docker://busybox --private-users --no-overlay --interactive
$ (ps aefjax | head -1; ps aefjax | grep '[/]sh')
PPID PID PGID SID TTY TPGID STAT UID TIME COMMAND
23864 23871 23871 23871 pts/3 23871 Ss+ 439681024 0:00 | \_ /bin/sh
23928 23935 23935 23935 pts/4 23935 Ss+ 1278803968 0:00 | \_ /bin/sh
# Stop containers and run them again
@php-coder
php-coder / openshift.log
Created April 27, 2017 14:31
vagrant/etcd/openshift panic
I0425 11:11:58.985791 27972 start_master.go:221] Generating master configuration
I0425 11:11:58.986444 27972 create_mastercerts.go:181] Creating all certs with: admin.CreateMasterCertsOptions{CertDir:"openshift.local.config/master", Sign
erName:"openshift-signer@1493118718", ExpireDays:730, SignerExpireDays:1825, APIServerCAFiles:[]string(nil), CABundleFile:"openshift.local.config/master/ca-bu
ndle.crt", Hostnames:[]string{"10.0.2.15", "127.0.0.1", "172.17.0.1", "172.30.0.1", "kubernetes", "kubernetes.default", "kubernetes.default.svc", "kubernetes.
default.svc.cluster.local", "localhost", "openshift", "openshift.default", "openshift.default.svc", "openshift.default.svc.cluster.local"}, APIServerURL:"http
s://10.0.2.15:8443", PublicAPIServerURL:"https://localhost:8443", Overwrite:false, Output:(*util.gLogWriter)(0xc4213f731c)}
I0425 11:11:58.986531 27972 create_signercert.go:99] Creating a signer cert with: admin.CreateSignerCertOptions{CertFile:"openshift.local.config/master/ca.c
rt", KeyFile:"openshif
$ docker run --rm --user=1000000000 busybox id
container_linux.go:247: starting container process caused "invalid argument"
/usr/bin/docker-current: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "invalid argument".
$ docker run --rm --user=1000 busybox id
uid=1000 gid=0(root)