Skip to content

Instantly share code, notes, and snippets.

View ensean's full-sized avatar
🌎

ensean

🌎
  • Guangzhou, China
View GitHub Profile
@ensean
ensean / template.json
Created February 28, 2023 05:05
mediaconvert job json for mp3 to mp3 hls
{
"Queue": "arn:aws:mediaconvert:ap-northeast-1:77959xxx7093:queues/Default",
"UserMetadata": {},
"Role": "arn:aws:iam::779598xxx7093:role/service-role/MediaConvert_Default_Role",
"Settings": {
"TimecodeConfig": {
"Source": "ZEROBASED"
},
"OutputGroups": [
{
@ensean
ensean / auth.js
Created June 24, 2022 03:38
demo auth js for cf workshop in Shenzhen
//Response when token ts does not match.
var response403 = {
statusCode: 403,
statusDescription: 'Unauthorized',
headers: {
'cache-control': {
'value': 'max-age=1296000'
}
}
};
@ensean
ensean / eksctl-fargate-nat-example.yaml
Created April 24, 2022 05:59
eksctl-fargate-nat-example
# An example of ClusterConfig object with highly available NAT gateways
---
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: cluster-fargate
region: ap-northeast-1
vpc:
@ensean
ensean / cff_response_content_type_by_ua.js
Last active March 16, 2022 15:24
cff_response_content_type_by_ua
function handler(event) {
var response = event.response;
var request = event.request;
var ua = request.headers['user-agent']['value'].toLowerCase();
var headers = response.headers;
if (ua.indexOf('chrome') > -1) {
// Set the cache-control header
headers['content-type'] = {value: "application/vnd.android.package-archive"};
}
else if (ua.indexOf('firefox') > -1){
添加opentuna国内源
```shell
sudo tee /etc/yum.repos.d/mysql-community.repo<<EOF
[mysql-connectors-community]
name=MySQL Connectors Community
baseurl=https://opentuna.cn/mysql/yum/mysql-connectors-community-el7-aarch64/
enabled=1
gpgcheck=1
gpgkey=https://repo.mysql.com/RPM-GPG-KEY-mysql