Tuesday, April 21, 2026

[AI][ML][LLM]Run Llama 3B through Docker Model

 Install necessary plugin:

# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

# echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

# apt-get update

# apt-get install docker-model-plugin


Pull:

# docker model pull ai/llama3.2


Run in Interactive mode:

# docker model run ai/llama3.2


Exit Interactive mode:

> /bye


Run in Single-prompt mode:

# docker model run ai/llama3.2 "Explain how Docker containers work in one sentence."



-----Failed to carry out from here:

Enable OpenAI mode:

# docker desktop enable model-runner --tcp 12434



Test OpenAI:

# curl http://localhost:12434/engines/v1/models



Remotely use through OpenAI:

# curl http://localhost:12434/engines/v1/chat/completions \

  -H "Content-Type: application/json" \

  -d '{

    "model": "ai/llama3.2",

    "messages": [{"role": "user", "content": "Hello!"}]

  }'


Monday, April 13, 2026

[Windows][Sniffer] Microsoft Pktmon command-based sniffer

#Add filter:

pktmon filter add MyFilter -i 192.168.215.11

#OR

pktmon filter add MyFilter -i 192.168.1.100 -p 443

pktmon filter add MyFilter -i 192.168.1.100 -p 443 -t tcp



#Start:

pktmon start --capture --log-mode real-time



#Stop:

pktmon stop



#Remove filter:

pktmon filter remove

Monday, March 2, 2026

[Linux][Shell] tmux substituting the screen command

 Installation:

#apt-get update

#apt-get install tmux


How to use:

#tmux


Shortcut:

Ctrl+b c: creation

Ctrl+b x: Exit

Ctrl+b %: Split screen

Ctrl+b ;: Switch screen

Sunday, February 15, 2026

[Weka][Machine Learning][Kmeans]Weka labelling result of Kmeans

### The Step-by-Step Process


1. **Run your Clusterer:**

* Go to the **Cluster** tab.

* Select **SimpleKMeans** and configure your  (number of clusters).

* Run the algorithm. Ensure it completes successfully.


2. **Add the Labels via Filter:**

* Switch back to the **Preprocess** tab.

* Click **Choose** under the Filters section.

* Navigate to: `filters` -> `unsupervised` -> `attribute` -> **AddCluster**.


3. **Configure the Filter:**

* Click on the **AddCluster** text to open its configuration box.

* In the `clusterer` field, click "Choose" and select **SimpleKMeans** again (ensure the settings match what you used in the Cluster tab).

* Click **OK**.


4. **Apply and Save:**

* Click **Apply**. You will see a new attribute appear at the end of your attribute list, typically named "cluster."

* Click **Save...** to export your new labeled dataset as an `.arff` or `.csv` file.


---


### Pro-Tips for Labeling


* **The "Ignored" Attributes:** If you want to cluster based on certain features but keep an ID or Name column in the final file, make sure to use the `ignoredAttributeIndices` property within the SimpleKMeans settings inside the **AddCluster** filter.

* **Result Verification:** Before saving, you can click the **Edit...** button in the Preprocess tab to view the data table and confirm that the cluster assignments look correct (e.g., Cluster 0, Cluster 1, etc.).


---


Saturday, February 14, 2026

[perl][ML][Machine Learning]K-means in Perl

#!/usr/bin/perl -w

use strict;

use warnings;

use PDL::LiteF;

use PDL::Stats;


# 1. Define 4 separate arrays (Features)

my $f1 = pdl(1, 2, 1, 10, 11, 12); # Feature 1

my $f2 = pdl(1, 1, 2, 10, 12, 11); # Feature 2

my $f3 = pdl(0, 1, 0, 15, 14, 15); # Feature 3

my $f4 = pdl(2, 2, 1, 20, 21, 22); # Feature 4


# 2. Combine them into a 4-column matrix

# cat() joins them, transpose() makes each row a "person/object"

my $data = cat($f1, $f2, $f3, $f4)->transpose;


# 3. Run K-means for 2 groups

my $k = 2;

my %result = $data->kmeans({k => $k, NCLUS => 2});


# 4. Display which group each of the 6 items belongs to

print "Data Matrix (Rows = Items, Cols = Features):\n$data\n";

print "Cluster Assignments:\n", $result{cluster}, "\n";

print "Final Centroids (The average of each group):\n", $result{centroid}, "\n";


Tuesday, February 10, 2026

Install Snort 2.9 at Ubuntu 24.02 on 20260210

 Installation:

#apt-get update

#apt-cache policy snort

#apt-get install snort -y


Testing:

#snort -T -c /etc/snort/snort.conf


Execution:

#snort -c /etc/snort/snort.conf -A full -D -s

Install and deploy OSSEC at Ubuntu 24.04 on 20260210

Installation:

#sudo apt update

#sudo apt install -y build-essential make gcc wget tar \

libpcre2-dev zlib1g-dev libssl-dev libevent-dev \

libsystemd-dev libsqlite3-dev systemd-dev

#cd /usr/local/sbin

#wget -q -O - https://updates.atomicorp.com/installers/atomic | bash

#apt-get update

#apt-get install ossec-hids-server