This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl delete pods --field-selector status.phase=Failed --all-namespaces | |
kubectl delete pods --field-selector status.phase=Error --all-namespaces | |
kubectl delete pods --field-selector status.phase=Succeeded --all-namespaces | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$wget https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.bz2 | |
$tar xvf protobuf-2.5.0.tar.bz2 | |
$cd protobuf-2.5.0 | |
$./configure CC=clang CXX=clang++ CXXFLAGS='-std=c++11 -stdlib=libc++ -O3 -g' LDFLAGS='-stdlib=libc++' LIBS="-lc++ -lc++abi" | |
$make -j 4 | |
$sudo make install | |
$protoc --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* println(Schema2CaseClass.schema2Cc(dfp.schema, "Party")) | |
*/ | |
object Schema2CaseClass { | |
import org.apache.spark.sql.types._ | |
case class RecFieldRes(fieldStr: String, additionalCc: Option[String] = None) | |
case class CcRes(cc: String, additional: List[String]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Logstash config for Glassfish logs | |
# Used in combination with slf4j and logback | |
# Output: | |
# - application: glassfish | |
# - type: application or internal | |
# - categorie: technical or functional | |
input { | |
# If running logstash under a different user then check your permission to be sure that | |
# logstash has access to the server.log file. If logstash has no access to the file you |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in $(ls -1); | |
do | |
cd $i; | |
pwd; | |
git pull; | |
cd .. ; | |
done; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.concurrent.Callable; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.Future; | |
import java.util.concurrent.TimeUnit; | |
public class DeleteMe { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
System.setProperty("file.encoding", "UTF-8"); | |
Field charset = Charset.class.getDeclaredField("defaultCharset"); | |
charset.setAccessible(true); | |
charset.set(null, null); | |
} catch (IllegalAccessException | NoSuchFieldException e) { | |
e.getMessage(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public User getCurrentUser(Principal principal) { | |
System.out.println("principal.getName() = " + principal.getName()); | |
System.out.println(" userService.getByLogin(principal.getName()) = " + userService.getByLogin(principal.getName())); | |
return userService.getByLogin(principal.getName()); | |
} | |
/** | |
* Edit user method | |
* !! if Change user.login you must to re singIn on client !! | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user.setEmail("[email protected]"); | |
ValidatorFactory vf = Validation.buildDefaultValidatorFactory(); | |
Validator validator = vf.getValidator(); | |
Set<ConstraintViolation<Object>> constraintViolations = validator.validate(user); | |
System.out.println(String.format("Кол-во ошибок: %d", | |
constraintViolations.size())); | |
System.out.println("constraintViolations = " + constraintViolations.isEmpty()); |