1.sh:
#!/bin/sh
set -eux
rm -rf rubygems bundler
git clone https://github.com/rubygems/rubygems
git clone https://github.com/rubygems/bundler| #!/bin/bash | |
| module=$1 | |
| for resource in `terraform show -module-depth=1 | grep module.${module} | tr -d ':' | sed -e 's/module.${module}.//'`; do | |
| terraform taint -module ${module} ${resource} | |
| done |
| get_latest_release() { | |
| curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api | |
| grep '"tag_name":' | # Get tag line | |
| sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value | |
| } | |
| # Usage | |
| # $ get_latest_release "creationix/nvm" | |
| # v0.31.4 |
| http { | |
| log_format filt '$remote_addr - $remote_user [$time_local] "$_request" ' | |
| '$status $body_bytes_sent "$http_referer" ' | |
| '"$http_user_agent" "$http_x_forwarded_for"'; | |
| server { | |
| location /login { | |
| # `set` is provided by the Rewrite module | |
| set $filter "password|secret"; |
FFMPEG filters provide a powerful way to programmatically enhance or alter videos, and it’s fairly simple to add a watermark to a video using the overlay filter. The easiest way to install ffmpeg is to download a pre-built binary for your specific platform. Then you don’t have to worry about including and installing all the right dependencies and codecs you will be using.
Once you have ffmpeg installed, adding a watermark is as easy as passing your existing source through an overlay filter like so:
ffmpeg -i test.mp4 -i watermark.png -filter_complex "overlay=10:10" test1.mp4
Basically, we’re passing in the original video, and an overlay image as inputs, then passing it through the filter, and saving the output as test1.mp4.
| #!/bin/sh | |
| # Generate self signed root CA cert | |
| openssl req -nodes -x509 -newkey rsa:2048 -keyout ca.key -out ca.crt -subj "/C=AU/ST=NSW/L=Sydney/O=MongoDB/OU=root/CN=`hostname -f`/emailAddress=kevinadi@mongodb.com" | |
| # Generate server cert to be signed | |
| openssl req -nodes -newkey rsa:2048 -keyout server.key -out server.csr -subj "/C=AU/ST=NSW/L=Sydney/O=MongoDB/OU=server/CN=`hostname -f`/emailAddress=kevinadi@mongodb.com" | |
| # Sign the server cert |
As outlined here, there are a couple of situations where you need to authenticate with GitHub by using an Acces Token:-
In your GitHub account, go to Settings / Developer settings / Personal access tokens and select Generate New Token. Make a note of the token somewhere safe since this is the only chance you get to see it.
An introduction to curl using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
Includes HTTP-Header information in the output
| openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 10000 -nodes |