Monday, 23 January 2023

Install Chocolatey for Individual Use in Windows 11 PowerShell

 

Chocolay - Machine-level command line package manager


#set execution policy for powershell

PS C:\WINDOWS\system32> Get-ExecutionPolicy -List


        Scope ExecutionPolicy

        ----- ---------------

MachinePolicy       Undefined

   UserPolicy       Undefined

      Process       Undefined

  CurrentUser       Undefined

 LocalMachine      Restricted


PS C:\WINDOWS\system32> Set-ExecutionPolicy AllSigned


Execution Policy Change

The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose

you to the security risks described in the about_Execution_Policies help topic at

https:/go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy?

[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): y

PS C:\WINDOWS\system32> Get-ExecutionPolicy -List


        Scope ExecutionPolicy

        ----- ---------------

MachinePolicy       Undefined

   UserPolicy       Undefined

      Process       Undefined

  CurrentUser       Undefined

 LocalMachine       AllSigned


Now run the following command:

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

choco --version


Ref:- chocolatey.org


Sunday, 25 December 2022

Add Swap Space on CentOS 9 Stream


To Add 1GB Swap Space 


#create swap file

 sudo dd if=/dev/zero of=/swapfile bs=1024 count=1048576

1048576+0 records in

1048576+0 records out

1073741824 bytes (1.1 GB, 1.0 GiB) copied, 19.8022 s, 54.2 MB/s


#set permission

sudo chmod 600 /swapfile


#set up swap area file

sudo mkswap /swapfile

Setting up swapspace version 1, size = 1024 MiB (1073737728 bytes)

no label, UUID=53c7c8d2-ed2d-4f61-b263-79a4dcd94304


#activate swap

 sudo swapon /swapfile


sudo swapon --show

NAME      TYPE       SIZE USED PRIO

/dev/dm-1 partition  2.1G   4M   -2

/swapfile file      1024M   0B   -3


sudo free -h

               total        used        free      shared  buff/cache   available

Mem:           1.7Gi       898Mi        69Mi        12Mi       970Mi       852Mi

Swap:          3.1Gi       4.0Mi       3.1Gi


#make permenant entry

sudo vim /etc/fstab

/swapfile swap swap defaults 0 0