1. 选择权回到用户手中。需要用户主动点击授权之后,小程序才能向其推送服务通知,
2、时长不受限制。「订阅消息」取消了7天内推送消息的时间限制,只要用户没有主动拒收消息推送,开发者就可以随时推送服务通知。
...
2019/12/27
2019/12/25
docker image build Dockerfile
docker-compse.yml 内で定義 go のimage
image:xxx/xxx ->直接pull して使う
imageを調査する
履歴調査 docker image history image_name
構成調査 docker image inspect image_name
build a image from dockerfile
docker build --help
Dockerfile 原則
1. container from Dockerfile is ephemeral
2. one container one process (easy to scale horizontally)
3. minimize container layer ( use one-line command. one command one layer)
RUN apt-get update && apt-get install -y \
bzr \
cvs \
git \
mercurial \
subversion
4. docker build...
2019/12/24
ninson ignore
-ignore='Path .git'
-ignore='Path .github'
-ignore='Path docker-compose'
-ignore='Path .idea'
-ignore='Name *.gitignor...
docker mac performance
docker use linux kernel almost as native, so performance is well.
in mac or windows, things are different. there is no linux kernel.
so some helper needed.
docker-machine: a tool to install docker in virtual machine. Dockerized hosts (hosts with Docker Engine on them).
docker for Mac/Windows: even still run a virtual machine (super hidden ).with its own hypervisor “hyperkit” and shared file system “osxfs”. Unfortunately, “osxfs” wasn’t very fast.
but in many cases, realtime host-virtual consistence is not necessary.
So...
docker run exec
「docker run」コマンドは、コンテナを作成して起動するコマンド。
docker run -it image_name "/bin/bash"
他のTabでdocker ps
Containerが増える。
実質は:
docker create image_name
docker start image_name
「docker exec」コマンドは、起動中のコンテナ内で、指定したコマンドを実行するコマンド。
docker ps
docker exec -it container_id "/bin/bash"
docker-run options image_name init_command
-- name (起動されたContainerに名前)
-- rm (Container終了時削除)
-v fromHostSrc:toContainerTarget-e env parameters
-d run in backend
docker-sync start サンプル:
docker run --rm -v "dir1:/app_sync"...
2019/12/20
wechat pay

...
wechat miniapp login

