tag:blogger.com,1999:blog-75233256056577550522024-01-11T22:32:03.724+01:00James AttardThis blog will teach you everything about running an online business and make money online. I will also coach you to adopt a success mindset that will boost your confidence in your professional and personal life.Jameshttp://www.blogger.com/profile/08002241344195819468noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-7523325605657755052.post-1299197905835190842023-10-20T11:40:00.008+02:002023-10-20T11:48:04.046+02:00Install Ubuntu Server on VMWare<p>This article is going to walk you through an actual scenario where you will install Ubuntu Server on VMWare. You will learn the step-by-step installation process, configure standard settings such as updating the installer, configure an IP address, configure disks, add a root user account and configure a hostname, configure remote access using SSH, and finally, perform post-installation updates. </p><p><br /></p><h3 style="text-align: left;">Prerequisites</h3><div>To follow along, make sure you have the following installed:</div><div><ul style="text-align: left;"><li>The latest <a href="https://ubuntu.com/download/server" rel="nofollow" target="_blank">Ubuntu Server ISO</a></li><li>VMWare ESXi, <a href="https://www.vmware.com/products/workstation-player.html" rel="nofollow" target="_blank">Player or Workstation</a></li></ul><div><br /></div></div><h3 style="text-align: left;">Add New Virtual Machine</h3><div>From the VMWare software, right click on the Library on the left hand side, and choose New Virtual Machine:</div><div><br /></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEjmPJaVGd6uMn0lZAjS51IjnkgxBgaO84eOrzOnW2cllSMBs1HNPJBVVq5rpmI7bvZXBiQOZzBz6_lP_A6Y-Re5IU2ACRO2aCOSofEsmgIw52xns4RhW36wwGilFdgZKxJZnMssxMAJ8JuuKySQzMmV3AvRKoIx9HPz6p1BO692G2sNtB9rkFOKTYM0" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="490" data-original-width="869" height="180" src="https://blogger.googleusercontent.com/img/a/AVvXsEjmPJaVGd6uMn0lZAjS51IjnkgxBgaO84eOrzOnW2cllSMBs1HNPJBVVq5rpmI7bvZXBiQOZzBz6_lP_A6Y-Re5IU2ACRO2aCOSofEsmgIw52xns4RhW36wwGilFdgZKxJZnMssxMAJ8JuuKySQzMmV3AvRKoIx9HPz6p1BO692G2sNtB9rkFOKTYM0=w320-h180" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: left;"><br /></div><br />You will be greeted with the New Virtual Machine Wizard, and simply go for the default recommended options:</div><div><br /></div><div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEhmbv8RtYDdxetcp82orUCATlYRjRCf6WGdxW3EWclxFAaejZPmE-cmn9v0Ll97_OToPA4unCiZMSArS1mecEImV5tDF57xhUsREfWx9Pg7rVEITXkVd2Q_tAgQ5WBZA05gRPvYbX8Ama6Je98lps1oevrBb2yt-L8ylJTxhGOkxLSk89bkU-0oUgBl" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="427" data-original-width="425" height="240" src="https://blogger.googleusercontent.com/img/a/AVvXsEhmbv8RtYDdxetcp82orUCATlYRjRCf6WGdxW3EWclxFAaejZPmE-cmn9v0Ll97_OToPA4unCiZMSArS1mecEImV5tDF57xhUsREfWx9Pg7rVEITXkVd2Q_tAgQ5WBZA05gRPvYbX8Ama6Je98lps1oevrBb2yt-L8ylJTxhGOkxLSk89bkU-0oUgBl" width="239" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: left;">Make sure to go load your ISO as the Installer disc image file:</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEh0s4TykpOn9AKuJ80gl4J9FXDcswV0bDS6EAXW9kWKwmbMGbo4ZjwBToGB9ZWX9uzCq0mT_8oIu20oC2VKvFjUs4KozaVUPnBz9b-ZzTW3JefrVs8r1Ayti2b1bC0cbbhF69Y3LVLF65kAicCxWv4PiDxAWbap3q9cDU98CCE4uv8r4dC1GYd7xeAt" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="421" data-original-width="423" height="240" src="https://blogger.googleusercontent.com/img/a/AVvXsEh0s4TykpOn9AKuJ80gl4J9FXDcswV0bDS6EAXW9kWKwmbMGbo4ZjwBToGB9ZWX9uzCq0mT_8oIu20oC2VKvFjUs4KozaVUPnBz9b-ZzTW3JefrVs8r1Ayti2b1bC0cbbhF69Y3LVLF65kAicCxWv4PiDxAWbap3q9cDU98CCE4uv8r4dC1GYd7xeAt" width="241" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: left;">And then choose suitable username / password for your virtual machine:</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEhj3QK5KRxDs7D7dHs9nQDWVEoldPTm07p7Mc7kecPzixYk2uMdJJfAHZa3w61wlC03JC7bhSYQrjxFMNYshnvKVdKRlL7BBTnUcTp-r8L1M5vB-wl0xiJmsy9hGWxWX5FXjSJ_s_Sq0BHytw0VPBBkbFKGl5AWYo-Dsu6iXJEtiHaJeCEGMouEfGqB" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="431" data-original-width="430" height="240" src="https://blogger.googleusercontent.com/img/a/AVvXsEhj3QK5KRxDs7D7dHs9nQDWVEoldPTm07p7Mc7kecPzixYk2uMdJJfAHZa3w61wlC03JC7bhSYQrjxFMNYshnvKVdKRlL7BBTnUcTp-r8L1M5vB-wl0xiJmsy9hGWxWX5FXjSJ_s_Sq0BHytw0VPBBkbFKGl5AWYo-Dsu6iXJEtiHaJeCEGMouEfGqB" width="239" /></a></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><br /></div>Choose an appropriate name for your virtual machine, followed by disk capacity (I usually recommend around 20GB), and when you are ready, click Finish:</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEi4jApZoulUL-kexWeKXi6D9boceKV4Z4S7ISIzBcgvPqWYW_878czuowPTSWq189ntcv2yiQLAm0FBbNqQBZc5v_43Ui82HoOxyKYtyewQGZzoqSSWxsvNZwxRbvTW77TeS052PnIAzktPZ9JIM_jYXQX9FPGmN63XFpZiVHNrwru7rf4bI765gP2a" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="427" data-original-width="417" height="240" src="https://blogger.googleusercontent.com/img/a/AVvXsEi4jApZoulUL-kexWeKXi6D9boceKV4Z4S7ISIzBcgvPqWYW_878czuowPTSWq189ntcv2yiQLAm0FBbNqQBZc5v_43Ui82HoOxyKYtyewQGZzoqSSWxsvNZwxRbvTW77TeS052PnIAzktPZ9JIM_jYXQX9FPGmN63XFpZiVHNrwru7rf4bI765gP2a" width="234" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: left;">Your new virtual machine will now boot with the Linux Installation process.</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><h3>Installing the Linux operating system</h3><div>This is actually the easiest part since you simply follow the on-screen instructions. For the most part, just choose the default options and click on Next.</div><div><br /></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEhy3R-C0wf5pmlV2vpzwFL6Rt6H0V9HULRwLUZsaUqsoVaAx1uwUR1Xq_L4OVf22hl-2HF4UZG6meQXJr6raxkD9F9ip3dyVdGnrFB6M4AontDO-JLJUREQhHViRK3hzTOPWsZCXgUroZ_XVGwEsMhRt8e60XSEp4-uoZ4Odw5oGTrsY2wrNTnF7d1_" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="337" data-original-width="1024" height="105" src="https://blogger.googleusercontent.com/img/a/AVvXsEhy3R-C0wf5pmlV2vpzwFL6Rt6H0V9HULRwLUZsaUqsoVaAx1uwUR1Xq_L4OVf22hl-2HF4UZG6meQXJr6raxkD9F9ip3dyVdGnrFB6M4AontDO-JLJUREQhHViRK3hzTOPWsZCXgUroZ_XVGwEsMhRt8e60XSEp4-uoZ4Odw5oGTrsY2wrNTnF7d1_" width="320" /></a></div><br /><br /></div></div>Leave everything default as it is, until you hit the formatting and partitioning of the disk where you will be installing the operating system. When you get to this screen, just click on continue:</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEjz4BlRaZcG7MGBQHsjMyi9c7zkJNe6m_iQJ1vNu8TsyicpiVKMcgMjhoIy0-tF61H7y7csDoT1E5sxolAm1vjiXVXlFnx93IykAtVSKQmNQ2QJVUm8kN_ROwTOIUiJsSqggEn8Vy7MTOtHy2poArTgUKg3UZO-21bbXdLE_XHOR5TZiJUAsKnSmN30" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="768" data-original-width="1024" height="240" src="https://blogger.googleusercontent.com/img/a/AVvXsEjz4BlRaZcG7MGBQHsjMyi9c7zkJNe6m_iQJ1vNu8TsyicpiVKMcgMjhoIy0-tF61H7y7csDoT1E5sxolAm1vjiXVXlFnx93IykAtVSKQmNQ2QJVUm8kN_ROwTOIUiJsSqggEn8Vy7MTOtHy2poArTgUKg3UZO-21bbXdLE_XHOR5TZiJUAsKnSmN30" width="320" /></a></div><div class="separator" style="clear: both; text-align: left;"><br /></div>While Ubuntu is being installed, you will be greeted by some other screens. First one will be to setup a new user profile in your Linux system:</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEh18IksnL6xm6Xwyrla6gc8WxafWe6v-kiFa8f-TPakPU4F7p2uK8MUKyj6QhT43aMGcfN4ylEpZb7UODVUoVsM4wDWQOcJMZANMOrmuTWwF1XxodLMDyUQR4nhYga8J9BU2dMT15MbaOqMwfy6kgQNeopE7zUXMOmNjm4V1KLdJ1De6znKzGfVDGFh" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="768" data-original-width="1024" height="240" src="https://blogger.googleusercontent.com/img/a/AVvXsEh18IksnL6xm6Xwyrla6gc8WxafWe6v-kiFa8f-TPakPU4F7p2uK8MUKyj6QhT43aMGcfN4ylEpZb7UODVUoVsM4wDWQOcJMZANMOrmuTWwF1XxodLMDyUQR4nhYga8J9BU2dMT15MbaOqMwfy6kgQNeopE7zUXMOmNjm4V1KLdJ1De6znKzGfVDGFh" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: left;"><br /></div>When you get to the SSH Server setup, make sure that this option is enabled as follows:</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEj8Gn3mCAqK-72QQbVX8dvGRHkNkO2NKLdGVOUZ8fTUHalsZn9xZ0qMUHz4_EkXMNoJd6iSURvPUm_5b3DjfUfw31ue7dnGrKWdkl_-Wr-yOFzOdB7_-m459mLgSaeofI0NO4m6taKc7QAMY36QcY3GfdSkP9LCathfPBkvvLdcJiA6PgbtZP7HDkqx" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="768" data-original-width="1024" height="240" src="https://blogger.googleusercontent.com/img/a/AVvXsEj8Gn3mCAqK-72QQbVX8dvGRHkNkO2NKLdGVOUZ8fTUHalsZn9xZ0qMUHz4_EkXMNoJd6iSURvPUm_5b3DjfUfw31ue7dnGrKWdkl_-Wr-yOFzOdB7_-m459mLgSaeofI0NO4m6taKc7QAMY36QcY3GfdSkP9LCathfPBkvvLdcJiA6PgbtZP7HDkqx" width="320" /></a></div><br /><br /><br />In the next screen there is no need to install any features, however to install anything you deem interesting for you:</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEgQhMt0Q2xpmPWsQ7m_Z7GqDVR5xLEqeMoU7nnY9qD9lbANRdKgAH1R9imb0ywF8zgbXBJrZgCyx1B6brrpSGSXMpCKQRM3b4giXTy7fsk7dUlLm5dNGhtTLKlcPv9k6Vsf2laNgmvr4KDl_DoRDkw5z_x3M7DwUcNX8yLmGJcu7cUL9lmLrAM5un-j" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="768" data-original-width="1024" height="240" src="https://blogger.googleusercontent.com/img/a/AVvXsEgQhMt0Q2xpmPWsQ7m_Z7GqDVR5xLEqeMoU7nnY9qD9lbANRdKgAH1R9imb0ywF8zgbXBJrZgCyx1B6brrpSGSXMpCKQRM3b4giXTy7fsk7dUlLm5dNGhtTLKlcPv9k6Vsf2laNgmvr4KDl_DoRDkw5z_x3M7DwUcNX8yLmGJcu7cUL9lmLrAM5un-j" width="320" /></a></div><br />Now the system will take some time to complete the installation. When this step is ready, you will be asked to reboot:</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEjlVmES-EGT23c4MQfUyyAF-sL9pXo5v2pboDKyPzY2r72GKUPabOqYdhkpm9uZQYPiZ5QUAraeXmOAqk6-_6EAvrtBVyFpwcZ5ccqhx4nA-wzin5e5KJgD9Iw3-2Qdoi7f4eKwsXdF02Z0j7PcAqPi0B8v3ptEH6Ma4ybfBXed5ICVHyezWCsBgpSE" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="768" data-original-width="1024" height="240" src="https://blogger.googleusercontent.com/img/a/AVvXsEjlVmES-EGT23c4MQfUyyAF-sL9pXo5v2pboDKyPzY2r72GKUPabOqYdhkpm9uZQYPiZ5QUAraeXmOAqk6-_6EAvrtBVyFpwcZ5ccqhx4nA-wzin5e5KJgD9Iw3-2Qdoi7f4eKwsXdF02Z0j7PcAqPi0B8v3ptEH6Ma4ybfBXed5ICVHyezWCsBgpSE" width="320" /></a></div><br /><br />After the reboot, you can enter the system using the username and password that you created in the User Profile step. Once you log inside the system, determine the IP address of your machine by entering the following command:</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><div><pre style="background: linear-gradient(rgba(0, 0, 0, 0.05) 50%, transparent 50%, transparent) 0px 0px / 100% 50px rgb(44, 62, 80); border: 0px; line-height: 25px; margin-bottom: 10px; margin-top: 15px; outline: 0px; overflow-wrap: normal; overflow: hidden; padding: 0px 7px; position: relative; vertical-align: baseline;"><span style="color: #f1f1f1; font-family: Monaco, Andale Mono, Courier New, Courier, monospace;"><span style="font-size: 14px;">$ ip a</span></span></pre></div><div><br /></div></div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><h3>Access the Virtual Machine using SSH</h3><div>In the installation process described in the previous steps, an SSH server was installed. It is recommended to use the system using an SSH terminal such as Powershell, rather than the VMWare console. You can ssh into your system by using the following syntax:</div><div><br /></div><div><div><pre style="background: linear-gradient(rgba(0, 0, 0, 0.05) 50%, transparent 50%, transparent) 0px 0px / 100% 50px rgb(44, 62, 80); border: 0px; line-height: 25px; margin-bottom: 10px; margin-top: 15px; outline: 0px; overflow-wrap: normal; overflow: hidden; padding: 0px 7px; position: relative; vertical-align: baseline;"><span style="color: #f1f1f1; font-family: Monaco, Andale Mono, Courier New, Courier, monospace;"><span style="font-size: 14px;">$ ssh [username]@[IP_Address]</span></span></pre></div><div><br /></div></div><br /></div>This will look something like this:</div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgw18whxRhlwZKW7qRrGPKqHQ_qiP4eIPaaf8BVPmkqSK-q4SeEHMSiUgwEIF9WGjcnuUNq-6mJqs_QfHfJTxyVJiRaZ5p43aT5px29Utf90QumsNooasuRmOg4kRZ6Q2200C2moDEk1meDyT2Yhsw5Kev4Tf8_w3AXoX6FJW5f-NsEKkcRi23xXamI/s1355/XPOpdxs5fl.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="744" data-original-width="1355" height="220" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgw18whxRhlwZKW7qRrGPKqHQ_qiP4eIPaaf8BVPmkqSK-q4SeEHMSiUgwEIF9WGjcnuUNq-6mJqs_QfHfJTxyVJiRaZ5p43aT5px29Utf90QumsNooasuRmOg4kRZ6Q2200C2moDEk1meDyT2Yhsw5Kev4Tf8_w3AXoX6FJW5f-NsEKkcRi23xXamI/w400-h220/XPOpdxs5fl.gif" width="400" /></a></div><br /><div class="separator" style="clear: both; text-align: center;"><br /></div><br /><br /><br /></div><div class="separator" style="clear: both;"><h3>Update your Ubuntu Server</h3><div>Now that you have accessed your machine through SSH, you can update all your packages and software by running this command:</div><div><br /></div><div><div><pre style="background: linear-gradient(rgba(0, 0, 0, 0.05) 50%, transparent 50%, transparent) 0px 0px / 100% 50px rgb(44, 62, 80); border: 0px; line-height: 25px; margin-bottom: 10px; margin-top: 15px; outline: 0px; overflow-wrap: normal; overflow: hidden; padding: 0px 7px; position: relative; vertical-align: baseline;"><span style="color: #f1f1f1; font-family: Monaco, Andale Mono, Courier New, Courier, monospace;"><span style="font-size: 14px;">$ sudo apt update -y</span></span></pre></div><div><br /></div></div><br /></div>Well done! You now have a fully working Ubuntu server running with the latest updates.<br /><br /></div>Jameshttp://www.blogger.com/profile/08002241344195819468noreply@blogger.com0Malta35.937496 14.3754167.6272621638211575 -20.780834 64.247729836178848 49.531666tag:blogger.com,1999:blog-7523325605657755052.post-25697286093852840292023-09-28T15:24:00.006+02:002023-10-06T14:20:51.330+02:00Locked out of a Wordpress Azure Web App?<p><span color="rgba(0, 0, 0, 0.9)" face="-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif" style="background-color: white;">Azure provides a hosting service, known as Web Apps, where you can easily deploy applications such as WordPress, with almost one click, saving you all the brunt of installing and configuring the entire machine yourself. This is all and good, especially for the non-engineer who does not need to know what is happening behind the scenes - just log into your WordPress and focus on content management.</span></p><p>The problem arises when for some reasons, you get locked out of WordPress, for example due to a bad plugin installation, or even worse, a security breach. A lot of people just give up and spin a new Web App, which might work if you have a simple site with simple backup/restore mechanism. </p><p>But if you want to actually log inside the machine and take a look to remove the offending plugin or issue?</p><p><span style="background-color: white;">Fear not, Azure provides an SSH option to your Web App! </span></p><p><span color="rgba(0, 0, 0, 0.9)" face="-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif" style="background-color: white;"><br /></span></p><p><span color="rgba(0, 0, 0, 0.901960784313726)" face="-apple-system, system-ui, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Fira Sans, Ubuntu, Oxygen, Oxygen Sans, Cantarell, Droid Sans, Apple Color Emoji, Segoe UI Emoji, Segoe UI Emoji, Segoe UI Symbol, Lucida Grande, Helvetica, Arial, sans-serif"></span></p><div class="separator" style="clear: both; text-align: center;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEg-ZFTkm7dFoFG8yD17gLktQp1VMt5oxfsHT0TH6Pvkmmj15DHwilvRs0M6ZRHuK5EUSK9jP_CKgA95z8mv0SxZnNi0ulKC-Hr65ikv3awXGzJCKyoxc7MBsD4mt4uOCdAnmJE36wgmIR5ahAUY7VMfbDwioCJ0H6XzzlLoN3LJfhPZ5lIXx02VYcSx" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="620" data-original-width="817" height="240" src="https://blogger.googleusercontent.com/img/a/AVvXsEg-ZFTkm7dFoFG8yD17gLktQp1VMt5oxfsHT0TH6Pvkmmj15DHwilvRs0M6ZRHuK5EUSK9jP_CKgA95z8mv0SxZnNi0ulKC-Hr65ikv3awXGzJCKyoxc7MBsD4mt4uOCdAnmJE36wgmIR5ahAUY7VMfbDwioCJ0H6XzzlLoN3LJfhPZ5lIXx02VYcSx" width="316" /></a></div><br /><br /></div><br /><div class="separator" style="clear: both; text-align: left;">The SSH option can be found in your Azure Portal dashboard under Development Tools. Once you click this option, you will be redirected to a web ssh terminal and automatically logged as root. Since you are in root, you need to be extra careful. </div><div class="separator" style="clear: both; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: left;">Next step is to locate the WordPress root folder which can be found inside /home/site/wwwroot/. </div><span color="rgba(0, 0, 0, 0.901960784313726)" face="-apple-system, system-ui, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Fira Sans, Ubuntu, Oxygen, Oxygen Sans, Cantarell, Droid Sans, Apple Color Emoji, Segoe UI Emoji, Segoe UI Emoji, Segoe UI Symbol, Lucida Grande, Helvetica, Arial, sans-serif"><span color="rgba(0, 0, 0, 0.901960784313726)" face="-apple-system, system-ui, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Fira Sans, Ubuntu, Oxygen, Oxygen Sans, Cantarell, Droid Sans, Apple Color Emoji, Segoe UI Emoji, Segoe UI Emoji, Segoe UI Symbol, Lucida Grande, Helvetica, Arial, sans-serif"><div><div><br /></div></div><div><div><div><br /></div><div><pre style="background: linear-gradient(rgba(0, 0, 0, 0.05) 50%, transparent 50%, transparent) 0px 0px / 100% 50px rgb(44, 62, 80); border: 0px; line-height: 25px; margin-bottom: 10px; margin-top: 15px; outline: 0px; overflow-wrap: normal; overflow: hidden; padding: 0px 7px; position: relative; vertical-align: baseline;"><span style="color: #f1f1f1; font-family: Monaco, Andale Mono, Courier New, Courier, monospace;"><span style="font-size: 14px;"># cd /home/site/wwwroot/
</span></span></pre></div><div><h5 style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; color: #2c3e50; font-family: Quicksand, sans-serif; font-size: 16px; margin: 0px 0px 15px; outline: 0px; padding: 0px; vertical-align: baseline;"><br /></h5></div></div></div><div>From there you can easily troubleshoot, delete or move around your faulty plugins.</div></span></span>Jameshttp://www.blogger.com/profile/08002241344195819468noreply@blogger.com0tag:blogger.com,1999:blog-7523325605657755052.post-35118174780104906142023-09-20T08:47:00.007+02:002023-10-06T14:21:08.903+02:00Installing Laravel 10 Docker on Windows 11<p><span color="rgba(0, 0, 0, 0.9)" face="-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif" style="background-color: white;">Installation of Laravel 10 and earlier versions on Windows 11 Docker can be a daunting process. In this article I want show you two easy ways to get it done quickly using Docker containers:</span></p><p><span color="rgba(0, 0, 0, 0.9)" face="-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif" style="background-color: white;">✅ WSL Docker Method</span><br style="background-color: white; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; line-height: inherit;" /><br style="background-color: white; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; line-height: inherit;" /><span color="rgba(0, 0, 0, 0.9)" face="-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif" style="background-color: white;">✅ Local Docker Method</span></p><p><span color="rgba(0, 0, 0, 0.901960784313726)" face="-apple-system, system-ui, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Fira Sans, Ubuntu, Oxygen, Oxygen Sans, Cantarell, Droid Sans, Apple Color Emoji, Segoe UI Emoji, Segoe UI Emoji, Segoe UI Symbol, Lucida Grande, Helvetica, Arial, sans-serif"></span></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZG9_ckNSykE1o5B6BnYpBaGue-ms5bKKpN-uzBcQLRdiAXmnwhsmOWVikSnWFINWEASmP3mXhRcpGvLO6xLO8bnkJiUJBVNU_C_hoAxg3eMkm2-t5z-lijCW14KAmG7aX63zIdjM-z3Xwc4yF9fR3ejzt5xH0K3AStxgZmufoaqWohMLWFRoNoZPT/s2048/380870235_264091603203617_6854280580227906878_n.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="2048" data-original-width="1536" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZG9_ckNSykE1o5B6BnYpBaGue-ms5bKKpN-uzBcQLRdiAXmnwhsmOWVikSnWFINWEASmP3mXhRcpGvLO6xLO8bnkJiUJBVNU_C_hoAxg3eMkm2-t5z-lijCW14KAmG7aX63zIdjM-z3Xwc4yF9fR3ejzt5xH0K3AStxgZmufoaqWohMLWFRoNoZPT/s320/380870235_264091603203617_6854280580227906878_n.jpg" width="240" /></a></div><br /><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><br /></div><span color="rgba(0, 0, 0, 0.901960784313726)" face="-apple-system, system-ui, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Fira Sans, Ubuntu, Oxygen, Oxygen Sans, Cantarell, Droid Sans, Apple Color Emoji, Segoe UI Emoji, Segoe UI Emoji, Segoe UI Symbol, Lucida Grande, Helvetica, Arial, sans-serif"><span color="rgba(0, 0, 0, 0.901960784313726)" face="-apple-system, system-ui, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Fira Sans, Ubuntu, Oxygen, Oxygen Sans, Cantarell, Droid Sans, Apple Color Emoji, Segoe UI Emoji, Segoe UI Emoji, Segoe UI Symbol, Lucida Grande, Helvetica, Arial, sans-serif"><h3 style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; color: #2c3e50; font-family: Quicksand, sans-serif; font-size: 21px; margin: 0px 0px 15px; outline: 0px; padding: 0px; vertical-align: baseline;">WSL Docker Method</h3><div><div>The WSL method is the one recommended by Laravel. This is the go to option especially if you are not running Windows 11. More details can be found here: <a href="https://laravel.com/docs/10.x#getting-started-on-windows">https://laravel.com/docs/10.x#getting-started-on-windows</a></div><div><br /></div><div><h5 style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; color: #2c3e50; font-family: Quicksand, sans-serif; font-size: 16px; margin: 0px 0px 15px; outline: 0px; padding: 0px; vertical-align: baseline;">Step 1. Install WSL</h5></div><div>WSL can be installed from the command line. Open a PowerShell prompt as an Administrator (we recommend using Windows Terminal) and run:</div><div><div><pre style="background: linear-gradient(rgba(0, 0, 0, 0.05) 50%, transparent 50%, transparent) 0px 0px / 100% 50px rgb(44, 62, 80); border: 0px; line-height: 25px; margin-bottom: 10px; margin-top: 15px; outline: 0px; overflow-wrap: normal; overflow: hidden; padding: 0px 7px; position: relative; vertical-align: baseline;"><span style="color: #f1f1f1; font-family: Monaco, Andale Mono, Courier New, Courier, monospace;"><span style="font-size: 14px;">PS C:\Users\james> wsl --install</span></span></pre></div></div><div><br /></div><h5 style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; color: #2c3e50; font-family: Quicksand, sans-serif; font-size: 16px; margin: 0px 0px 15px; outline: 0px; padding: 0px; vertical-align: baseline;">Step 2. Install Docker Desktop</h5><div>Download and install Docker Desktop for Windows. In the settings enable WSL2 integration (Settings -> Resources -> WSL Integration). Make sure to also enable integration with additional distros.</div><div><br /></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn5VHhgs0rGLJimE4yiMBnhOsQYi-lFA0At9srzbUcDbsMu5DBkgHeOfwMUYqZ_7jdQSZmlU2D6cDAxw8CZJZFruyF_LKo_tABdTXfHLOgOsnCPD54nztzN9ZZHywr-ejmpLoT3oIO0z8a9I9ae-W-Y8yYq44qyebDMuZSFgsHPO3HAYOgNqKDWrDR/s846/docker%20desktop%20wsl.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="544" data-original-width="846" height="206" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn5VHhgs0rGLJimE4yiMBnhOsQYi-lFA0At9srzbUcDbsMu5DBkgHeOfwMUYqZ_7jdQSZmlU2D6cDAxw8CZJZFruyF_LKo_tABdTXfHLOgOsnCPD54nztzN9ZZHywr-ejmpLoT3oIO0z8a9I9ae-W-Y8yYq44qyebDMuZSFgsHPO3HAYOgNqKDWrDR/s320/docker%20desktop%20wsl.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div></div><div><br /></div><div><h5 style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; color: #2c3e50; font-family: Quicksand, sans-serif; font-size: 16px; margin: 0px 0px 15px; outline: 0px; padding: 0px; vertical-align: baseline;">Step 3. Install Laravel</h5></div><div>Open a new WSL terminal and enter the following command:</div><div>curl -s https://laravel.build/example-app | bash</div><div><div><pre style="background: linear-gradient(rgba(0, 0, 0, 0.05) 50%, transparent 50%, transparent) 0px 0px / 100% 50px rgb(44, 62, 80); border: 0px; line-height: 25px; margin-bottom: 10px; margin-top: 15px; outline: 0px; overflow-wrap: normal; overflow: hidden; padding: 0px 7px; position: relative; vertical-align: baseline;"><span style="color: #f1f1f1; font-family: Monaco, Andale Mono, Courier New, Courier, monospace;"><span style="font-size: 14px;">$ curl -s https://laravel.build/example-app | bash</span></span></pre></div></div><div><br /></div><div>This will run the following commands:</div><div><pre style="background: linear-gradient(rgba(0, 0, 0, 0.05) 50%, transparent 50%, transparent) 0px 0px / 100% 50px rgb(44, 62, 80); border: 0px; line-height: 25px; margin-bottom: 10px; margin-top: 15px; outline: 0px; overflow-wrap: normal; overflow: hidden; padding: 0px 7px; position: relative; vertical-align: baseline;"><span style="color: #f1f1f1; font-family: Monaco, Andale Mono, Courier New, Courier, monospace;"><span style="font-size: 14px;">$ cd yourAppName
$ ./vendor/bin/sail up</span></span></pre></div><div><br /></div><div>Sails is the wrapper that is used to manage your Laravel application. You can now access the application on your browser: http://localhost</div></div><div><br /></div><div>To develop your application you can use Visual Studio Code and enable remote development to your WSL environment, using one of the available free plugins.</div><div><br /></div><div><h3 style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; color: #2c3e50; font-family: Quicksand, sans-serif; font-size: 21px; margin: 0px 0px 15px; outline: 0px; padding: 0px; vertical-align: baseline;">Local Docker Method</h3><div><div>I personally prefer this method as I run Windows 11 and by default I can have access to certain Linux commands (such as curl and ssh) on the default Windows shell. However, even if you have Windows 10, I recommend installing Git Bash.</div><div><br /></div><div><div><h5 style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; color: #2c3e50; font-family: Quicksand, sans-serif; font-size: 16px; margin: 0px 0px 15px; outline: 0px; padding: 0px; vertical-align: baseline;">Step 1. Install Docker Desktop</h5></div></div><div>Download and install Docker Desktop for Windows.</div><div><br /></div><div><div><h5 style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; color: #2c3e50; font-family: Quicksand, sans-serif; font-size: 16px; margin: 0px 0px 15px; outline: 0px; padding: 0px; vertical-align: baseline;">Step 2. Download the Bitnami Laravel Docker image</h5></div></div><div>Open a git bash terminal and run the following:</div><div><br /></div><div><pre style="background: linear-gradient(rgba(0, 0, 0, 0.05) 50%, transparent 50%, transparent) 0px 0px / 100% 50px rgb(44, 62, 80); border: 0px; line-height: 25px; margin-bottom: 10px; margin-top: 15px; outline: 0px; overflow-wrap: normal; overflow: hidden; padding: 0px 7px; position: relative; vertical-align: baseline;"><span style="color: #f1f1f1; font-family: Monaco, Andale Mono, Courier New, Courier, monospace;"><span style="font-size: 14px;">$ docker pull bitnami/laravel
$ mkdir ~/myapp && cd ~/myapp
$ curl -LO https://raw.githubusercontent.com/bitnami/containers/main/bitnami/laravel/docker-compose.yml --ssl-no-revoke</span></span></pre></div><div><br /></div><div><div><h5 style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; color: #2c3e50; font-family: Quicksand, sans-serif; font-size: 16px; margin: 0px 0px 15px; outline: 0px; padding: 0px; vertical-align: baseline;">Step 3. Enable Docker Privileged Mode</h5></div></div><div>Edit docker-compose.yml to enable privileged mode by adding <b>privileged: true</b> inside your app Docker container properties.</div><div><br /></div><div><br /></div><div><div><h5 style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; color: #2c3e50; font-family: Quicksand, sans-serif; font-size: 16px; margin: 0px 0px 15px; outline: 0px; padding: 0px; vertical-align: baseline;">Step 4. Install Laravel</h5></div></div><div>From the git bash terminal within the previous working directory, run: </div><div><pre style="background: linear-gradient(rgba(0, 0, 0, 0.05) 50%, transparent 50%, transparent) 0px 0px / 100% 50px rgb(44, 62, 80); border: 0px; line-height: 25px; margin-bottom: 10px; margin-top: 15px; outline: 0px; overflow-wrap: normal; overflow: hidden; padding: 0px 7px; position: relative; vertical-align: baseline;"><span style="color: #f1f1f1; font-family: Monaco, Andale Mono, Courier New, Courier, monospace;"><span style="font-size: 14px;">$ docker-compose up</span></span></pre></div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIolJZLHy5N4Yh6E9-1sXLNLfneyKClPgkAx_F3XpxVkvpU20vwnlV2GSRNbqkw2MKw5Rd2ee4eDvJ0qDCGBrT5-pJgVN_SmHr6gaf5VRGvu_MFM95E9cKoXW8Ln7nxRphFslrdI_lSjFEDKRbo8S81yD4fWEKPSaJ1Pkeqse83xiwMAWoxYdz4glF/s2048/379856075_264091639870280_18589501029854111_n.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="2048" data-original-width="1536" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIolJZLHy5N4Yh6E9-1sXLNLfneyKClPgkAx_F3XpxVkvpU20vwnlV2GSRNbqkw2MKw5Rd2ee4eDvJ0qDCGBrT5-pJgVN_SmHr6gaf5VRGvu_MFM95E9cKoXW8Ln7nxRphFslrdI_lSjFEDKRbo8S81yD4fWEKPSaJ1Pkeqse83xiwMAWoxYdz4glF/s320/379856075_264091639870280_18589501029854111_n.jpg" width="240" /></a></div><br /><div><br /></div><div><br /></div><div>You can access the application on your browser: http://localhost:8000/</div></div></div></span></span>Jameshttp://www.blogger.com/profile/08002241344195819468noreply@blogger.com0tag:blogger.com,1999:blog-7523325605657755052.post-30555120080427290962022-11-09T09:44:00.008+01:002023-10-06T14:21:41.102+02:00Android Emulator Development Environment<p><span color="rgba(0, 0, 0, 0.9)" face="-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif" style="background-color: white;">Sometimes having a physical mobile device is not available when you are doing mobile app development work (even though I strongly recommend it!). When we are faced with that situation, we have no other option but make use of emulators. In this article I want to briefly discuss how to setup an appropriate development environment for Android emulator in order to:</span></p><p><span color="rgba(0, 0, 0, 0.9)" face="-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif" style="background-color: white;">✅ Have the emulator device communicate with a local API server.</span><br style="background-color: white; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; line-height: inherit;" /><br style="background-color: white; box-sizing: inherit; font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif; line-height: inherit;" /><span color="rgba(0, 0, 0, 0.9)" face="-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Fira Sans", Ubuntu, Oxygen, "Oxygen Sans", Cantarell, "Droid Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Lucida Grande", Helvetica, Arial, sans-serif" style="background-color: white;">✅ Make the GPS work!</span></p><p><span color="rgba(0, 0, 0, 0.901960784313726)" face="-apple-system, system-ui, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Fira Sans, Ubuntu, Oxygen, Oxygen Sans, Cantarell, Droid Sans, Apple Color Emoji, Segoe UI Emoji, Segoe UI Emoji, Segoe UI Symbol, Lucida Grande, Helvetica, Arial, sans-serif"></span></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhR4M8fqJ7PtWbQfNzv88LLxDt-L8DLFL6n8Ti0nqOLqSmTh8XS6QDPsnDmFDG7L8LOCGfXa-BrKpPs5fF6VPvcoITwd_zxYEEEW9yCmgi7pXHxOZyW_pBsSoBpkvPHtV_cy11dNriWD6zBFJPTwrBcbuN9AYfKuBdEp2-ajv6WhyDwKCzNYz5hEQ/s1309/Screenshot%20from%202022-11-09%2009-23-48.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="744" data-original-width="1309" height="182" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhR4M8fqJ7PtWbQfNzv88LLxDt-L8DLFL6n8Ti0nqOLqSmTh8XS6QDPsnDmFDG7L8LOCGfXa-BrKpPs5fF6VPvcoITwd_zxYEEEW9yCmgi7pXHxOZyW_pBsSoBpkvPHtV_cy11dNriWD6zBFJPTwrBcbuN9AYfKuBdEp2-ajv6WhyDwKCzNYz5hEQ/s320/Screenshot%20from%202022-11-09%2009-23-48.png" width="320" /></a></div><br /><div class="separator" style="clear: both; text-align: center;"><br /></div><span color="rgba(0, 0, 0, 0.901960784313726)" face="-apple-system, system-ui, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Fira Sans, Ubuntu, Oxygen, Oxygen Sans, Cantarell, Droid Sans, Apple Color Emoji, Segoe UI Emoji, Segoe UI Emoji, Segoe UI Symbol, Lucida Grande, Helvetica, Arial, sans-serif"><span color="rgba(0, 0, 0, 0.901960784313726)" face="-apple-system, system-ui, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Fira Sans, Ubuntu, Oxygen, Oxygen Sans, Cantarell, Droid Sans, Apple Color Emoji, Segoe UI Emoji, Segoe UI Emoji, Segoe UI Symbol, Lucida Grande, Helvetica, Arial, sans-serif"><h3 style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; color: #2c3e50; font-family: Quicksand, sans-serif; font-size: 21px; margin: 0px 0px 15px; outline: 0px; padding: 0px; vertical-align: baseline;">Network Connectivity</h3><div>Unless you are developing a very simple mobile app, chances are that your app needs to connect to an API server. If this is a third party public API server, just move on to the next point, however if you want to setup your own API server, you need a way for the emulator to connect to your localhost.</div><div><br /></div><div>By default this is not possible, and you need to employ one of the various techniques there are available out there - from tunneling, to using the mighty ngrok, etc. I want to keep this short and give you a solution that will work 100% of the time whether you are using Windows, Linux or OSX:</div><div><br /></div><div><pre style="background: linear-gradient(rgba(0, 0, 0, 0.05) 50%, transparent 50%, transparent) 0px 0px / 100% 50px rgb(44, 62, 80); border: 0px; line-height: 25px; margin-bottom: 10px; margin-top: 15px; outline: 0px; overflow-wrap: normal; overflow: hidden; padding: 0px 7px; position: relative; vertical-align: baseline;"><span style="color: #f1f1f1; font-family: Monaco, Andale Mono, Courier New, Courier, monospace;"><span style="font-size: 14px;">james@obsidian ~ $ adb devices
List of devices attached
emulator-5554 device
james@obsidian ~ $ adb reverse --list
host-31 tcp:19000 tcp:19000
james@obsidian ~ $ adb -s emulator-5554 reverse tcp:5000 tcp:5000
5000
james@obsidian ~ $ adb reverse --list
host-31 tcp:19000 tcp:19000
host-31 tcp:5000 tcp:5000</span></span><span style="color: #f1f1f1; font-family: Monaco, "Andale Mono", "Courier New", Courier, monospace; font-size: 14px;">
</span></pre></div><div><br /></div><div>So as you can see from above, we are creating a new tunnel that allows the emulator to connect to our API server is listening locally on port 5000. Of course, if your API server is listening on a different port, just change the port number in the code snippet above accordingly.</div><div><br /></div><div><h3 style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: 0px 0px; background-repeat: initial; background-size: initial; border: 0px; color: #2c3e50; font-family: Quicksand, sans-serif; font-size: 21px; margin: 0px 0px 15px; outline: 0px; padding: 0px; vertical-align: baseline;">GPS</h3><div>For some reason, even on recent AVD images, the GPS location on Android emulators will point you to a different country all together - in my case it was some random address near Palo Alto. In order to correctly setup the location of the Android emulator, we need to take a few steps.</div></div><div><br /></div><div><ul style="text-align: left;"><li>In the extended controls (the vertical bar on the right hand side of the emulator), go to Location and do the following:</li><ul><li>Create a <b>single point </b>to your location of choice</li><li>Click the <b>set location</b> button</li><li>Make sure the <b>Enable GPS signal </b>button is enabled</li></ul><li>In the Android settings inside the emulator, go to Location and make sure that Accurate Google GPS Location is enabled as well.</li></ul><div>Sometimes even if you follow the above steps (which are also documented by Android), the GPS location won't work well! <b>This is is where most developers give up</b>. Fear not, I have found a solution that works all the time. Simply open the Google Maps app from the Emulator and try to find a location nearby. This will cause the current location GPS to reset and find its bearings, pun intended!</div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUHIL7qtWdN9NYDM9Yxfii7ZP4DLm0jpqP2p2U284OFnP1Xeuuyjd7bTR8B-zNsRGJ-UTwrTgxEuzxcJql5lMosbtfYRHURn3Mp811OcbuSDAV2FuR28ORR2ZUE24SW6moaePf_1oVqDp0XHWrWggvbHBGvhbhHKqAdrikORH-HrSoUntohfj42Q/s592/Screenshot%20from%202022-11-09%2009-58-17.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="592" data-original-width="379" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUHIL7qtWdN9NYDM9Yxfii7ZP4DLm0jpqP2p2U284OFnP1Xeuuyjd7bTR8B-zNsRGJ-UTwrTgxEuzxcJql5lMosbtfYRHURn3Mp811OcbuSDAV2FuR28ORR2ZUE24SW6moaePf_1oVqDp0XHWrWggvbHBGvhbhHKqAdrikORH-HrSoUntohfj42Q/w128-h200/Screenshot%20from%202022-11-09%2009-58-17.png" width="128" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqj_ZGj9otaQzNawbvPjHILHOFLa_Roaz1YWKNt5F3levxPZcm0mLgapRbG1sVF9EzDYLWNve2-MsFkpFjcHvOS70mwGT6Yqu5ev123yltLFkaRPxoSHeyYX8HAOYnU57dl0A_i5jPTs6Uke9VCY87l5KfqmWLDMygdjNr0VOhG7yMZk5vqOs3lQ/s855/Screenshot%20from%202022-11-09%2009-58-57.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="612" data-original-width="855" height="143" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqj_ZGj9otaQzNawbvPjHILHOFLa_Roaz1YWKNt5F3levxPZcm0mLgapRbG1sVF9EzDYLWNve2-MsFkpFjcHvOS70mwGT6Yqu5ev123yltLFkaRPxoSHeyYX8HAOYnU57dl0A_i5jPTs6Uke9VCY87l5KfqmWLDMygdjNr0VOhG7yMZk5vqOs3lQ/w200-h143/Screenshot%20from%202022-11-09%2009-58-57.png" width="200" /></a></div><br /><br /><div>And that is it! Enjoy developing mobile apps on emulators!</div></div><div><br /></div><div><br /></div></span></span>Jameshttp://www.blogger.com/profile/08002241344195819468noreply@blogger.com0