Difference between revisions of "Omen dev"
(→WSL2) |
|||
(13 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
==WSL2== | |||
everything runs faster in native file system. So all linux development should originate out of /home/tim in the WSL filesystem. Programming in vscode should be in remote ubunto 20.04 | |||
startup | |||
tim@omen: /mnt/c/Users/mcken cd | |||
tim@omen:~$ scripts/start.sh | |||
localhost is in /home/tim/www | |||
==[[omen]] WSL wsl development env== | ==[[omen]] WSL wsl development env== | ||
=== | |||
===nautilus ==== | ===task view=== | ||
win+tab - switches to task view | |||
ctrl+win leftarrow or right arrow - cycle through desktops | |||
===arduino=== | |||
do everything from vscode | |||
===nginx=== | |||
setting up a virtual host | |||
add to windows hosts C:\Windows\System32\drivers\etc | |||
http://www.thewindowsclub.com/hosts-file-in-windows | |||
# localhost name resolution is handled within DNS itself. | |||
# 127.0.0.1 localhost | |||
# ::1 localhost | |||
172.19.11.129 tim.com www.tim.com | |||
/etc/nginx/sites-available/tim.com | |||
server { | |||
listen 80; | |||
listen [::]:80; | |||
root /home/tim/public_html; | |||
index index.html index.htm; | |||
server_name tim.com www.tim.com; | |||
location / { | |||
try_files $uri $uri/ =404; | |||
autoindex on; | |||
} | |||
} | |||
sudo ln -s /etc/nginx/sites-available/tim.com /etc/nginx/sites-enabled/ | |||
sudo nginx -t | |||
sudo service nginx restart | |||
===file managers=== | |||
====nemo==== | |||
sudo nemo | |||
//open in code-insiders opens a superuser code-insiders | |||
====nautilus ==== | |||
export DISPLAY=localhost:0.0 | export DISPLAY=localhost:0.0 | ||
nautilus . | nautilus . | ||
===code-insiders=== | |||
got code-insiders to work inside bash using | got code-insiders to work inside bash using | ||
Line 25: | Line 68: | ||
====npm==== | ====npm==== | ||
===tips=== | ===tips=== | ||
===WSL problems=== | |||
after windows upgrade on 9/10/20 wslbridge error: failed to start backend process | |||
to fix goto conemu settings crete task {WSL:bash} with the following command line | |||
-new_console:d:D:\fs\www set PATH="%ConEmuBaseDirShort%\wsl";%PATH% & wsl -d ubuntu | |||
sudo usermod -a -G root tim | |||
sudo -i sets you as superuser | sudo -i sets you as superuser | ||
Line 47: | Line 99: | ||
===startup=== | ===startup=== | ||
start.sh does everything below | |||
sudo service nginx start | sudo service nginx start | ||
sudo service mysql start | sudo service mysql start | ||
sudo service php7.0-fpm start | sudo service php7.0-fpm start | ||
sudo service dbus start | sudo service dbus start | ||
===MySQL=== | ===MySQL=== | ||
Do everything from vscode, it has an sql extension that interacts with omen's mysql. For importing csv files use mysql-workbench in bash. | |||
mysqldump -uroot -pnji9ol --all-databases > dump.sql | mysqldump -uroot -pnji9ol --all-databases > dump.sql | ||
mysqldump -uroot -pthepass --opt geniot > geniot.sql | mysqldump -uroot -pthepass --opt geniot > geniot.sql |
Latest revision as of 16:34, 16 September 2021
WSL2
everything runs faster in native file system. So all linux development should originate out of /home/tim in the WSL filesystem. Programming in vscode should be in remote ubunto 20.04
startup
tim@omen: /mnt/c/Users/mcken cd tim@omen:~$ scripts/start.sh
localhost is in /home/tim/www
omen WSL wsl development env
task view
win+tab - switches to task view ctrl+win leftarrow or right arrow - cycle through desktops
arduino
do everything from vscode
nginx
setting up a virtual host
add to windows hosts C:\Windows\System32\drivers\etc
http://www.thewindowsclub.com/hosts-file-in-windows
# localhost name resolution is handled within DNS itself. # 127.0.0.1 localhost # ::1 localhost 172.19.11.129 tim.com www.tim.com
/etc/nginx/sites-available/tim.com
server { listen 80; listen [::]:80; root /home/tim/public_html; index index.html index.htm; server_name tim.com www.tim.com; location / { try_files $uri $uri/ =404; autoindex on; } }
sudo ln -s /etc/nginx/sites-available/tim.com /etc/nginx/sites-enabled/ sudo nginx -t sudo service nginx restart
file managers
nemo
sudo nemo //open in code-insiders opens a superuser code-insiders
nautilus
export DISPLAY=localhost:0.0 nautilus .
code-insiders
got code-insiders to work inside bash using
//start xterm sudo services dbus start code-insiders info.php --verbose //for system files that need root access start with sudo code-insiders --user-data-dir="~/.vscode-root"
to track down errors
references
docker
- https://nickjanetakis.com/blog/setting-up-docker-for-windows-and-wsl-to-work-flawlessly
- https://medium.com/@sebagomez/installing-the-docker-client-on-ubuntus-windows-subsystem-for-linux-612b392a44c4
npm
tips
WSL problems
after windows upgrade on 9/10/20 wslbridge error: failed to start backend process
to fix goto conemu settings crete task {WSL:bash} with the following command line
-new_console:d:D:\fs\www set PATH="%ConEmuBaseDirShort%\wsl";%PATH% & wsl -d ubuntu
sudo usermod -a -G root tim
sudo -i sets you as superuser
systemctl doesn't work use
/etc/init.d/php7.0-fpm restart
or
service nginx restart
when editng files you need to set permissions
chmod 644 info.php
Numeric Readable Explanation 0 --- No access. 1 --x Execute access.* 2 -w- Write access.** 3 -wx Write and execute access.*** 4 r-- Read access. 5 r-x Read and execute access. 6 rw- Read and write access. 7 rwx Read, write and execute access.
startup
start.sh does everything below
sudo service nginx start sudo service mysql start sudo service php7.0-fpm start sudo service dbus start
MySQL
Do everything from vscode, it has an sql extension that interacts with omen's mysql. For importing csv files use mysql-workbench in bash.
mysqldump -uroot -pnji9ol --all-databases > dump.sql mysqldump -uroot -pthepass --opt geniot > geniot.sql
or mo better with /root.my.cnf no user password needed
[mysqldump] user=root password=dfff
then run
bash dump.sh
which is
#!/bin/sh mysqldump --all-databases > dump.sql
then get the data from the remote server
sftp root@sitebuilt.net:/root/data/*.sql /data/MySQL
do the /home/tim/.my.cnf thing on omen
[mysqldump] user=root password=nff [mysql] user=root password=gg
then
MySQL < dump.sql
manage data with
MySQL-workbench