List
> wsl -l -v
Unregister
> wsl --unregister Debian
Ref
- https://www.windowscentral.com/how-completely-remove-linux-distro-wsl
List
> wsl -l -v
Unregister
> wsl --unregister Debian
Ref
From ChatGPT
```bash
$ zip -s 100m -r archive.zip largefile
```
```bash
$ zip -s 0 archive.zip --out combined.zip
```
From ChatGPT
1. **Open or create the `.bashrc` file** in your home directory:
```bash
$ nano ~/.bashrc
```
2. **Add the following lines** at the end of the file to enable timestamps in `bash_history`:
```bash
# Enable timestamps in bash history
HISTTIMEFORMAT="%F %T "
```
- `%F` will add the date in `YYYY-MM-DD` format.
- `%T` will add the time in `HH:MM:SS` format.
3. **Save and exit** the file (`Ctrl+O` to save, `Enter`, and then `Ctrl+X` to exit).
4. **Apply the changes** by running the following command to reload your `.bashrc`:
```bash
$ source ~/.bashrc
```
Now, every command in your Bash history will be prefixed with the timestamp. To view the history with timestamps, simply run:
```bash
$ history
```
Add
Env
Step
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin admin@site.com
ServerName www.site.com
...
ProxyPreserveHost on
ProxyPass / http://localhost:8080/
ProxyReverse / http://localhost:8080/
RequestHeader set X-Forwarded-Proto "https"
Include /etc/.../ssl-apache.conf
SSLCertificateFile...
SSLCertificateKeyFile...
...
</VirtualHost>
</IfModule>
<VirtualHost *:80>
ServerAdmin admin@site.com
ServerName www.site.com
...
ProxyPreserveHost on
ProxyPass / http://localhost:8080/
ProxyReverse / http://localhost:8080/
RequestHeader set X-Forwarded-Proto "https"
</VirtualHost>
$ sudo a2ensite www.site.com.conf
$ sudo a2ensite www.site.com.le-ssl.conf
$ systemctl restart apache2
$ mkdir -p /home/myuser/public_html/mysql_data
$ mkdir -p /home/myuser/public_htmlapp
$ cd app
$ cp -rf th /home/myuser/public_html/app/th
$ cd /home/myuser/public_html
$ nano php.ini
; Set the maximum upload file size
upload_max_filesize = 64M
; Set the maximum POST size
post_max_size = 64M
memory_limit = 512M
$ nano Dockerfile
# load image php:<version>-apache
FROM php:7.4-apache
# Install PHP extensions
RUN docker-php-ext-install pdo pdo_mysql mysqli
# Use the official PHP-Apache image from Docker Hub
#FROM php:8.1-apache
# Install dependencies if needed
#RUN apt-get update && apt-get install -y \
# libpng-dev \
# libjpeg-dev \
# libfreetype6-dev \
# && docker-php-ext-configure gd --with-freetype --with-jpeg \
# && docker-php-ext-install gd
$ cd /home/myuser/public_html
$ nano docker-compose.yml
version: '3.3'
services:
apache:
build: .
# image: webdevops/php-apache:8.2
container_name: apache
ports:
- "8080:80"
command: bash -c "a2enmod rewrite && apache2-foreground"
restart: always
volumes:
- ./app:/var/www/html
- ./php.ini:/usr/local/etc/php/php.ini
# depends_on:
# - mysql
networks:
- lamp-network
mysql:
image: mysql:latest
container_name: mysql
environment:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: wordpress_site
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpresspassword
#ports:
# - "3306:3306"
volumes:
- ./mysql_data:/var/lib/mysql
networks:
- lamp-network
## optional สำหรับเพิ่มตัวจัดการ database
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
container_name: phpmyadmin
environment:
PMA_HOST: db
MYSQL_ROOT_PASSWORD: rootpassword
ports:
- "8081:80"
# depends_on:
# - mysql
networks:
- lamp-network
networks:
lamp-network:
driver: bridge
$ docker-compose up -d
$ docker ps
$ docker exec -i <container_id|name> mysql -u<username> -p<password> <database_name> < /path/file.sql
$ docker cp /path/file.sql <container_id|name>:/tmp/file.sql
$ docker exec -it <container_id|name> bash
container$ cd /tmp
container$ mysql -u <username> -p <database_name> < file.sql
...
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
$_SERVER['HTTPS'] = 'on';
}
...
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');
$ docker-compose down
$ docker-compose up -d
$ docker-compose up --build
Ref
ProxyPreserveHost On
ProxyPass / http://192.168.3.5:8000
ProxyPassReverse / http://192.168.3.5:8000
$ sudo systemctl reload apache2
Related