Monday, October 14, 2024

minikube up cluster

 

Start your cluster

 

 

minikube start
 
kubectl get po -A
minikube kubectl -- get po -A
 
minikube dashboard
start kube 
kubectl create deployment hello-minikube --image=kicbase/echo-server:1.0
kubectl expose deployment hello-minikube --type=NodePort --port=8080
 
kubectl get services hello-minikube
minikube service hello-minikube
kubectl port-forward service/hello-minikube 7080:8080


 

 
 

Sunday, January 16, 2022

Install swoole on window

 

Not directly, but with Docker and WSL (Windows Subsystem for Linux).

  1. Install Docker (https://www.docker.com/products/docker-desktop)
  2. Setup WSL

Open PowerShell as Administrator and run

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Updating/Install the WSL 2 Linux kernel (https://docs.microsoft.com/en-us/windows/wsl/wsl2-kernel)

  1. Enable "Enable the experimental WSL 2 based engine" in Docker (General)
  2. Build the Docker container

IMPORTANT! Don't use a path with spacebars like:

  • C:\Users\ {FIRSTNAME}[SPACEBAR]{LASTNAME}\Desktop\docker)

Create a folder (D:\docker) and create with an Editor the Dockerfile (D:\docker\Dockerfile)

FROM php:7.4.2-cli

RUN apt-get update && apt-get install vim -y && \
    apt-get install openssl -y && \
    apt-get install libssl-dev -y && \
    apt-get install wget -y && \
    apt-get install git -y && \
    apt-get install procps -y && \
    apt-get install htop -y

RUN cd /tmp && git clone https://github.com/swoole/swoole-src.git && \
    cd swoole-src && \
    git checkout v4.4.15 && \
    phpize  && \
    ./configure  --enable-openssl && \
    make && make install

RUN touch /usr/local/etc/php/conf.d/swoole.ini && \
    echo 'extension=swoole.so' > /usr/local/etc/php/conf.d/swoole.ini

RUN wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_amd64
RUN chmod +x /usr/local/bin/dumb-init

RUN apt-get autoremove -y && rm -rf /var/lib/apt/lists/*

ENTRYPOINT ["/usr/local/bin/dumb-init", "--", "php"]

Open PowerShell navigate to your folder (D:\docker) to build the DockerImage

docker build -f ./Dockerfile -t swoole-php .
  1. Add your swoole source code

As an example (D:\docker\server.php)

<?php
$http = new Swoole\HTTP\Server("0.0.0.0", 9501);

$http->on('start', function ($server) {
    echo "Swoole http server is started at http://127.0.0.1:9501\n";
});

$http->on('request', function ($request, $response) {
    $response->header("Content-Type", "text/plain");
    $response->end("Hello World\n");
});

$http->start();
?>
  1. Start your swoole http server with the PowerShell
docker run --rm -p 9501:9501 -v D:/docker/:/app -w /app swoole-php server.php

Monday, March 02, 2020

Gradle does not have execution permission.

How to solve the problem

run this command in flutter android directory

chmod a+rx gradlew

Monday, June 10, 2019

Farmer Application

The idea is farmer advertise their vegetable online.. the customer get the vegetables directly form them without any retailers...




Thursday, May 23, 2019

Configure Relay Postfix to send email via Gmail SMTP


1.     Create a file to store our credentials:
sudo vi /etc/postfix/sasl_passwd

2.     Add something like this:
smtp.gmail.com:587 sysnotify@umt.edu.my:00umt00

3.     Now run:
sudo postmap /etc/postfix/sasl_passwd

4.     Prepare the postfix main config file:
sudo vi /etc/postfix/main.cf

5.     Add/update these lines
relayhost=smtp.gmail.com:587
smtp_sasl_auth_enable=yes smtp_sasl_password_maps=hash:/etc/postfix/sasl_passwd
smtp_use_tls=yes
smtp_tls_security_level=encrypt
tls_random_source=dev:/dev/urandom
smtp_sasl_security_options = noanonymous
smtp_always_send_ehlo = yes
smtp_sasl_mechanism_filter = plain

6.     Stop/Start the service
sudo postfix reload

7.     Run command nim utk test
date | mail -s "Test Email" abdul.rahim@umt.edu.my

8.     Check the queue for any errors

mailq

Wednesday, February 28, 2018

Cannot start virtual machine on Virtualbox

If u get  this  error while booting virtual machine on Virtuabox
Raw-mode is unavailable courtesy of Hyper-V. (VERR_SUPDRV_NO_RAW_MODE_HYPER_V_ROOT).

Try to resolve by disable Hyper-V in Window 10

Wednesday, May 10, 2017

HP LaserJet P1006 is in error state

Try this to resolve :

1. Click Start.
2. In the Search field type :   cmd
3. Right click on the Command Prompt icon at the top of the Start Bar and choose Run as Administrator.
4. Type the following below in succession:
               net stop spooler
               del %systemroot%\system32\spool\printers\*.*
               y
               net start spooler
5. If it still doesn't work you might try different printer drivers, PCL drivers usually offer better printer support than Universal drivers, especially PCL5 drivers which are made for compatibility.

Hope so...