macOS Big Sur (11.0)
today.App Stroe
or Systen Update
DO NOT
click continue
.Finder
and go Applications
, now you should can see Install macOS Big Sur.app
{xxxx}
to your path1 | sudo /{File_Path}/Install\ macOS\ Big\ Sur.app/Contents/Resources/createinstallmedia \ |
Terminal
and run command then system will start make bootable usbCmd(⌘) + R
to get into install OS mode
or recover mode
when downloa was ready and show this window, DO NOT
Click continue
.
open finder, and go “applications” directory on your finder
,
now you can see the file “Install macOS Catalina.app”.
backup to your other directory
Plug USB driver, and format it
Open terminal and paste the commend on below
and replace {xxxx} to your path.
1 | sudo /{File_Path}/Install\ macOS\ Catalina.app/Contents/Resources/createinstallmedia \ |
crypto some string
like s3 bucket key … etc1 | $ docker pull ruby |
1 | $ gem install travis |
1 | $ travis encrypt "some_string_you_want_encrypt" -r wicowen/demo-repo |
travis.yml
1 | notifications: |
ref:
https://github.com/travis-ci/travis.rb#readme
https://docs.travis-ci.com/user/encryption-keys/
install homebrew
use brew install streamlink
1 | $ brew install streamlink |
1 | $ streamlink --hls-live-restart -o 'out.m3u8' 'https://www.youtube.com/watch?v=xxxxx' best |
1 | $ brew install ffmpeg |
1 | $ ffmpeg -i in.m3u8 -acodec copy -bsf:a aac_adtstoasc -vcodec copy out.mp4 |
1 | $ ffmpeg -i out.mp4 -q:a 0 -map a out.mp3 |
1 | $ ffmpeg -ss 60 -t 120 -i in.mp3 -acodec copy out.mp3 |
ref:
https://streamlink.github.io/cli.html
https://github.com/ytdl-org/youtube-dl/issues/11618
https://stackoverflow.com/questions/33108105/converting-an-hls-m3u8-to-mp4
https://superuser.com/questions/332347/how-can-i-convert-mp4-video-to-mp3-audio-with-ffmpeg
https://stackoverflow.com/questions/1390731/how-to-crop-a-mp3-from-x-to-xn-using-ffmpeg
on this case
i will demo a local proxy api
that will redirect all myhttp://localhost/api
request
tohttps://api.somewhere.com/v2/api
this really api server
####1. set your variable into .env file
.env.development.local1
VUE_APP_API_URL=/api
####2. set proxy config
vue.config.js1
2
3
4
5
6
7
8
9
10
11
12
13module.exports = {
devServer: {
proxy: {
'/api': {
target: 'https://api.somewhere.com',
secure: true,
pathRewrite: {
'^/api': '/v2/api',
},
}
},
},
}
####3. use axios call api
api/index.js1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16import axios from 'axios'
export const getResult = (payload) => {
let token = 'your auth token'
let headers = {
'Authorization': `Bearer ${token}`,
'Cache-Control': 'no-cache'
}
const searchResult = axios.create({
baseURL: process.env.VUE_APP_API_URL,
headers: headers
})
return searchResult.get(`/search`, { params: payload })
}
ref:
https://webpack.js.org/configuration/dev-server/#devserverproxy
https://github.com/chimurai/http-proxy-middleware#options
$ vim ~/workspace/docker/vpn/env
1 | VPN_IPSEC_PSK=someword_pre_shared_key |
af_key
kernel module on the Docker host.1 | sudo modprobe af_key |
$ vim /etc/modules-load.d/af_key.conf1
2# Load af_key at boot
af_key
~/.../vpn/env
with your own env
file):1 | $ docker run \ |
1 | $ docker logs ipsec-vpn-server |
1 | $ docker exec -it ipsec-vpn-server ipsec status |
1 | $ docker exec -it ipsec-vpn-server ipsec whack --trafficstatus |
1 | VPN_USER=username |
1 | VPN_PASSWORD=userpwd |
reference :
docker-ipsec-vpn-server
when downloa was ready and show this window, DO NOT
Click continue
.
open finder, and find out your “applications” directory,
now you can see the file “Install macOS Mojave.app”.
backup to your other directory
Plug USB driver, and format it
Open terminal and paste the commend on below
and replace {xxxx} to your path.
1 | sudo /{File Path}/Install\ macOS\ Mojave.app/ \ |
when mac is power off
plug usb driver
hold option
key
power on
select the USB install leader to boot up
go to vscode preferences use “cmd + ,” hotkey.
add this setting to option
1 | "editor.renderWhitespace": "all", |
reference :
github vscode issue
how to check it ?
start a player
(because codec only active when headphone playing sound)
hold the “option” key and click bluetooth icon on system bar
check what the active codec status now
if it is disable
you can use this command to enable it
1 | sudo defaults write bluetoothaudiod "Enable AptX codec" -bool true |
and restart your bluetooth, now it should work
if you wanna set back to default just set true to false
1 | sudo defaults write bluetoothaudiod "Enable AptX codec" -bool false |
reference :
macrumors
1 | expect(2).to.equal(2); |
and postman support this library,
so here is a sample test script,
that will validate :
here is the code
1 |
|
git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repogit remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.gitgit fetch upstream
git pull upstream master
]]>that can easily create a basic frontend web site
with alot morden tools (js lint, unit test, e2e test … etc)
here is some note for trying integration whole project
the workflow is
send a commit to github repo
travis-ci get the repo update then start build task
after task done without error
run deploy shell,
login to vps server use encrypted ssh key
push local tested repo to vps
reference :
Deploy static sites to Digital Ocean with Travis CI
https://monicalent.com/blog/2017/12/21/deploy-static-sites-digital-ocean-travis/
https://medium.com/@tibotiber/deployment-of-static-websites-to-digital-ocean-using-travisci-957e6e0f1f9d
https://kjaer.io/travis/
Auto Authorize SSH Auth Requests on Travis CI
https://stackoverflow.com/questions/16638573/auto-authorize-ssh-auth-requests-on-travis-ci
Travis CI skip_cleanup
https://docs.travis-ci.com/user/deployment#Uploading-Files-and-skip_cleanup
Karma - change to chrome headless
https://developers.google.com/web/updates/2017/06/headless-karma-mocha-chai
http://karma-runner.github.io/0.13/config/browsers.html
i usually watch this to training my listen skill,
but sometime, when i need check a not sure word,
i need :
pause video
switch subtitle to english look what he say
switch back to chinese
that was annoying.
until i found a chrome/firefox plugin NflxMultiSubs
that plugin can let you show two subtitle at sometime.
it is easy install,
just go his repo
click the plugin icon what browser you are using
after install, reopen it and enjoy it.
]]>iStat Menus need upgrade or will keep crash when launch,
but iStat Menus 3 need pay to upgrade iStat Menus 4,
and not have any new feature i need.
(i only need memory and network tray on status bar)
so i find alternative software it call “MenuMeters”.
Setup
download MenuMeters from web and install it.
after install you can see the icon poped on “system preferences”
setting up what you want monitor
add repo to yum
1 | cd /etc/yum.repos.d/ |
edit config
1 | $vim /etc/shadowsocks-libev/config.json |
check config workfine
1 | ss-server -c /etc/shadowsocks-libev/config.json |
start service
systemctl restart shadowsocks-libev
systemctl enable shadowsocks-libev
check log
1 | journalctl -u shadowsocks-libev |
1 | ss-local: error while loading shared libraries: libmbedcrypto.so.0: cannot open shared object file: No such file or directory |
install “mbedtls-devel”1
2
3
4$ yum install mbedtls-devel
$ cd /usr/lib64
$ ls |grep mbed
$ ln -sf libmbedcrypto.so.1 libmbedcrypto.so.0
reference:
https://zzz.buzz/zh/gfw/2017/08/14/install-shadowsocks-server-on-centos-7/
https://github.com/shadowsocks/shadowsocks-libev/issues/1966
certbot version need >= 0.22.0
you need admin permission that can modify dns config
check certbot version
1 | # certbot --version |
run commend then add txt record to your domain and to prove you have own it.
1 | #certbot -d *.wico.cc \ |
you will see the value that you need add to dns1
2
3
4
5
6
7
8-------------------------------------------------
Please deploy a DNS TXT record under the name
_acme-challenge.wico.cc with the following value:
PKNhsaOWpAUT-hLxoP1dNQum6in________________
Before continuing, verify the record is deployed.
-------------------------------------------------
add value to your dns
BTW if you not have do this step you will get a error message blow this.1
2
3Client with the currently selected authenticator does not support
any combination of challenges that will satisfy the CA.
You may need to use an authenticator plugin that can do challenges over DNS.
3.
setting up your wildcard domain1
2
3
4
5
6# certbot \
--authenticator standalone \
--installer nginx \
--pre-hook "systemctl stop nginx.service" \
--post-hook "systemctl start nginx.service" \
--server https://acme-v02.api.letsencrypt.org/directory
1 | Saving debug log to /var/log/letsencrypt/letsencrypt.log |
now you can see your web site was change to wildcard certificate
how to review ?1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$ systemctl stop nginx.service
$ ps -aux | grep nginx
$ kill {pid}
$ certbot certificates
$ certbot -d *.wico.cc --manual --preferred-challenges dns certonly --pre-hook "systemctl stop nginx.service" --post-hook "systemctl start nginx.service" --server https://acme-v02.api.letsencrypt.org/directory
#update dns
#wait 2 min
$ certbot renew
$ certbot certificates
$ systemctl stop nginx.service
$ systemctl start nginx.service
chrome://flags
to your Chrome URL barRestart Chrome
Open postman, right click mouse to open inspect menu.
example :
api create a new data and return id,
you wanna keep this id for update,
delete api to use.
add this code at postman’s tab
//take response datavar jsonData = JSON.parse(responseBody);//set variablepostman.setEnvironmentVariable("acy_guid", jsonData.data.acy_guid);
]]>now here have a app can solve this problem
github.com/tekezo/Karabiner-Elements
after install
swap key that you wanna remap
chose what device you wanna follow this rule.