Tuesday, March 29, 2022

Basic Linux Commands (Centos 6/7)

System Information

Show Centos Version
cat /etc/centos-release

Show computer architecture:
arch

Show kernel version
uname -r

Show system date
date

Show calendar table for 2014
cal 2014

Files and Directories

Go to '/var/www/'
cd /var/www

Go to the upper level directory
cd ..

Go to home directory
cd ~

Go to home directory of “user”
cd ~user

Show the contents of the current directory
ls

Show the contents of the current directory adding characters to the names characterizing the type
ls -F

Show detailed representation of files and directories in the current directory
ls -l

Show hidden files and directories in the current directory
ls -a

Create a directory called ‘test’
mkdir test

Create two directories simultaneously
mkdir test1 test2

Create a directory tree
mkdir -p /var/www/test/dir

Delete the file named ‘file’
rm -f file

Delete a directory named ‘dir’
rmdir dir

Delete a directory named ‘dir’ and all of its contents recursively
rm -rf dir

Rename or move a file or directory
mv dir1 new_dir

Copy file1 in file2
cp file1 file2

Create a symbolic link to a file or directory
ln -s file1 file2

Searching Files

Find files and directories named file1. Start searching from the root (/)
find / -name file1

Find files and directories owned by user1. Start searching from the root (/)
find / -user user1

Find all files and directories whose names end in ‘.log’. Start searching from ‘/var/www’
find /var/www -name "*.log"

Find all files containing '.png' in the name. it is recommended to run 'updatedb' command before this.
locate "*.png"

Find all files with '.log' extension in the current directory, including subdirectories and delete them
find . -name '*.log' -type f -delete

Disk Space

Information about partitioned sections displaying total, free and used space
df -h

Show the size used by directory ‘dir1’
du -sh dir1

Users and Groups

Create user1, assign /home/user1 as its home directory, assign /bin/bash as a shell, include it in ‘admin’ group and add a comment Nome Cognome
useradd -c "Nome Cognome" -g admin -d /home/user1 -s /bin/bash user1

Create user1
useradd user1

Delete user1 and its home directory
userdel -r user1

Create a new group named group_name
groupadd group_name

Delete group group_name
groupdel group_name

Rename group old_group_name in new_group_name
groupmod -n new_group_name old_group_name

Change password
passwd

Change password of user1 (only root)
passwd user1

Setting/Changing File Rights

Add rights 777 (Read Write Execute) to directory1 – full rights to everybody.
chmod 777 directory1

Add rights to directory1, including all files and subfolders in it, rights 777 (Read Write Execute) - full rights to everybody.
chmod –R 777 directory1

Assign user1 as the owner of file1
chown user1 file1

Recursively assign user1 as the owner of directory1
chown -R user1 directory1

Assign user 'apache' from the group 'apache' to folder 'dir', including all subfolders and files:
chown apache:apache -R /var/www/dir

Find all files in the current directory, including subfolders and assign rights 664
find . -type f -printf "\"%p\" " | xargs chmod 664

Find all folders in the current directory, including subfolders and assign rights 775
find . -type d -printf "\"%p\" " | xargs chmod 775

File Archiving and Compression

Unarchive file 'file1.bz2'
bunzip2 file1.bz2

Unarchive file 'file1.gz'
gunzip file1.gz

Archive file 'file1' to file1.gz
gzip file1

Archive file file1 to file1.bz2
bzip2 file1

Create an archive and zip it with gzip
tar -cvfz archive.tar.gz dir1

Unarchive and extract
tar -xvfz archive.tar.gz

Create zip-archive
zip file1.zip file1

Unarchive and extract zip-archive
unzip file1.zip

Upgrading Packages

Upload and install package
yum install package_name

Update all packages installed in the system
yum update

Update package
yum update package_name

Delete package
yum remove package_name

Show the list of all packages installed in the system
yum list

Find a package in the repository
yum search package_name

Clean rpm-cache, deleting uploaded packages
yum clean packages

Clean rpm-cache, deleting uploaded packages and headers
yum clean all

Source: https://serverdale.com/en/linux-commands

