Install, build and debug a react native app in WSL2 (Windows Subsystem for Linux) and Ubuntu.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Access host ports from WSL 2. | |
# https://gist.github.com/vilic/0edcb3bec10339a3b633bc9305faa8b5 | |
# Make sure WSL gets initialized. | |
bash.exe -c exit | |
# Record host name for /etc/hosts that points to host IP. | |
$HOST_NAME = "host.wsl"; | |
# Ports listened on host localhost to forward, you don't need to add the port if it listens all addresses. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt update | |
sudo apt upgrade | |
sudo apt-get purge openssh-server | |
sudo apt-get install openssh-server | |
sudo service ssh start |
- Download the latest zsh package: https://packages.msys2.org/package/zsh?repo=msys&variant=x86_64
Example:
zsh-5.7.1-1-x86_64.pkg.tar.xz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// we have to represent human relation in oop style | |
class Human { | |
constructor(firstName,lastName) { | |
this.firstName = firstName; | |
this.lastName = lastName; | |
} | |
sleepNow() { | |
console.log(`${this.firstName} ${this.lastName} is sleeping`) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person | |
{ | |
constructor(first_name,last_name) { | |
this.first_name = first_name; | |
this.last_name = last_name; | |
} | |
getFullName() { | |
return `Full Name is: ${this.first_name} ${this.last_name}`; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -I -k "https://api.github.com/repos/:owner/:repo/commits?per_page=1" | sed -n '/^[Ll]ink:/ s/.*"next".*page=\([0-9]*\).*"last".*/\1/p' | |
### And that's all ! | |
# I saw many fighting with finding first commit SHA or similar fancy thing. | |
# Here we just rely on the GH API, asking commits at 1 per page and parsing the last page number in the header of the reply (whose body only holds the last commit !) | |
# So this is robust and bandwidth efficient. :) | |
# If one want the commit count of a specific SHA, just use : | |
curl -I -k "https://api.github.com/repos/:owner/:repo/commits?per_page=1&sha=:sha" | sed -n '/^[Ll]ink:/ s/.*"next".*page=\([0-9]*\).*"last".*/\1/p' |
- Stop the
MySQL 8.0
service from services - Go to path C:\Program Files\MySQL\MySQL Server 8.0\bin and open
cmd
- Run
mysqld --console --skip-grant-tables --shared-memory
- Open new
cmd
in the same path - Run following commands
mysql -u root
select authentication_string,host from mysql.user where user='root';
UPDATE mysql.user SET authentication_string='' WHERE user='root';
- Download Sendmail for Windows;
- Extract
sendmail.zip
and place the contents in an easily accessible place, likeC:\sendmail
; - Open the
sendmail.ini
file using a text editor such as notepad and edit the following values:[sendmail] smtp_server=mail.example.com smtp_port=465 auth_username=username@example.com
auth_password=your_password