jq is useful to slice, filter, map and transform structured json data.
brew install jq
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
| " vim: fdm=marker | |
| " An example for a vimrc file. | |
| " | |
| " To use it, copy it to | |
| " for Unix: $XDG_CONFIG_HOME/nvim/init.vim | |
| " for Windows: %LOCALAPPDATA%\nvim\init.vim | |
| " Dein: {{{ | |
| if &compatible | |
| set nocompatible |
| import axios from 'axios'; | |
| // You can use any cookie library or whatever | |
| // library to access your client storage. | |
| import cookie from 'cookie-machine'; | |
| axios.interceptors.request.use(function(config) { | |
| const token = cookie.get(__TOKEN_KEY__); | |
| if ( token != null ) { | |
| config.headers.Authorization = `Bearer ${token}`; |
| # First we update the authorizer to call the right lambda function including the qualifier :xxx at the end of the function ARN | |
| aws apigateway update-authorizer --rest-api-id XXXXXXXXX --authorizer-id XXXXX --patch-operations op=replace,path=/authorizerUri,value=arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:XXXXXXXXXXX:function:Authorize2:AliasOrVersion/invocations | |
| # Then we give API Gateway permission to invoke the authorizer using resource policies on the Lambda function | |
| aws lambda add-permission --function-name Authorize2 --statement-id mystatement12334 --action lambda:InvokeFunction --principal apigateway.amazonaws.com --qualifier AliasOrVersion --source-arn arn:aws:execute-api:us-west-2:XXXXXXXXXXX:XXApiIdXX/authorizers/XXAuthorizerIdXX | |
| # You can check the structure of your authorizer with | |
| aws apigateway get-authorizer --rest-api-id XXXXXX --authorizer-id XXXX | |
| # You can also check the policy against the lambda function with |
https://stackoverflow.com/a/18003462/348146
None of these suggestions worked for me, because Android was appending a sequence number to the package name to produce the final APK file name (this may vary with the version of Android OS). The following sequence of commands is what worked for me on a non-rooted device:
Determine the package name of the app, e.g.
com.example.someapp. Skip this step if you already know the package name.
adb shell pm list packagesLook through the list of package names and try to find a match between the app in question and the package name. This is usually easy, but note that the package name can be completely unrelated to the app name. If you can't recognize the app from the list of package names, try finding the app in Google Play using a browser. The URL for an app in Google Play contains the package name.
This tutorial will turn your Raspberry PI into a simple Bluetooth audio receiver, which plays music through connected speakers. It's like a regular car audio system, but it can be used anywhere and it's a good value.
Audio source (i.e. smartphone)
|
v
((( Wireless Bluetooth Channel )))
|
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
| # vim: set fileencoding=utf-8 : | |
| # | |
| # How to store and retrieve gzip-compressed objects in AWS S3 | |
| ########################################################################### | |
| # | |
| # Copyright 2015 Vince Veselosky and contributors | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at |
| Intent intent = new Intent(Intent.ACTION_VIEW); | |
| ComponentName cn = new ComponentName("com.tencent.mm", "com.tencent.mm.plugin.base.stub.WXCustomSchemeEntryActivity"); | |
| intent.setData(Uri.parse("weixin://dl/moments")); | |
| intent.setFlags(Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP); | |
| intent.setComponent(cn); | |
| startActivity(intent); |