I hereby claim:
- I am riyadhalnur on github.
- I am riyadhalnur (https://keybase.io/riyadhalnur) on keybase.
- I have a public key ASCBz6zYWAlye04isG2zEdabYCxC7r4ngE6FGKPO7d7q2wo
To claim this, I am signing this object:
| package main | |
| import ( | |
| "image" | |
| gcolor "image/color" | |
| "image/draw" | |
| "github.com/go-playground/colors" | |
| ) | |
| func redrawImage(imgBytes []byte) error { |
| # Convert JPG to PDF | |
| gs -sPAPERSIZE=a4 -sDEVICE=pdfwrite -o output.pdf /usr/share/ghostscript/9.27/lib/viewjpeg.ps -c "(input.jpg) viewJPEG" | |
| # Convert PDF to JPG | |
| gs -sDEVICE=jpeg -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -r300 -o output.jpg input.pdf | |
| # Convert PDF to JPG, only 1st page | |
| gs -sDEVICE=jpeg -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -dFirstPage=1 -dLastPage=1 -r300 -o output.jpg input.pdf |
| #!/bin/bash | |
| trap 'echo "Wait for the script to finish"' SIGINT SIGTERM EXIT | |
| # Recurses a directory to do git pulls in each repo folder | |
| BASEDIR=/Users/test/go/src/github.com | |
| for dir in "$BASEDIR"/* | |
| do | |
| if [[ -d "$dir" ]]; then |
| set -g mouse on | |
| set -g @plugin 'jimeh/tmux-themepack' | |
| set -g @themepack 'basic' | |
| set -g @plugin 'tmux-plugins/tmux-resurrect' | |
| set -g @plugin 'tmux-plugins/tmux-yank' | |
| set -g @plugin 'tmux-plugins/tmux-prefix-highlight' | |
| run '~/.tmux/plugins/tpm/tpm' |
| { | |
| "variables": { | |
| "aws_access_key": "", | |
| "aws_secret_key": "" | |
| }, | |
| "builders": [{ | |
| "type": "amazon-ebs", | |
| "access_key": "{{user `aws_access_key`}}", | |
| "secret_key": "{{user `aws_secret_key`}}", | |
| "region": "ap-southeast-1", |
| import Ember from 'ember'; | |
| import Base from 'ember-simple-auth-token/authenticators/token'; | |
| export default Base.extend({ | |
| authenticate(credentials, headers) { | |
| return new Ember.RSVP.Promise((resolve, reject) => { | |
| const data = this.getAuthenticateData(credentials); | |
| this.makeRequest(data, headers).then(response => { | |
| if (response.data && response.data.role === 'admin') { |
| import gspread | |
| from oauth2client.service_account import ServiceAccountCredentials | |
| SCOPE = ['https://spreadsheets.google.com/feeds'] | |
| # The key file can be downloaded from Google Developer Console | |
| KEY = 'yourkey.json' | |
| # Authenticate using your key file | |
| credentials = ServiceAccountCredentials.from_json_keyfile_name(KEY, SCOPE) |
| #!/bin/bash | |
| curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash - | |
| wget http://nginx.org/keys/nginx_signing.key | |
| apt-key add nginx_signing.key | |
| deb http://nginx.org/packages/ubuntu/ trusty nginx > /etc/apt/sources.list | |
| deb-src http://nginx.org/packages/ubuntu/ trusty nginx > /etc/apt/sources.list | |
| apt-get update | |
| apt-get upgrade -y | |
| apt-get install -y nginx nodejs build-essential ntp ufw |
I hereby claim:
To claim this, I am signing this object:
| #!/bin/bash | |
| # Remember to install the Python client drivers for RethinkDB to use dump | |
| # http://www.rethinkdb.com/docs/install-drivers/python/ | |
| DB="" # name of the database to back up | |
| APP="" # file name prefix for dump archive | |
| TIMESTAMP=`date +%F-%H%M` | |
| RETHINKDUMP_PATH="/usr/bin/rethinkdb" |