View GoogleTranslateScraper.py
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
from playwright import async_playwright | |
from sanic import Sanic | |
from sanic import response | |
app = Sanic(name='Translate application') | |
#test with: curl 'http://localhost:5000/translate?sl=nl&tl=en&translate=auto' | |
@app.route("/translate") | |
async def doTranslate(request): |
View DemoController.java
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 nl.amis.smeetsm.sb; | |
import oracle.jdbc.OracleArray; | |
import oracle.jdbc.OracleCallableStatement; | |
import oracle.jdbc.OracleConnection; | |
import oracle.jdbc.OracleStruct; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.http.HttpHeaders; | |
import org.springframework.http.ResponseEntity; | |
import org.springframework.web.bind.annotation.RequestMapping; |
View process-exporter.yml
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
process_names: | |
# comm is the second field of /proc/<pid>/stat minus parens. | |
# It is the base executable name, truncated at 15 chars. | |
# It cannot be modified by the program, unlike exe. | |
- comm: | |
- java | |
cmdline: | |
- app.jar |
View docker-compose.yml
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
version: '2' | |
services: | |
spring-boot-jdk: | |
image: "spring-boot-jdk" | |
container_name: spring-boot-jdk | |
ports: | |
- "8080:8080" | |
networks: | |
- dockernet | |
mem_limit: 1024M |
View gist:0e2878abdb4905f1604056ef54bec9ad
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
String output = String.format("{ \"access_token\" : \"%s\",\n" + " \"scope\" : \"read write\",\n" + " \"token_type\" : \"Bearer\",\n" + " \"expires_in\" : %s\n}", token,expirytime); |
View gist:bc204e98208dee1d8e1d58e443c36e0f
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
SignedJWT signedJWT = new SignedJWT(new JWSHeader.Builder(JWSAlgorithm.RS256).keyID(rsaJWK.getKeyID()).build(), claimsSet); | |
signedJWT.sign(signer); | |
String token = signedJWT.serialize(); |
View gist:5ac350e8455df31d2281356f158b1ef6
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
JWTClaimsSet claimsSet = new JWTClaimsSet.Builder() | |
.subject(user) | |
.issuer(prop.getProperty("tokenissuer")) | |
.expirationTime(expires) | |
.issueTime(new Date(new Date().getTime())) | |
.build(); |
View signer.java
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
JWSSigner signer = new RSASSASigner(rsaJWK); |
View gist:5f97bda15aa116b467ed35d927c8461b
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
RSAKey rsaJWK = new RSAKey.Builder(myPublicKey).privateKey(myPrivateKey).keyID(prop.getProperty("keyalias")).build(); |
View gist:97857d59c5d59cbd3fd7489bb404279b
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
RSAPrivateKey myPrivateKey = (RSAPrivateKey) pkEntry.getPrivateKey(); | |
RSAPublicKey myPublicKey = (RSAPublicKey) pkEntry.getCertificate().getPublicKey(); |
NewerOlder