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
# docker run --rm -it -w /usr/src/app -v $(pwd):/usr/src/app python:3.7-buster bash | |
python -m venv cb | |
source cb/bin/activate | |
pip install spacy==2.1.8 chatterbot==1.0.8 | |
HTTPS_PROXY=http://host.docker.internal:1087 python -m spacy download en |
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
#!/bin/bash | |
docker run -d -p 80:80 -p 8080:8080 traefik:latest --api --rest | |
curl -v -XPUT localhost:8080/api/providers/rest -d ' | |
{ | |
"frontends": { | |
"frontend1": { | |
"routes": { | |
"test_1": { |
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
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
assertEq(succ("AA"), "AB") | |
assertEq(succ("AZ"), "BA") | |
assertEq(succ("ZZ"), "AAA") |
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
abstract class ResolvingLinkes { | |
static { | |
System.out.println(org.apache.logging.log4j.core.appender.AppenderSet.class); | |
System.out.println(org.apache.logging.log4j.core.appender.CountingNoOpAppender.class); | |
// System.out.println(org.apache.logging.log4j.core.appender.db.ColumnMapping.class); | |
// System.out.println(org.apache.logging.log4j.core.appender.db.jdbc.ColumnConfig.class); | |
// System.out.println(org.apache.logging.log4j.core.appender.db.jdbc.DataSourceConnectionSource.class); | |
// System.out.println(org.apache.logging.log4j.core.appender.db.jdbc.FactoryMethodConnectionSource.class); | |
// System.out.println(org.apache.logging.log4j.core.appender.db.jdbc.JdbcAppender.class); | |
// System.out.println(org.apache.logging.log4j.core.appender.db.jpa.JpaAppender.class); |
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 sun.misc.JavaLangAccess; | |
import sun.misc.SharedSecrets; | |
import java.util.Random; | |
class Main { | |
static final JavaLangAccess JAVA_LANG_ACCESS = SharedSecrets.getJavaLangAccess(); | |
static final Random RANDOM = new Random(); | |
static final ThreadLocal<String> CALLER = new ThreadLocal<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
#! /bin/bash | |
# This is a script to download easeagent-sm.jar and export JAVA_OPTS for a JVM application. | |
# Usage: | |
# source /dev/stdin <<< "$(curl -SL https://git.io/vD7Bp)" | |
JAR='easeagent-sm.jar' | |
URL="https://github.com/hexdecteam/stagemonitor/releases/download/v0.25.1-easestack/${JAR}" | |
DIR="${HOME}/.easestack" | |
function download { |
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
#! /bin/bash | |
REGEX='' | |
ONE_JAR="$REGEX-*.jar" | |
pid() { | |
jps -l | awk '$2 ~ /'$REGEX'/ {print $1}' | |
} | |
run() { |
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
#! /bin/bash | |
sed -i '2 i func() {\n sed -i "2 i $1() {\\n $2 \\n}\\n" ~/.bashrc\n source ~/.bashrc\n}' ~/.bashrc;source ~/.bashrc |
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 akka.actor._ | |
import scala.annotation._ | |
object ForbiddenRestartInActor { | |
def main(args: Array[String]) { | |
@tailrec | |
def readLineThen(a: String => Unit): Unit = Console.readLine match { | |
case "q" => println("bye") |
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 akka.actor._ | |
import scala.annotation._ | |
import scala.io._ | |
object RecoverWithState { | |
def main(args: Array[String]) { | |
@tailrec | |
def readLineThen(a: String => Unit): Unit = StdIn.readLine match { |
NewerOlder