- command line values (for example, -u my_user, these are not variables)
- role defaults (defined in role/defaults/main.yml)
- inventory file or script group vars
- inventory group_vars/all
- hosts: all | |
become: true | |
tasks: | |
- name: configure system settings, file descriptors and number of threads | |
pam_limits: | |
domain: <--your-username--> | |
limit_type: "{{item.limit_type}}" | |
limit_item: "{{item.limit_item}}" | |
value: "{{item.value}}" | |
with_items: |
from __future__ import print_function | |
from sqlalchemy import * | |
from sqlalchemy.orm import create_session | |
from sqlalchemy.ext.declarative import declarative_base | |
Base = declarative_base() | |
engine = \ | |
create_engine("postgresql://...") | |
metadata = MetaData(bind=engine) |
RESOURCE="/${OSS_BUCKET_NAME}/${OBJECT_NAME}" | |
CONTENT_MD5=$(openssl dgst -md5 -binary "${FILEPATH}" | openssl enc -base64) | |
CONTENT_TYPE=$(file -ib "${FILEPATH}" |awk -F ";" '{print $1}') | |
DATE_VALUE="`TZ=GMT date +'%a, %d %b %Y %H:%M:%S GMT'`" | |
STRING_TO_SIGN="PUT\n${CONTENT_MD5}\n${CONTENT_TYPE}\n${DATE_VALUE}\n${RESOURCE}" | |
SIGNATURE=$(echo -e -n $STRING_TO_SIGN | openssl dgst -sha1 -binary -hmac $OSS_ACCESS_KEY_SECRET | openssl enc -base64) | |
URL="http://${OSS_BUCKET_NAME}.${OSS_REGION}.aliyuncs.com/${OBJECT_NAME}" | |
curl -i -q -X PUT -T "${FILEPATH}" \ | |
-H "Host: ${OSS_BUCKET_NAME}.${OSS_REGION}.aliyuncs.com" \ | |
-H "Date: ${DATE_VALUE}" \ |
The following command will install the latest version of REX-Ray to /usr/bin/rexray on Linux systems:
$ sudo apt install s3fs
$ curl -sSL https://dl.bintray.com/emccode/rexray/install | sh
Depending on the Linux distribution REX-Ray will be registered as either a SystemD or SystemV service.
REX-Ray requires a configuration file for storing details used to communicate with storage providers. This can include authentication credentials and driver specific configuration options. After REX-Ray has been installed, copy and paste the contents below to a new file on the host at /etc/rexray/config.yml
to configure s3fs storage driver.
version: "3" | |
services: | |
sonarqube: | |
image: sonarqube | |
expose: | |
- 9000 | |
ports: | |
- "127.0.0.1:9000:9000" | |
networks: |
Helper setup to edit .yaml files with Vim:
List of general purpose commands for Kubernetes management:
This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.
Convert .mov/.MP4 to .gif
As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.
This is not limited to developer, anyone has this need can use this method to convert the files.
Since Golang version 1.11 this process is finally (almost) as easy as it should (!!). You can see full docs here. For older guides see here.
These are my notes, not a generic solution. They are not meant to work anywhere outside my machines. Update version numbers to whatever are the current ones while you do this.