What I like about alpine linux is, it is very fast to get to a working linux with a shell inside a VM, and I can start testing whatever I need to test straight away. But the default setting of alpine linux does not preconfigured to get any packages from the internet, which is a pity. So we have to add it manually.
To add the main and community repositories manually, run below commands
# echo 'http://dl-cdn.alpinelinux.org/alpine/edge/community' >> /etc/apk/repos
# echo 'http://dl-cdn.alpinelinux.org/alpine/edge/main' >> /etc/apk/repos
Update repository indexes
# apk update
That's it. You can now search for any package
# apk search openssh
And install any package
# apk add openssh-client
Monday, April 20, 2020
Adding Internet Based Repositories in Alpine Linux
Thursday, April 9, 2020
Enable pfsense Web Interface from WAN Temporarily
By default pfsense only allow access to web interface from LAN. But sometimes you need access from WAN, just for a very short time. For example, you do not have any machine in LAN that have web interface, and you need the web interface to make some changes.
The steps are as follows, if you have access to pfsense text based console
1. Access the text based console
2. Choose option 8, to access the pfsense shell
3. Run this command: pfctl -d
4. Once you get the message "pf is disabled", you can now access pfsense web interface using WAN ip, in this case, 192.168.20.3, and make your changes in the web interface. Once you activate the changes, the firewall will be turned on again, so you won't be able to access web interface via WAN anymore.
5. If by any chance you want to enable back firewall manually, run: pfctl -e
If you do not have access to the console, you have to use ssh.
1. ssh into any linux machine on the LAN side
2. From the linux machine, ssh into pfsense
3. Run pfctl -d
4. Access your pfsense web interface via WAN IP. The firewall will automatically started if you "Apply Change" in web interface.
5. If you want to enable pf manuallt, run pfctl -e.
6 Logout from pfsense
Credit to this site for the great tutorial.
Wednesday, April 8, 2020
Uploading iso to Proxmox
To upload iso to proxmox, so that the iso can be used to create VM, please follow below steps
Friday, April 3, 2020
Install and Use Vagrant on Linux Mint 19 with Virtualbox
Vagrant is a tool for building and managing virtual machine environments in a single workflow. With an easy-to-use workflow and focus on automation, Vagrant lowers development environment setup time, increases production parity, and makes the "works on my machine" excuse a relic of the past.
Thursday, February 13, 2020
Installing Wordpress on Ubuntu 18.04 Using LEMP Stack
Installing wordpress on LEMP stack is not much different from installing in LAMP stack. For those who do not know, LEMP stands for Linux + Nginx + Mariadb + PHP stack, and LAMP stands for Linux + Apache + Mariadb/mysql + PHP stack. Check out my other post on how to install wordpress on LAMP stack on ubuntu.
As per the stack definition, there are 3 main components to be installed: nginx, mariadb and php.
Install nginx:
$ sudo apt install nginx -y
Install mariadb:
$ sudo apt install mariadb-server -y
Install php, php-mysql and php-fpm
$ sudo apt install php php-mysql php-fpm -y
Download wordpress code
$ wget https://wordpress.org/latest.tar.gz
Start mariadb
$ sudo systemctl start mariadb
Secure mariadb installation
$ sudo mysql_secure_installation
Create a database for wordpress
$ sudo mariadb -u root
MariaDB [none]> create database wpdb;
MariaDB [none]> grant all on wpdb.* to wpuser@localhost identified by 'wppassword';
MariaDB [none]> flush privileges;
MariaDB [none]> exit
Test the newly created user and db
$ mariadb -u wpuser -p wpdb
MariaDB [wpdb]> exit
Download wordpress
$ wget https://wordpress.org/latest.tar.gz
Extract wordpress
$ tar -xvf latest.tar.gz
Move wordpress directory to /var/www/html
$ sudo mv wordpress /var/www/html
Change ownership of the wordpress directory
$ sudo chown -R www-data /var/www/html/wordpress
Create nginx virtualhost configuration for wordpress
$ sudo nano /etc/nginx/conf.d/wordpress.conf
Add in below code (change the server name to refer to your ip address, since we do not have any domain at the moment)
server {
listen 80;
root /var/www/html/wordpress;
index index.php index.html;
server_name wordpress.10.0.0.5.nip.io;
location / {
try_files $uri $uri/ /index.php?q=$request_uri;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/www;
}
location ~ .php$ {
try_files $uri =404;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}








