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
DECLARE | |
V_VAL NUMBER; | |
BEGIN | |
FOR V_I IN 1..50 | |
LOOP | |
EXECUTE IMMEDIATE 'SELECT BATCH_STEP_EXECUTION_SEQ.NEXTVAL FROM DUAL' into V_VAL; | |
END LOOP; | |
END; | |
-- or |
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
echo 'export PATH=~/bin:$PATH' >> ~/.bash_profile | |
source ~/.bash_profile |
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
sudo -u otheruser bash -l | |
#or one-liner | |
sudo -n -u otheruser -- /usr/bin/bash -c "export JAVA_HOME=/apps/java/jdk1.8.0_281; cd /apps/hello/; ./install.sh" | |
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
jdk/bin/keytool -genkey -keyalg RSA -noprompt -alias tomcat -dname "CN=localhost, OU=NA, O=NA, L=NA, S=NA, C=NA" -keystore tomcat8/selfsigned.jks -validity 9999 -storepass changeme -keypass changeme |
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
# Call page expecting particular HTTP resp code; if condition not met, retry every 15s for 2 minutes | |
HEALTH_CHECK_URL=https://example.com | |
EXPECTED_HEALTH_CHECK_HTTP_RESPONSE_CODE=200 | |
timeout 120 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' '$HEALTH_CHECK_URL')" != '$EXPECTED_HEALTH_CHECK_HTTP_RESPONSE_CODE' ]]; do sleep 15; done' || false | |
echo $? # 0 for success, 1 for failure |
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 lombok.SneakyThrows; | |
import org.apache.commons.lang3.StringUtils; | |
import java.io.File; | |
import java.nio.charset.StandardCharsets; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.nio.file.Paths; | |
import java.util.ArrayList; | |
import java.util.List; |
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
Similar to: https://www.reddit.com/r/bashonubuntuonwindows/comments/mgpla3/xfce4_works_when_xserver_is_in_multiple_windows/ | |
Error: | |
/usr/bin/startxfce4: X server already running on display | |
Unable to open display. | |
xfce4-panel: Cannot open display: . | |
Solution: |
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
/** | |
* Definition from LeetCode | |
*/ | |
public class TreeNode { | |
int val; | |
TreeNode left; | |
TreeNode right; | |
TreeNode() { | |
} |
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 com.github.benmanes.caffeine.cache.AsyncCacheLoader | |
import com.github.benmanes.caffeine.cache.AsyncLoadingCache | |
import com.github.benmanes.caffeine.cache.Caffeine | |
import groovy.util.logging.Slf4j | |
import io.vertx.core.Context | |
import io.vertx.core.Future | |
import io.vertx.core.Promise | |
import io.vertx.core.Vertx | |
import java.time.Duration |
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
//curl --write-out --http2 --insecure https://localhost:8083 | |
import io.vertx.core.Vertx | |
import io.vertx.core.http.HttpServerOptions | |
import io.vertx.core.net.PemKeyCertOptions | |
def vertx = Vertx.vertx() | |
vertx | |
.createHttpServer(new HttpServerOptions() |
NewerOlder