mirror of
https://github.com/muerwre/muerwre.github.io.git
synced 2025-04-25 02:46:39 +07:00
1 line
No EOL
14 KiB
JavaScript
1 line
No EOL
14 KiB
JavaScript
export default (function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S){return {data:{navigation:[{title:"Blockchain",_path:"\u002Fblockchain",children:[{title:"Common Typescript Examples",_path:"\u002Fblockchain\u002Fcommon-typescript-examples"},{title:"Smart Contracts",_path:"\u002Fblockchain\u002Fsmart-contracts"}]},{title:"Css",_path:"\u002Fcss",children:[{title:"Automatic Grid Like Masonry With Pure CSS",_path:"\u002Fcss\u002Fautomatic-grid-like-masonry-with-pure-css"},{title:"Sass Nth Child Iterate Mixin",_path:"\u002Fcss\u002Fsass-nth-child-iterate-mixin"},{title:"Test If Browser Supports CSS Rules",_path:"\u002Fcss\u002Ftest-if-browser-supports-css-rules"}]},{title:"Docker",_path:"\u002Fdocker",children:[{title:"Building Static Pages With Docker",_path:"\u002Fdocker\u002Fbuilding-static-pages-with-docker"},{title:"Drone Ci",_path:"\u002Fdocker\u002Fdrone-ci"},{title:"Github Pages With Drone Ci",_path:"\u002Fdocker\u002Fgithub-pages-with-drone-ci"},{title:"Private Docker Registry",_path:"\u002Fdocker\u002Fprivate-docker-registry"},{title:"Refresh Containers On Pull",_path:"\u002Fdocker\u002Frefresh-containers-on-pull"},{title:"Seed Dump Inside Docker",_path:"\u002Fdocker\u002Fseed-dump-inside-docker"},{title:z,_path:A},{title:"Wait For Redis",_path:"\u002Fdocker\u002Fwait-for-redis"}]},{title:"Frontend",_path:"\u002Ffrontend",children:[{title:"React Native",_path:"\u002Ffrontend\u002Freact-native",children:[{title:"OAuth2 Login",_path:"\u002Ffrontend\u002Freact-native\u002Foauth2-login"},{title:"Preserve FlatList Scroll Position In React Native",_path:"\u002Ffrontend\u002Freact-native\u002Fpreserve-flatlist-scroll-position-in-react-native"},{title:"Useful Comands",_path:"\u002Ffrontend\u002Freact-native\u002Fuseful-comands"}]},{title:"React",_path:"\u002Ffrontend\u002Freact",children:[{title:"Axios Refresh Token On React",_path:"\u002Ffrontend\u002Freact\u002Faxios-refresh-token-on-react"},{title:"Axios With AbortController",_path:"\u002Ffrontend\u002Freact\u002Faxios-with-abortcontroller"}]},{title:"Vue",_path:"\u002Ffrontend\u002Fvue",children:[{title:"Adding Global Properties To Component",_path:"\u002Ffrontend\u002Fvue\u002Fadding-global-properties-to-component"},{title:"Make Nuxt Handle Obsidian Highlights",_path:"\u002Ffrontend\u002Fvue\u002Fmake-nuxt-handle-obsidian-highlights"}]},{title:"Webgl",_path:"\u002Ffrontend\u002Fwebgl",children:[{title:"Basics Of WebGL (Drawing A Cube)",_path:"\u002Ffrontend\u002Fwebgl\u002Fbasics-of-webgl-(drawing-a-cube)"},{title:"Fragment Shaders",_path:"\u002Ffrontend\u002Fwebgl\u002Ffragment-shaders"},{title:"Rendering Without Blocking In A Worker",_path:"\u002Ffrontend\u002Fwebgl\u002Frendering-without-blocking-in-a-worker"},{title:"Vertex Shaders",_path:"\u002Ffrontend\u002Fwebgl\u002Fvertex-shaders"}]}]},{title:"Git",_path:"\u002Fgit",children:[{title:"Force Git To Use HTTPS",_path:"\u002Fgit\u002Fforce-git-to-use-https"},{title:"Git Aliases And Useful Commands",_path:"\u002Fgit\u002Fgit-aliases-and-useful-commands"}]},{title:"Golang",_path:"\u002Fgolang",children:[{title:"I18n In Golang",_path:"\u002Fgolang\u002Fi18n-in-golang"}]},{title:"Graphql",_path:"\u002Fgraphql",children:[{title:"Apollo Client Pagination",_path:"\u002Fgraphql\u002Fapollo-client-pagination"},{title:"Refresh Token In Apollo Client",_path:"\u002Fgraphql\u002Frefresh-token-in-apollo-client"}]},{title:"Linux",_path:"\u002Flinux",children:[{title:"Fixing Lagging USB Headphones",_path:"\u002Flinux\u002Ffixing-lagging-usb-headphones"},{title:"Gitea For Git Hosting",_path:"\u002Flinux\u002Fgitea-for-git-hosting"},{title:"Google Photos Alternative With Photoprism",_path:"\u002Flinux\u002Fgoogle-photos-alternative-with-photoprism"},{title:"Linux On Asus Zenbook UM3402 YA",_path:"\u002Flinux\u002Flinux-on-asus-zenbook-um3402-ya"},{title:"Resume Or Start Screen Session",_path:"\u002Flinux\u002Fresume-or-start-screen-session"},{title:"Rsync File With SSH",_path:"\u002Flinux\u002Frsync-file-with-ssh"},{title:"Setting Up NGINX",_path:"\u002Flinux\u002Fsetting-up-nginx"},{title:"SSH",_path:"\u002Flinux\u002Fssh"}]},{title:"Obsidian",_path:"\u002Fobsidian",children:[{title:"Self Hosted Obsidian Sync With CouchDB",_path:"\u002Fobsidian\u002Fself-hosted-obsidian-sync-with-couchdb"}]},{title:"Sql",_path:"\u002Fsql",children:[{title:"MySQL And MariaDB Setup",_path:"\u002Fsql\u002Fmysql-and-mariadb-setup"},{title:"Postgress Setup",_path:"\u002Fsql\u002Fpostgress-setup"}]},{title:"Typescript",_path:"\u002Ftypescript",children:[{title:"Add Global Variable To Window",_path:"\u002Ftypescript\u002Fadd-global-variable-to-window"},{title:"Flatten Object With Periods",_path:"\u002Ftypescript\u002Fflatten-object-with-periods"},{title:"Type Guards",_path:"\u002Ftypescript\u002Ftype-guards"}]}],"content-query-LRHpXC9dvS":{_path:A,_dir:"docker",_draft:r,_partial:r,_locale:"en",_empty:r,title:z,description:"wait-for-it.sh doing a great job of waiting for different services to become alive, but on #MacOs #docker is binding port on container start, seconds before #mysql is ready to accept connections",excerpt:{type:B,children:[{type:a,tag:i,props:{},children:[{type:a,tag:m,props:{href:C,rel:[D]},children:[{type:c,value:E}]},{type:c,value:F}]},{type:a,tag:i,props:{},children:[{type:c,value:G}]},{type:a,tag:i,props:{},children:[{type:c,value:H},{type:a,tag:I,props:{},children:[{type:c,value:J}]},{type:c,value:K}]},{type:a,tag:n,props:{code:s,language:L},children:[{type:a,tag:M,props:{},children:[{type:a,tag:n,props:{__ignoreMap:t},children:[{type:c,value:s}]}]}]},{type:a,tag:i,props:{},children:[{type:a,tag:m,props:{href:N},children:[{type:c,value:O}]}]}]},body:{type:B,children:[{type:a,tag:i,props:{},children:[{type:a,tag:m,props:{href:C,rel:[D]},children:[{type:c,value:E}]},{type:c,value:F}]},{type:a,tag:i,props:{},children:[{type:c,value:G}]},{type:a,tag:i,props:{},children:[{type:c,value:H},{type:a,tag:I,props:{},children:[{type:c,value:J}]},{type:c,value:K}]},{type:a,tag:n,props:{code:s,language:L},children:[{type:a,tag:M,props:{},children:[{type:a,tag:n,props:{__ignoreMap:t},children:[{type:a,tag:b,props:{class:e},children:[{type:a,tag:b,props:{class:u},children:[{type:c,value:"# Waits for mysql to become actually available"}]}]},{type:a,tag:b,props:{class:e},children:[{type:a,tag:b,props:{class:"ct-5c44cd"},children:[{type:c,value:"wait_for_mysql"}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:"() {"}]}]},{type:a,tag:b,props:{class:e},children:[{type:a,tag:b,props:{class:d},children:[{type:c,value:" query="}]},{type:a,tag:b,props:{class:f},children:[{type:c,value:"\"SELECT count(*) FROM users\""}]}]},{type:a,tag:b,props:{class:e},children:[{type:a,tag:b,props:{class:d},children:[{type:c,value:o}]}]},{type:a,tag:b,props:{class:e},children:[{type:a,tag:b,props:{class:d},children:[{type:c,value:" timeout=180 "}]},{type:a,tag:b,props:{class:u},children:[{type:c,value:"# 3 minutes limit"}]}]},{type:a,tag:b,props:{class:e},children:[{type:a,tag:b,props:{class:d},children:[{type:c,value:" i=0"}]}]},{type:a,tag:b,props:{class:e},children:[{type:a,tag:b,props:{class:d},children:[{type:c,value:o}]}]},{type:a,tag:b,props:{class:e},children:[{type:a,tag:b,props:{class:d},children:[{type:c,value:o}]},{type:a,tag:b,props:{class:g},children:[{type:c,value:"while"}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:l}]},{type:a,tag:b,props:{class:g},children:[{type:c,value:"!"}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:" docker "}]},{type:a,tag:b,props:{class:v},children:[{type:c,value:"exec"}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:" -it "}]},{type:a,tag:b,props:{class:f},children:[{type:c,value:j}]},{type:a,tag:b,props:{class:h},children:[{type:c,value:p}]},{type:a,tag:b,props:{class:k},children:[{type:c,value:P}]},{type:a,tag:b,props:{class:f},children:[{type:c,value:j}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:" mysql --user="}]},{type:a,tag:b,props:{class:f},children:[{type:c,value:j}]},{type:a,tag:b,props:{class:h},children:[{type:c,value:p}]},{type:a,tag:b,props:{class:k},children:[{type:c,value:"2"}]},{type:a,tag:b,props:{class:f},children:[{type:c,value:j}]},{type:a,tag:b,props:{class:f},children:[{type:c,value:j}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:" -e "}]},{type:a,tag:b,props:{class:f},children:[{type:c,value:j}]},{type:a,tag:b,props:{class:h},children:[{type:c,value:p}]},{type:a,tag:b,props:{class:k},children:[{type:c,value:"query"}]},{type:a,tag:b,props:{class:f},children:[{type:c,value:j}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:l}]},{type:a,tag:b,props:{class:g},children:[{type:c,value:"do"}]}]},{type:a,tag:b,props:{class:e},children:[{type:a,tag:b,props:{class:d},children:[{type:c,value:" sleep 1"}]},{type:a,tag:b,props:{class:g},children:[{type:c,value:w}]}]},{type:a,tag:b,props:{class:e},children:[]},{type:a,tag:b,props:{class:e},children:[{type:a,tag:b,props:{class:d},children:[{type:c,value:" i="}]},{type:a,tag:b,props:{class:f},children:[{type:c,value:"$(("}]},{type:a,tag:b,props:{class:h},children:[{type:c,value:p}]},{type:a,tag:b,props:{class:k},children:[{type:c,value:x}]},{type:a,tag:b,props:{class:g},children:[{type:c,value:"+"}]},{type:a,tag:b,props:{class:"ct-d89cb3"},children:[{type:c,value:P}]},{type:a,tag:b,props:{class:f},children:[{type:c,value:"))"}]}]},{type:a,tag:b,props:{class:e},children:[{type:a,tag:b,props:{class:d},children:[{type:c,value:Q}]},{type:a,tag:b,props:{class:g},children:[{type:c,value:"if"}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:" [[ "}]},{type:a,tag:b,props:{class:h},children:[{type:c,value:y}]},{type:a,tag:b,props:{class:k},children:[{type:c,value:x}]},{type:a,tag:b,props:{class:h},children:[{type:c,value:q}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:l}]},{type:a,tag:b,props:{class:g},children:[{type:c,value:"-ge"}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:l}]},{type:a,tag:b,props:{class:h},children:[{type:c,value:y}]},{type:a,tag:b,props:{class:k},children:[{type:c,value:"timeout"}]},{type:a,tag:b,props:{class:h},children:[{type:c,value:q}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:" ]]"}]},{type:a,tag:b,props:{class:g},children:[{type:c,value:w}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:l}]},{type:a,tag:b,props:{class:g},children:[{type:c,value:"then"}]}]},{type:a,tag:b,props:{class:e},children:[{type:a,tag:b,props:{class:d},children:[{type:c,value:R}]},{type:a,tag:b,props:{class:v},children:[{type:c,value:"echo"}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:l}]},{type:a,tag:b,props:{class:f},children:[{type:c,value:"\"[Error] can't properly query MySQL after "}]},{type:a,tag:b,props:{class:h},children:[{type:c,value:y}]},{type:a,tag:b,props:{class:k},children:[{type:c,value:x}]},{type:a,tag:b,props:{class:h},children:[{type:c,value:q}]},{type:a,tag:b,props:{class:f},children:[{type:c,value:" secs\""}]}]},{type:a,tag:b,props:{class:e},children:[{type:a,tag:b,props:{class:d},children:[{type:c,value:R}]},{type:a,tag:b,props:{class:v},children:[{type:c,value:"exit"}]},{type:a,tag:b,props:{class:d},children:[{type:c,value:" 1"}]},{type:a,tag:b,props:{class:g},children:[{type:c,value:w}]}]},{type:a,tag:b,props:{class:e},children:[{type:a,tag:b,props:{class:d},children:[{type:c,value:Q}]},{type:a,tag:b,props:{class:g},children:[{type:c,value:"fi"}]}]},{type:a,tag:b,props:{class:e},children:[{type:a,tag:b,props:{class:d},children:[{type:c,value:o}]},{type:a,tag:b,props:{class:g},children:[{type:c,value:"done"}]}]},{type:a,tag:b,props:{class:e},children:[{type:a,tag:b,props:{class:d},children:[{type:c,value:q}]}]},{type:a,tag:b,props:{class:e},children:[]},{type:a,tag:b,props:{class:e},children:[{type:a,tag:b,props:{class:u},children:[{type:c,value:"# usage: wait_for_mysql miin-mysql-dev root password database"}]}]}]}]}]},{type:a,tag:i,props:{},children:[{type:a,tag:m,props:{href:N},children:[{type:c,value:O}]}]},{type:a,tag:"style",children:[{type:c,value:".ct-d89cb3{color:#79C0FF}.ct-57f53a{color:#C9D1D9}.ct-6a4666{color:#C9D1D9}.ct-ac6d12{color:#79C0FF}.ct-5ad744{color:#FF7B72}.ct-df955a{color:#A5D6FF}.ct-de7014{color:#C9D1D9}.ct-5c44cd{color:#D2A8FF}.ct-9dfb0a{color:#8B949E}.light .ct-9dfb0a{color:#93A1A1}.light .ct-5c44cd{color:#268BD2}.light .ct-de7014{color:#657B83}.light .ct-df955a{color:#2AA198}.light .ct-5ad744{color:#859900}.light .ct-ac6d12{color:#268BD2}.light .ct-6a4666{color:#859900}.light .ct-57f53a{color:#268BD2}.light .ct-d89cb3{color:#D33682}"}]}],toc:{title:t,searchDepth:S,depth:S,links:[]}},_type:"markdown",_id:"content:Docker:Wait for mysql.md",_source:"content",_file:"Docker\u002FWait for mysql.md",_extension:"md"}},prerenderedAt:1678974399829}}("element","span","text","ct-de7014","line","ct-df955a","ct-5ad744","ct-6a4666","p","\"","ct-57f53a"," ","a","code"," ","$","}",false,"# Waits for mysql to become actually available\nwait_for_mysql() {\n query=\"SELECT count(*) FROM users\"\n \n timeout=180 # 3 minutes limit\n i=0\n \n while ! docker exec -it \"$1\" mysql --user=\"$2\" --password=\"$3\" -e \"$query\" $4 \u003E\u002Fdev\u002Fnull 2\u003E&1; do\n sleep 1;\n\n i=$(($i+1))\n if [[ ${i} -ge ${timeout} ]]; then\n echo \"[Error] can't properly query MySQL after ${i} secs\"\n exit 1;\n fi\n done\n}\n\n# usage: wait_for_mysql miin-mysql-dev root password database\n","","ct-9dfb0a","ct-ac6d12",";","i","${","Wait For Mysql","\u002Fdocker\u002Fwait-for-mysql","root","https:\u002F\u002Fgithub.com\u002Fvishnubob\u002Fwait-for-it","nofollow","wait-for-it.sh"," doing a great job of waiting for different services to become alive, but on #MacOs #docker is binding port on container start, seconds before #mysql is ready to accept connections","This script waits for first successful query from database or exits with non-zero status after timeout.","Don't forget to change ","code-inline","$query"," for the actually working one.","shell","pre","Wait%20for%20redis","Wait for redis","1"," "," ",2)) |