wechat miniApp: wx.login -> code
wechat miniApp: wx.request , send code to server api
server request
wechat API,get openId and sesion_key: https://api.weixin.qq.com/sns/jscode2session?appid=a&secret=b&js_code=codegrant_type=authorization_code
use openId and session_key to generate access token
response access token and openId to miniAPP(token1)
wechat miniApp: wx.getSetting check user's authority.if not ,request user's...
docker show all container ,delete all
docker show all container : docker container ls -a
docker show volume: docker volume ls
docker show image: docker image ls
delete all unused objects: docker system prune -f --volumes
delete all images: docker image prune -a
docker-compose up -d --remove-orphans
スキリした。普通に30Gぐらい削除した。unusedの基準は曖昧か...
2019/12/18
golang gorm update when record not exist
when record is not exist. update will be success.
have to check RowsAffected .
the same as delte
query := db.Model(r).Updates(something)
if query.Error != nil {
return query.Error
}
if query.RowsAffected == 0 {
return gorm.ErrRecordNotFound
}
query := db.Delete(&something{ID: ID})
if query.Error != nil {
return query.Error
}
if query.RowsAffected == 0 {
return gorm.ErrRecordNotFound
...
2019/12/16
MacOS bad support on HFS/APFS
MacOS/OSX has very bad filesystem events support on HFS/APFS, watching the file-system for changes using unox or fswatch was causing a heavy CPU load. This CPU load is very significant, even on modern high-end CPUs (like a i7 4770k / 3.5GHz)...
2019/11/24
android app without cm and gms
使う時使ってもらっていいじゃない?
情報を収集してなにをやりたい?
huawei 端末にgmsがないからいいかも
apk market: apk pure
apk manager: xapk manager
mp3 player: plusar
japanese input: Japanese Keyboa...
2019/11/19
gorm 问题
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'}
span.s1 {font: 12.0px '.Hiragino Kaku Gothic Interface'}
多了许多() query := db.debug.Where(fmt.Sprintf("id in ( %s )", “1,2,3”))=>SELECT * FROM `a` WHERE `a`.`deleted_at` IS NULL AND ((id in ( 1,2,3 )))
preload 时ID一大堆
...
2019/09/25
docker-sync ruby error
xcodeアップデートしますかを聞かれて、アップデートした。
docker-syncがエラー
docker-sync start
mkmf.rb can't find header files
ruby versionの管理が混乱になっている。
rbenvを導入
brew update
brew install rbenv ruby-build
rbenv install -l
rbenv install 2.6.4
エラー、BUILD FAILED (OS X 10.。。。。
sudo chmod -s /usr/sbin/dtrace
RUBY_CONFIGURE_OPTS="--disable-dtrace" rbenv install
でrubyをインストールできた。
which gem
which ruby
gem list
gem install docker-compose
gem install docker-sync
でOK
...
2019/09/02
golang validation array size
gte
ids []int `json:"ids,omitempty" binding:"required,gte=1...
2019/07/05
E talking 20190703
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px 'Helvetica Neue'}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; min-height: 14.0px}
span.s1 {font: 17.0px '.Hiragino Kaku Gothic Interface'}
span.s2 {font: 12.0px '.Hiragino Kaku Gothic Interface'}
span.Apple-tab-span {white-space:pre}
the statute(法令) of limitations
prescription 処方箋、取得時効
How many year is the statute of limitation in France.
For example, I borrowed 1000 yen from you. and...
2019/06/27
delete file with special name
```
find . -name "*conflict*" -type f | xargs -I {} echo "rm -fv \"{}\"" | tee test.log
sh test.log
```
find->xargs echo ->t...
2019/06/25
gvm change gopath
go env
gvm pkgset list
gvm pkgenv xxx
edit it
gvm pkgset use ...
e talk 20190619
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; min-height: 14.0px}
span.s1 {font: 12.0px '.Hiragino Kaku Gothic Interface'}
span.s2 {font: 12.0px '.Hiragino Sans GB Interface'}
two situation. which one is better?
organized by the nursery school.
want to retire when i am 40s .forties
you will on your vacation next week?
I don’t own a car.
I can’t drive a car. (i don’t have a driver’s license.)
butterfly swimming
they are afraid of me...
2019/06/14
e talk 20190612
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px 'Helvetica Neue'}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; min-height: 14.0px}
span.s1 {font: 12.0px '.Hiragino Kaku Gothic Interface'}
one person per family
his patient has limit.more patient please…
he was a doctoral student ,he need money and project to finish his doctoral course.
he is a rich man and maybe an alcoholic(酒精中毒患者) alcoholism
(be addicted to alcohol)
ladyboy...
2019/06/11
2019/06/11
trump twitter
america can't afford you.pay your damn(畜生 ) bills
his descendant will be recluses,
is tantamount to doing sth 跟什么什么一样。。。
owe欠钱 own
doubt it 怀...
e speaking 20190522
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'; min-height: 14.0px}
span.s1 {font: 12.0px '.Hiragino Kaku Gothic Interface'}
immigration
midlife-crisis
i am not in a hurry
permanent residency
president
resident
residency
co-worker. not friend
what is the most convenient spot for you?
plastic garbage
employment, human resources
accounting
korean tribe
movie ,film
sf—>science fiction
young sister
at the age of...
E speaking 20190605
tell me about the last time
you laughed really hard
you went on vacation
you went to movies
you bought something ridiculously expensive
you stumbled(躓いた つまづいた 绊倒了) and fell
tell told told
talk talked talked
she say she had told me.
i just looked forward, there are many people at the crosswalk and the fence's color is different from others. i stumbled by the fence and felled over.
ask staff's complaints then quarrel with boss
one hundred thousand
go through your resume
time is up
rid yourself of such troublesome...
2019/05/30
English talk memo 20180529

selfish
selfless
outgoing
extroverted
introverted
be tired of watermelon,i am sick of it(i am sick of you?)
be tried from my work
have no courage to admit that he is a gay
an honest man
second hand goods ,new goods
confident
i am angry with
be furious with
everyone is stubborn.
fill many application forms
a modest person
a plate with nazi icon
He is a military man
the dragon is like some fighter plane
she has been hurt a lot by her...
2019/03/27
gin,appengine,graphql test
gin+GAE+graphql のテスト下記で行けった。
appEngineTestInstance
->instance.NewRequest
gin.Context(request)
context.Set(key value)
```
ins, _ := aetest.NewInstance(nil)
req, _ := ins.NewRequest("", "", nil)
var context *gin.Context
context = &gin.Context{Request: req}
b, _ := json.Marshal(x.y{z: "1"})
context.Set("key", b)
`...
2019/03/18
nitendo switch dns 解決できない
DNS1 8.8.8.8
DNS2 8.8.4.4
にして...
2019/03/05
Removing packages installed with go get
juse delete the source and package
麻烦,要是有一个命令就好了,找一下
It's safe to just delete the source directory and compiled package file. Find the source directory under $GOPATH/src and the package file under $GOPATH/pkg/<architecture>, for example: $GOPATH/pkg/windows_amd64.
example
go get github.com/golang/mock/mockgen
go clean -i github.com/golang/mock/mockgen
The -i flag causes clean to remove the corresponding installed
archive or binary (what 'go install' would create).
The -n flag causes clean to print the remove...
2019/03/04
2019/03/04
go gin validator omitempty
細かくて面倒
・Pointer推奨、nilとZeroValueを区別するため
・bindingはpointerに対しても有効
・omtiemptyが必須ね。。
type XXXRequest struct {
Adate *time.Time `json:"aDate,omitempty" time_format:"2006-01-02”`
B *float64`json:"b,omitempty" binding:"omitempty,min=-90,max=90”`
C *float64 `json:"c,omitempty" binding:"omitempty,min=-180,max=180”`
...
2019/02/25
swagger 更新されない
Swagger.yamlを修正しても、8090をアクセスして変更されない
docker-componseでup ,down変わらない
docker image,containerでrmで変わらない
BrowerのCacheが。。。。
迷惑だから、勝手にCacheしないてを言いたい
(cmd shift r常識の、面...
2019/02/21
golang pointer compare
Pointer values are comparable. Two pointer values are equal if they point to the same variable or if both have value ...
2019/02/18
jmeter org.apache.commons.httpclient.NoHttpResponseException
規律的に半分が上記のエラーになった。
良くわからない、
Server側が一方的に拒否した?
HttpHeaderの設定で、KeepAliveをOffして、治った。
今回のテスト対象がnginx + djangoなので、keepaliveの設定が悪い疑惑!
また調べる。
https://road288.hatenablog.com/entry/2017/12/13/095408
https://qiita.com/edward999th/items/bc730faed3ca38760a26
https://www.ibm.com/developerworks/jp/opensource/library/os-django/index.ht...
2019/02/11
http options
投石问路
サーバーがサポートするリクエストメソッドを調べるには、curlを使用してOPTIONS要求を発行します。
curl -X OPTIONS http://example.org -i
レスポンスには、許可されたメソッドを持つ Allow ヘッダが含まれています:
HTTP/1.1 200 OK
Allow: OPTIONS, GET, HEAD, POST
Cache-Control: max-age=604800
Date: Thu, 13 Oct 2016 11:45:00 GMT
Expires: Thu, 20 Oct 2016 11:45:00 GMT
Server: EOS (lax004/2813)
x-ec-custom-error: 1
Content-Length: 0...
2019/02/10
2019/02/10
gke cloudsql
create serviceAccount with cloudsql privelage
down cloudsql json key
create kubectl secert```kubectl create secret generic cloudsql-oauth-credentials --from-file=credentails.json=.json```
deployment.yaml```volumes:
- name: cloudsql-oauth-credentials
secret:
secretName: cloudsql-oauth-credentials
- name: ssl-certs
hostPath:
path: /etc/ssl/certs
- name: cloudsql
emptyDir: {}
- name: cloudsql-proxy
image: gcr.io/cloudsql-docker/gce-proxy:1.11
command: ["/cloud_sql_proxy",
"-instances=projectName:region:instance=tcp:3306",
...
k8s message=Required "container.clusters.get" permission(s) for
circleICIの作業でGCR PUSH、K8S Deployの作業で、権限がない言われた。。
適切にCI のServiceAccountに
```
Kubernetes Engine Admin
Kubernetes Engine Cluster Admin
Storage Admin
Storage Object Viewer
```
を与えが、、それで権限ないで意味がわからない。。。イライラ
で、CI ServiceAccountを削除して、作り直し、だめ。。。
で、違う名前のCI ServiceAccountを作成して、OK
意味がわからない。。。
推測で、検証待ち。。
昔、誰が、権限がない同じ名前のCI用ServiceAccountを作成したことがあるからだめが...
2019/01/27
k8s show nfs content
kubectl get pods
kubectl describe pod somepod
kubectl exec nfs-server-pod-name -c containerInPod -it -- /bin/bash
showmount -e localhost
ls ...
2019/01/25
window10 C drive 謎の容量圧迫
C Diverが50G位の空きがあったが、突然赤くなった。。70Mしか空きがない。。。
各FolderのSizeをCheck、明らかに合わない
怪しい物を探し、
C:¥Windows¥Temp
C:¥Windows¥Temp1
が50G位の大きさで、
削除して解決。...
git rebase merge
Mergeを取り消したく、
git rebase -i でしたが、MergeのCommitが出ない
git rebase -i -p commit-number で解決し...
2019/01/24
golang graphql input parameter Args array
```
func someApi() *graphql.Field {
return &graphql.Field{
Type: someType,
Args: graphql.FieldConfigArgument{
"a": &graphql.ArgumentConfig{
Type: graphql.String,
},
"b": &graphql.ArgumentConfig{
Type: graphql.String,
},
"c": &graphql.ArgumentConfig{
Type: graphql.NewList(graphql.Int),
},
},
Resolve: func(p graphql.ResolveParams) (interface{}, error) {
return someType
}
`...
golang interface array to int array
arrInterface := []interface{1,2,3}
var arrInt []int
for _,v := range arrInterface{
arrInt := append(arrInt, v.(int))...
git change upstream branch
git branch -vv
git branch --set-upstream-to origin/someBranch
(git branch -u origin/someBran...
2019/01/21
windows10 sleep wakeup taskschdule
・sleep shutdown.exe /h
・wakeup shutdown.exe /r
ー>最上階位特権で実行
ー>SLeepを解除
ー>ログオフでも実行
・powercfg -h on
休眠モードを有効に
・電源高級オプション
TaskScheduleよりSleep解除を...
2019/01/06
linux usb iso
#ISOをUSBにする
sudo dd if=./xx.iso of=/dev/...
centos network start auto
/etc/sysconfig/net-work-scripts/incfg-ethxxx
-> ONBOOT="y...
centos mount ntfs
```
su
yum -y --enablerepo=epel install dkms fuse-ntfs-3g
fdisk -l
mkdir /mnt/a
mout -t ntfs-3g /dev/sdb1 /mount/a
NTFS-3G is an open source implementation of NTFS that includes read and write support. NTFS-3G developers use the FUSE file system to facilitate development and to help with portability.
vi /etc/fstab
...