Thursday, March 17, 2022

Install & Replace ONT Huawei di OLT Nokia (isam-release : R5.6.02c) : Mode Port Access & Trunk

QOS
leg:JKT-OLT-ALU-NOKIA:user>#configure qos profiles bandwidth DOWN-4M committed-info-rate 0 assured-info-rate 0 excessive-info-rate 4096
leg:JKT-OLT-ALU-NOKIA:user>#configure qos profiles shaper DOWN-4M committed-info-rate 0 committed-burst-size 0 excess-info-rate 4096 type singletokenbucketgpon
leg:JKT-OLT-ALU-NOKIA:user>#configure qos profiles bandwidth UP-4M committed-info-rate 0 assured-info-rate 0 excessive-info-rate 4096

To Change ONT and Install New ONT, We Must Delete Old ONT
leg:JKT-OLT-ALU-NOKIA:user>#configure equipment ont interface 1/1/1/1/6 admin-state down (ONT harus dishutdown dulu sebelum didelete)
leg:JKT-OLT-ALU-NOKIA:user>#configure equipment ont no interface 1/1/1/1/6

Register New ONT
leg:JKT-OLT-ALU-NOKIA:user>#configure equipment ont interface 1/1/1/1/6 sernum HWTC:B43A0273 sw-ver-pland disabled (Gunakan ":" untuk memisahkan SN ONT Huawei)
leg:JKT-OLT-ALU-NOKIA:user>configure>equipment>ont>interface>1/1/1/1/6$desc1 "ATM Bank Banyak Duit"
leg:JKT-OLT-ALU-NOKIA:user>#configure equipment ont interface 1/1/1/1/6 admin-state up
leg:JKT-OLT-ALU-NOKIA:user>#configure equipment ont slot 1/1/1/1/6/1 plndnumdataports 4 plndnumvoiceports 0 planned-card-type ethernet
leg:JKT-OLT-ALU-NOKIA:user>#configure interface port uni:1/1/1/1/6/1/1 admin-up
leg:JKT-OLT-ALU-NOKIA:user>#configure qos interface 1/1/1/1/6/1/1 upstream-queue 0
leg:JKT-OLT-ALU-NOKIA:user>#configure qos interface 1/1/1/1/6/1/1 queue 0 shaper-profile name:DOWN-4M
leg:JKT-OLT-ALU-NOKIA:user>#configure qos interface 1/1/1/1/6/1/1 upstream-queue 0 bandwidth-profile name:UP-4M

leg:JKT-OLT-ALU-NOKIA:user>#configure vlan id 1573 mode residential-bridge
leg:JKT-OLT-ALU-NOKIA:user>#configure>vlan>id>1573$ in-qos-prof-name name:Default_TC0

leg:JKT-OLT-ALU-NOKIA:user>#configure bridge port 1/1/1/1/6/1/1 max-unicast-mac 100
leg:JKT-OLT-ALU-NOKIA:user>#configure bridge port 1/1/1/1/6/1/1 vlan-id 1573 (untuk Access) 
leg:JKT-OLT-ALU-NOKIA:user>#configure bridge port 1/1/1/1/6/1/1 vlan-id 1573 tag single-tagged  (Untuk Trunk)
leg:JKT-OLT-ALU-NOKIA:user>#configure bridge port 1/1/1/1/6/1/1 pvid 1573

leg:JKT-OLT-ALU-NOKIA:user>#configure bridge port nt:xfp:1 vlan-id 1573 (Config ke arah Port Uplink)
leg:JKT-OLT-ALU-NOKIA:user>#configure interface port vlan-port:1/1/1/1/6/1/1:1573 (Config di ONT Port 1)
leg:isadmin>#configure>interface>port>vlan-port:1/1/1/1/6/1/1:1573# admin-up 

leg:JKT-OLT-ALU-NOKIA:user>#configure qos interface vlan:1/1/1/6/1/1/1:1031

Temukan Artikel lainnya tentang GPON OLT dan FTTH di --> List All Articles About GPON OLT Huawei - ZTE - Alcatel Lucent in This Blog [Updated]