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
Tomcat7 add to config: | |
<Host name="localhost" appBase="webapps" | |
unpackWARs="true" autoDeploy="true"> | |
<Context path="" docBase="administracija"> | |
<WatchedResource>WEB-INF/web.xml</WatchedResource> | |
</Context> | |
<!-- SingleSignOn valve, share authentication between web applications | |
Documentation at: /docs/config/valve.html --> |
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
# Eclipse | |
.classpath | |
.project | |
.settings/ | |
# Intellij | |
.idea/ | |
*.iml | |
*.iws |
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
{ | |
"BD": { | |
"alpha_2": "BD", | |
"name": "Bangladesh" | |
}, | |
"BE": { | |
"alpha_2": "BE", | |
"name": "Belgium" | |
}, | |
"BF": { |
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
/** | |
* Finding number of times subarray repeats in array <br> | |
* @param array must be >= @param subarray | |
* @return # of subarray repeats or 0 | |
*/ | |
public int findSubarrayCount(List<String> array, List<String> subarray, int fromIndex) { | |
int cntTotal = 0; | |
String firstElement = null; | |
if (subarray.size() > 0) { |
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
body { | |
padding: 20px; | |
} | |
div { | |
width: 200px; | |
height: 200px; | |
margin-right: 20px; | |
overflow-y: scroll; /* has to be scroll, not auto */ | |
float: left; |
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
public class MailgunWebhook extends HttpServlet { | |
private static final long serialVersionUID = 1L; | |
public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { | |
try { | |
resp.setContentType("application/json"); | |
String token = null; |
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
private static final key = "mailgun_key" | |
public static boolean isSignatureValid(String token , long timestamp, String signature) { | |
try { | |
Mac hmac = Mac.getInstance("HmacSHA256"); | |
SecretKeySpec signingKey = new SecretKeySpec(key.getBytes(), "HmacSHA256"); | |
hmac.init(signingKey); | |
String signed = Hex.encodeHexString(hmac.doFinal((timestamp + token).getBytes())); | |
if (signed.equals(signature)) { | |
return true; | |
} |
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
# (tested on Ubuntu 18.04 Desktop) | |
# Stream your own desktop to RTMP | |
ffmpeg -f x11grab -s 1920x1200 -framerate 15 -i :0.0 -c:v libx264 -preset fast -pix_fmt yuv420p -s 1280x800 -threads 0 -f flv "rtmp://127.0.0.1/live/mystreamkey" | |
# Broadcasting Examples | |
ffmpeg -f dshow -i video="Virtual-Camera" -preset ultrafast -vcodec libx264 -tune zerolatency -b 900k -f mpegts udp://127.0.0.1:1234 | |
ffmpeg -f dshow -i video="screen-capture-recorder":audio="Stereo Mix (IDT High Definition" \ |
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
created - A container that has been created (e.g. with docker create) but not started | |
restarting - A container that is in the process of being restarted | |
running - A currently running container | |
paused - A container whose processes have been paused | |
exited - A container that ran and completed ("stopped" in other contexts, although a created container is technically also "stopped") | |
dead- A container that the daemon tried and failed to stop (usually due to a busy device or resource used by the container) |
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
raspivid -t 0 -w 640 -h 480 -fps 15 -hf -b 1000000 -o - | \ | |
> gst-launch-1.0 fdsrc ! h264parse config-interval=2 ! flvmux ! rtmpsink location='rtmp://127.0.0.1/live live=1' |
OlderNewer