This file contains hidden or 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 script does a configurable intelligent exponential backoff with maximum. If the app runs for some time without any problem, the interval is resetted. | |
| # Requires: bash, genius | |
| # Security considerations: Like in almost any other shell scripts, some info may leak via /proc/. This should be rather negligible in this case. A local adversary may read sleep values, application run time, wait time and some WAIT_TIME_* variables. | |
| # | |
| # 1. Replace {{run-the-app}}. | |
| # 2. Replace {{clean}} by some clean procedure, e.g. rm -f "$BASE_DIR/play.pid". It might be a good idea to add some notification or logging there. | |
| # 3. Configure WAIT_TIME_* variables. | |
| # 4. Adjust if needed. |
This file contains hidden or 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/sh | |
| IDEA_VERSION=14 | |
| # Note that thread dump will not work well when you have launched other IDEA-like IDE (e.g. CLion, PhpStorm, PyCharm, RubyMine), since it has the same main class. | |
| time=$(date +%Y-%m-%d--%H:%M:%S) | |
| jps -l | grep ' com.intellij.idea.Main$' | sed 's/ .*$//' | xargs jstack > "/tmp/idea-$time.threads" | |
| cp ~/.IntelliJIdea$IDEA_VERSION/system/log/idea.log "/tmp/idea-$time.log" | |
| notify-send "Saved as /tmp/idea-$time.{log,threads}." |
This file contains hidden or 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 | |
| # No warranty is provided! | |
| # | |
| # Rather hacky script for streaming downloaded files through pipe. | |
| # Requires inotify-tools package installed. | |
| # It does not handle some failures properly! | |
| # | |
| # Assumes that a browser saves the temporary result into the .part file and the browser is the only process that opens the file for writing. | |
| # | |
| # How it works: The script streams the content of the .part file to stdout. When the .part file is closed, it stops streaming. |
This file contains hidden or 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
| % scalac weird.scala && javap X | |
| Compiled from "weird.scala" | |
| public class X implements scala.ScalaObject { | |
| public int 1(); | |
| public java.lang.String package(); | |
| public java.lang.String class(); | |
| public java.lang.String def(); | |
| public java.lang.String for(); | |
| public java.lang.String while(); | |
| public X(); |
This file contains hidden or 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
| /* | |
| In Czech, there are various "templates" for noun inflection. (I am not completely sure if "template" is the correct term.) We divide the nouns by grammatical gender to manculines, feminines and neuters. | |
| Masculines are divided to (grammaticaly) animate and (grammaticaly) inanimate. (Note that grammatical animateness may differ from the actual animateness. For example, "sněhulák" (snowman) and "umrlec" (dead man) are grammatically animate.) | |
| Templates according to https://cs.wikipedia.org/wiki/%C4%8Cesk%C3%A1_podstatn%C3%A1_jm%C3%A9na#Rod_mu.C5.BEsk.C3.BD_.C5.BEivotn.C3.BD : | |
| masculine, animate: | |
| pán | |
| muž |
This file contains hidden or 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
| % ant test-opt -v | |
| … | |
| test.osgi: | |
| [echo] Running OSGi JUnit tests. Output in …/scala/build/osgi | |
| [mkdir] Skipping …/scala/build/osgi/classes because it already exists. | |
| [junit] Implicitly adding /usr/share/ant/lib/junit.jar:/usr/share/java/ant-launcher-1.8.2.jar:/usr/share/ant/lib/ant.jar:/usr/share/ant/lib/ant-junit.jar:/usr/share/ant/lib/ant-junit4.jar to CLASSPATH | |
| [junit] Executing '/usr/lib/jvm/java-8-oracle/jre/bin/java' with arguments: | |
| [junit] '-classpath' | |
| [junit] '…/scala/build/osgi/classes:…/scala/build/osgi/org.scala-lang.scala-library.jar:…/scala/build/osgi/org.scala-lang.scala-reflect.jar:…/scala/build/osgi/org.scala-lang.scala-compiler.jar:…/scala/build/osgi/org.scala-lang.scala-actors.jar:…/.m2/repository/org/ops4j/pax/exam/pax-exam-container-native/2.6.0/pax-exam-container-native-2.6.0.jar:…/.m2/repository/org/ops4j/pax/exam/pax-exam/2.6.0/pax-exam-2.6.0.jar:…/.m2/repository/org/ops4j/base/ops4j-base-lang/1.4.0/ops4j-base-lang-1.4.0.jar:…/.m2/repository/org/ops4j/base/ops4j-b |
This file contains hidden or 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
| <testcase classname="tools.test.osgi.BasicTest" name="everythingLoads:tools.test.osgi.BasicTest.everythingLoads:NativeContainer:org.apache.felix.framework.FrameworkFactory@5606c0b" time="10.442"> | |
| <error message="gave up waiting for service org.ops4j.pax.exam.ProbeInvoker" type="org.ops4j.pax.swissbox.framework.ServiceLookupException">org.ops4j.pax.swissbox.framework.ServiceLookupException: gave up waiting for service org.ops4j.pax.exam.ProbeInvoker | |
| at org.ops4j.pax.swissbox.framework.ServiceLookup.getService(ServiceLookup.java:161) | |
| at org.ops4j.pax.swissbox.framework.ServiceLookup.getService(ServiceLookup.java:104) | |
| at org.ops4j.pax.swissbox.framework.ServiceLookup.getService(ServiceLookup.java:87) | |
| at org.ops4j.pax.exam.nat.internal.NativeTestContainer.call(NativeTestContainer.java:94) | |
| at org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactor.invoke(AllConfinedStagedReactor.java:74) | |
| at org.ops4j.pax.exam.junit.JUnit4TestRunner$2.evaluate(JUnit4TestRunner.java:285) | |
| at org.ops4j.pax.exam.junit.JUn |
This file contains hidden or 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
| 0: 0, 100, 200 | |
| 1: 1, 101, 201 | |
| 2: 2, 102, 202 | |
| 3: 3, 103, 203 | |
| 4: 4, 104, 204 | |
| 5: 5, 105, 205 | |
| 6: 6, 106, 206 | |
| 7: 7, 107, 207 | |
| 8: 8, 108, 208 | |
| 9: 9, 109, 209 |
This file contains hidden or 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 | |
| set -u | |
| set -e | |
| set -o pipefail | |
| # Settings | |
| NAME=GQueues | |
| COMMAND=firefox-gqueues |
This file contains hidden or 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 | |
| # Intended for installing the corresponding VirtualBox Extension Pack with secure verification. (A local network adversary can't forge the installed package.) | |
| # This version uses a temporary directory. | |
| # | |
| # It is written to be as fail-safe and fail-secure as possible, but no warranty is provided. | |
| # | |
| # safety settings | |
| set -u # Not strictly needed, but it is safer | |
| set -e # NEEDED for safety and security! |