Snippets Collections
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
ipconfig getoption en0 domain_name_server
input[type="radio"] {
    margin-right: 1em;
    appearance: none;
    width: 12px;
    height: 12px;
    background-image: url("checkbox_off.gif");       
}

input[type="radio"]:checked {
    background-image: url("checkbox_on.gif");           
}
ERPNEXT Version-15 Installation on Ubuntu 23.04
***********************************************

Step-1
sudo apt-get update -y
init 6  //( will restart )//

Step-2 //Install Python//
sudo apt-get install python3-dev python3.11-dev python3-setuptools python3-pip python3-distutils software-properties-common xvfb libfontconfig wkhtmltopdf libmysqlclient-dev -y

Step-3 //Install Virtual Enviroment//
sudo apt-get install python3.11-venv -y
sudo apt install python-is-python3 -y
python3 -V //( result Python 3.11.X )
python -V //(resulat Python 3.11.X )

Step-4 // Install Curl//
sudo apt install curl 
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.profile

Step-5 // Install NODE & Redis Server//
curl -sL https://deb.nodesource.com/setup_20.x | bash -
nvm install 20
node --version //( result must be : v20.XXX )
node -v
npm -v

sudo apt-get install -y nodejs
sudo apt-get install nodejs redis-server -y
sudo apt-get install cron git -y
node --version //( result must be : v20.XXX )

Step-6 // Install NPM & Yarn //
sudo apt-get install npm
sudo npm install -g yarn
npm --version //( result must be : 9.XX.X )
yarn --version

Step-7 //Install Mariadb
sudo apt-get install mariadb-server mariadb-client -y //install the Latest Version//
---OR---
sudo apt-get install mariadb-server=10.6 mariadb-client=10.6 -y // Version Above 10.8 is not Tested
mariadb --version //( result must be mariadb Ver 15.1 Distrib 10.6.7-MariaDB, )

Step-8 //Set Mariadb security//
sudo mysql_secure_installation

//Enter current password for root (enter for none): Press your [Enter] key, there is no password set by default
//Switch to unix_socket authentication N
//Set root password? [Y/n] Y
//New password:
//Re-enter new password:
//Remove anonymous users? [Y/n] Y
//Disallow root login remotely? [Y/n] N
//Remove test database and access to it? [Y/n] Y
//Reload privilege tables now? [Y/n] Y

//Set Mariadb formats.

Step-9 // Setup the Server//
vim /etc/mysql/mariadb.conf.d/erpnext.cnf //Not Working//
sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf
//Add in CNF FILE// CTRL+S & CTRL+X//

[mysqld]
innodb-file-format=barracuda
innodb-file-per-table=1
innodb-large-prefix=1
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

[mysql]
default-character-set = utf8mb4

// Restart SQL//
systemctl restart mariadb
-------------------------------------
Step-10 // Create User//
//Create a user "erpnext"
//Set password,
//Set usermod,
//Set sudo prvilege.
useradd -m -s /bin/bash erpnext
passwd erpnext
usermod -aG sudo erpnext
su - erpnext
//Now you are inside the new user. Now let us set it's path.
vim ~/.bashrc
//add this line
PATH=$PATH:~/.local/bin/
source ~/.bashrc

su - erpnext
sudo mkdir /opt/bench
sudo chown -R erpnext:erpnext /opt/bench
cd /opt/bench
---------------------------------------
  
Step-11 // Install node-sass //
yarn add node-sass
yarn --version //( result must be:1.22.19 )

____________________________________________________
//Now we are entering to Frappe installation. Before that finish all the following tests ( in violet letters ) . Otherwise installation will fail
*****************************
Step-12 //Check App Version//
*****************************
python -V //( result Python 3.11.4 )
node --version //( result must be : v20.17.0 )
npm --version //( result must be : 9.8.1 )
mariadb --version //( result must be mariadb Ver 15.1 Distrib 10.6.7-MariaDB, )
yarn --version //( result must be:1.22.19 )
/opt/bench/node_modules/.bin/node-sass -v 
//( result must be: node-sass	9.0.1	(Wrapper)	[JavaScript] libsass 3.5.5	(Sass Compiler)	[C/C++] )
npm node-sass -v //( Result must be: 9.8.1 )
pip3 -V //( Result must be pip 23.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10) )
pip -V //(Result must be pip 23.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10) )
pip3 --version //( Result must be pip 23.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10) )
pip --version //( Result must be pip 23.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10) )
redis-server --version //(Redis server v=7.0.16 sha=00000000:0 malloc=jemalloc-5.2.1 bits=64 build=a3fdef44459b3ad6)
wkhtmltopdf -V //( wkhtmltopdf 0.12.6 )
git -v //(git version 2.39.1)
***************************************
  
Step-13 //INSTALL VIRTUAL ENVIROMENT//
// Virtual Enviroment Error Managements//
//"This environment is externally managed" in that case, either use following command, or use pipx//
______________________________________
//Virtual Enviroment Chat GPT advise//
//Remember, you'll need to activate this virtual environment every time you work on your project.//
______________________________________
sudo apt install pipx
pipx install frappe-bench

python3 -m venv myenv
source myenv/bin/activate
pip install frappe-bench
pip3 install frappe-bench

Step-14 //INSTALL FRAPPE-BENCH//
bench init frappe-bench --frappe-branch version-15
or
bench init frappe-bench --frappe-branch version-15-beta
cd frappe-bench
sed -i '/web:/ s/$/ --noreload/' Procfile
pip3 install honcho
bench start

Step-15 //Install New Site//
bench new-site site1.local
bench use site1.local

Step-16 //Install ERPNext Version-15//
bench get-app erpnext --branch version-15
Or
bench get-app erpnext --branch version-15-beta

bench get-app payments --branch version-15
or
bench get-app payments --branch version-15-beta
bench --site site1.local install-app erpnext 

Step-17 //Install HRMS Version-15//
bench get-app hrms // version-16 Latest
bench get-app hrms --branch version-15
bench get-app hrms //if Above Not Work//
bench --site site1.local install-app hrms 

Step-18 //Install LENDING / Loan//
bench get-app lending
bench --site site1.local install-app lending

-------------------------
// IF ERROR AFTER HRM INSTALLATION//
bench update --reset
 
//IF ERROR Updating...//
//Disable maintenance mode
bench --site site1.local set-maintenance-mode off
-------------------------

Step-19 //Install CHAT //
bench get-app chat
bench --site site1.local install-app chat

Note:- To Start Bench
source myenv/bin/activate
cd frappe-bench
bench start

//Now you have ERPNext on port 8000. ( http://0.0.0.0:8000 )
                                     (IP_Address:8000) 
//You can run the setup-wizard on the browser.

User Name: administrator
Pasword: What you Enter During Installation
ERPNEXT AND FRAPPE BENCH & ALL APP INSTALL VERSION

cd frappe-bench
bench version

//Check python version
python -V
python3 -V
python -V //( result Python 3.11.4 )
 
//Check pip or pip3 version
pip --version 
pip3 --version
pip -V
pip3 -V

//Check node version.
node --version 

//check npm version and confirm
npm --version
npm node-sass -v //( Result must be: 9.8.1 )
/opt/bench/node_modules/.bin/node-sass -v 
//( result must be:	(Wrapper)	[JavaScript] libsass 3.5.5	(Sass Compiler)	[C/C++] 

//Yarn Version//
yarn --version //( result must be:1.22.19 )

//MariaDB Version//
mariadb --version //( result must be mariadb Ver 15.1 Distrib 10.6.7-MariaDB, )

// Radis Server//
redis-server --version //(Redis server v=7.0.16 sha=00000000:0 malloc=jemalloc-5.2.1 bits=64 build=a3fdef44459b3ad6)

//PDF Version//
wkhtmltopdf -V //( wkhtmltopdf 0.12.6 )

//Git Version//
git -v //(git version 2.39.1)
//----------//


bench switch-to-branch version-14 frappe erpnext
bench switch-to-branch version-14 frappe erpnext --upgrade
  
  ///---------///
  
//1- Take backup. ( Should I explain that !!! ) 
//2- Make sure you don't have any customization those are not committed.
  
cd /opt/bench/frappe-bench/apps/erpnext
git status
  
//Refresh index: 100% (6953/6953), done.
//On branch version-13
//Your branch is up to date with 'upstream/version-13'.
//nothing to commit, working tree clean

/opt/bench/frappe-bench/apps/frappe
git status
  
//On branch version-13
//Your branch is up to date with 'upstream/version-13'.
//nothing to commit, working tree clean

//3-Check python version
python3 -V 
Python 3.8.10 ( needs to be upgraded to 3.10 )

//4-check node version.
node --version
v12.22.12 ( needs to be upgraded to v16.X )

//5-Check pip or pip3 version
pip3 --version 
//20.2 ( needs to be upgrade to 22.x )


//6- Upgrade python

sudo apt install software-properties-common -y
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.10 python3.10-dev python3.10-distutils
//Confirm python version upgrade by
python3.10 --version
Python 3.10.6

//Make Python 3.10 the default.
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1

//Make sure python command executes python3
sudo apt install python-is-python3


python -V
Python 3.10.6
python3 -V
Python 3.10.6

//7 - Upgrade PIP

curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
pip install html5lib
pip3 install --upgrade pip
sudo apt-get remove python3-apt -y
sudo apt-get install python3-apt -y


//check PIP verison and confirm.
pip --version
pip 22.2.2 from /home/erpnext/.local/lib/python3.10/site-packages/pip (python 3.10)
pip3 --version
pip 22.2.2 from /home/erpnext/.local/lib/python3.10/site-packages/pip (python 3.10)


//8- Upgrade Node
curl -sL https://deb.nodesource.com/setup_16.x | bash -
apt-get install nodejs redis-server -y


//check node version and confirm
node --version
v16.17.0



//9- Upgrade NPM

npm upgrade
sudo npm install 16
sudo npm install -g npm@8.19.1


//check npm version and confirm
npm --version
8.19.1


//10 -Move your old python env folder to env-archive, in-case anything goes wrong, you can return to the original


cd /opt/bench/frappe-bench/
mv env env-archive

//11- Create new virtual env for python-3.10

pip install virtualenv
virtualenv --python python3.10 env
env/bin/pip install -U pip

//12- Change git upstream from V13 to V14

env/bin/pip install -e apps/frappe -e apps/erpnext
pip3 install frappe-bench 

bench switch-to-branch frappe erpnext version-14 ( edited this line. Please see the note 2 ** ) 
//( If the above command don't work, use this one )  bench switch-to-branch version-14 frappe erpnext --upgrade 


//check upstream and make sure upstream repository is V14
cd /opt/bench/frappe-bench/apps/erpnext
git status

//Your branch is up to date with 'upstream/version-14'.


cd /opt/bench/frappe-bench/apps/frappe
git status

//Your branch is up to date with 'upstream/version-14'.


//13- Install and upgrade V14. Please note that monolith is broken on V14 and you must install payments and hrms module in addition to ERPNext


bench get-app payments
bench get-app hrms
bench update --reset
bench --site *sitename* install-app hrms
bench --site *sitename* install-app payments
bench --site v13.erpgulf.com migrate

sudo service supervisor restart
sudo service nginx restart

//That is it. Check whether you ERPNext and Frappe upgrade to V14



---------

Note 1: *
//If you face problem with nginx because of log type error ( log type main not found or something like that ) 

vvim /etc/nginx/nginx.conf and add following on http section.

log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"';


-----------------------
Note:2 **

Note from ( https://discuss.erpnext.com/u/flexy2ky ) 
modify this command in your document:
bench switch-to-branch version-14

//As this command will fail if the site has custom apps installed because the command will try to switch the apps to version-14 as well. so the command should be:

bench switch-to-branch frappe erpnext version-14

//This ensures that the switch-to-branch command only affects frappe and erpnext and ignores any other installed app.
//Replace Your Field with "custom_salary1" //


frappe.ui.form.on('Employee', {
    refresh: function(frm) {
        // Add a trigger when the form is refreshed or loaded
        frm.events.custom_salary1_from_ctc(frm);
    },
    ctc: function(frm) {
        // Add a trigger when the ctc field is changed
        frm.events.custom_salary1_from_ctc(frm);
    },
    custom_salary1_from_ctc: function(frm) {
        // Get the value from the ctc field and set it in custom_salary1
        var ctc_value = frm.doc.ctc;
        frm.set_value('custom_salary1', ctc_value);
    }
});
//Rename your Custom Field...
//Replace Your Custom Field with "custom_eobi_salary"
//Replace Custom Field wiht "custom_percentage_of_employee_contribution"
//Replace Custom Field wiht "custom_eobi_1_pct_by_employee"
____________________________________________________________


frappe.ui.form.on('Employee', {
    custom_eobi_salary: function(frm) {
        calculate_eobi_1_pct_by_employee(frm);
    },
    custom_percentage_of_employee_contribution: function(frm) {
        calculate_eobi_1_pct_by_employee(frm);
    }
});

function calculate_eobi_1_pct_by_employee(frm) {
    var eobi_salary = frm.doc.custom_eobi_salary;
    var employee_contribution_percentage = frm.doc.custom_percentage_of_employee_contribution;
    
    if (eobi_salary && employee_contribution_percentage) {
        var eobi_1_pct_by_employee = (eobi_salary * (employee_contribution_percentage / 100)).toFixed(2);
        frm.set_value('custom_eobi_1_pct_by_employee', eobi_1_pct_by_employee);
    }
}
//Rename your Custom Field...
//Replace Your Custom Field with "custom_eobi_salary"
//Replace Custom Field wiht "custom_percentage_of_employeer_contribution"
//Replace Custom Field wiht "calculate_eobi_5_pct_by_employer"

frappe.ui.form.on('Employee', {
    custom_eobi_salary: function(frm) {
        calculate_eobi_5_pct_by_employer(frm);
    },
    custom_percentage_of_employeer_contribution: function(frm) {
        calculate_eobi_5_pct_by_employer(frm);
    }
});

function calculate_eobi_5_pct_by_employer(frm) {
    var eobi_salary = frm.doc.custom_eobi_salary;
    var employeer_contribution_percentage = frm.doc.custom_percentage_of_employeer_contribution;
    
    if (eobi_salary && employeer_contribution_percentage) {
        var eobi_5_pct_by_employer = (eobi_salary * (employeer_contribution_percentage / 100)).toFixed(2);
        frm.set_value('custom_eobi_5_pct_by_employer', eobi_5_pct_by_employer);
    }
}
//Rename your Custom Field...
//Replace Your Custom Field with "custom_pessi_salary"
//Replace Custom Field wiht "custom_percentage_of_pessi_contribution"
//Replace Custom Field wiht "custom_pessi_6_pct_by_employer_"

frappe.ui.form.on('Employee', {
custom_pessi_salary: function(frm) {
calculate_pessi_6_pct_by_employer(frm);
},
custom_percentage_of_pessi_contribution: function(frm) {
calculate_pessi_6_pct_by_employer(frm);
}
});

function calculate_pessi_6_pct_by_employer(frm) {
var pessi_salary = frm.doc.custom_pessi_salary;
var pessi_contribution_percentage = frm.doc.custom_percentage_of_pessi_contribution;

if (pessi_salary && pessi_contribution_percentage) {
var pessi_6_pct_by_employer = (pessi_salary * (pessi_contribution_percentage / 100)).toFixed(2);
frm.set_value('custom_pessi_6_pct_by_employer_', pessi_6_pct_by_employer);
}
}
2- To Calculate Age
------------------------------
--->> BUILD -->DOCTYPE --> SEARCH "EMPLOYEE"
--->> BUILD -->CLIENT SCRIPT -->ADD NEW --> DOCTYPE=EMPLOYEE-->ENTER CODE
//RENAME "age" TO YOUR CUSTOM FIELD NAME.//
_____________________________________________
frappe.ui.form.on('Employee', {
    date_of_birth: function(frm) {
        if (frm.doc.date_of_birth) {
            var birthDate = new Date(frm.doc.date_of_birth);
            var today = new Date();
            var ageInMilliseconds = today - birthDate;
            var ageInYears = Math.floor(ageInMilliseconds / (365.25 * 24 * 60 * 60 * 1000));
            frm.set_value('age', ageInYears);
        }
    }
});
HR MODULE CONFIGURATION 

-Add Custom Fields in Employees Doctype 
-Add Client Scripts 
-Employees Work Experience in Years 
‐-------------------------

Codes to Enter in Scripts:
--->> BUILD -->DOCTYPE --> SEARCH "EMPLOYEE"
--->> BUILD -->CLIENT SCRIPT -->ADD NEW --> DOCTYPE=EMPLOYEE-->ENTER CODE
-----------------------------
To Calculate Work Experienc:

_________________________________________________________________________
frappe.ui.form.on('Employee', {
    onload: function (frm) {
        frm.add_fetch('date_of_joining', 'date_of_joining', 'date_of_joining');
    },
    refresh: function (frm) {
        calculateWorkExperience(frm);
    },
    date_of_joining: function (frm) {
        calculateWorkExperience(frm);
    },
});

function calculateWorkExperience(frm) {
    if (frm.doc.date_of_joining) {
        const dateOfJoining = new Date(frm.doc.date_of_joining);
        const currentDate = new Date();
        const diffInMilliseconds = currentDate - dateOfJoining;
        const years = Math.floor(diffInMilliseconds / (1000 * 60 * 60 * 24 * 365));
        const months = Math.floor((diffInMilliseconds % (1000 * 60 * 60 * 24 * 365)) / (1000 * 60 * 60 * 24 * 30));
        const fractionalYears = (years + months / 12).toFixed(2);
        frm.set_value('work_experience', parseFloat(fractionalYears));
    } else {
        frm.set_value('work_experience', '');
    }
}
BACKUP RESTORE:

//Copy your backup file to frappe-bench folder:
LS -- To show files in folder:

//REPLACE SITE1.LOCAL WITH YOUR SITE NAME:
//REPLACE DATABASE_FILE NAME WITH YOUR DATABASE BACKUP FILE.

bench --site site1.local --force restore [database_file] --with-private-files [private_file] --with-public-files [public_file]


//bench --site site1.local --force restore 20230918_102707-site1_local-database-enc.sql.gz --with-private-files 20230918_102707-site1_local-private-files-enc.tar --with-public-files 20230918_102707-site1_local-files-enc.tar

bench --site site1.local 
--force restore 20230918_102707-site1_local-database-enc.sql.gz 
--with-private-files 20230918_102707-site1_local-private-files-enc.tar 
--with-public-files 20230918_102707-site1_local-files-enc.tar

----------------------------------------------------------------------------------
APPs INSTALL ON BACKUP..
1-ERPNEXT
2-FRAPPE
3-HRMS
4-CHAT
-------------
APPS INTALL ON YOUR LOCAL SITE....???
CHECK YOUR INSTALLATION BY "bench version"
-----------------------------------------

    
REMOVE APP:
bench --site site1.local uninstall-app chat
bench --site site1.local uninstall-app app_name

//REMOVE OTHER APP THAT YOU HAVE EXTRA INSTALL.

REMOVE APP FROM YOUR BACKUP:
bench --site site1.local remove-from-installed-apps erpnext_support
bench --site site1.local remove-from-installed-apps journeys

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

INSTALL HRM:
bench get-app hrms --branch version-14
bench --site sitename install-app hrms

INSTALL CHAT:
bench get-app chat
bench --site site1.local install-app chat

//INSTALL APP THAT YOU DO NOT HAVE ON YOUR SITE BUT HAVE IN BACKUP.

-------------------------------------------------------------------------------------
//Finally Bench Migrate
bench migrate

=====================​

Taimoor
Whatsapp::  +92300-9808900
Step-1
sudo apt-get update -y
sudo apt-get upgrade -y

Step-2
//Create New User//
sudo adduser [frappe-user]
usermod -aG sudo [frappe-user]
su [frappe-user] 
cd /home/[frappe-user]

Step-3
//Install GIT
sudo apt-get install git

Step-4
//Install Python
sudo apt-get install python3-dev python3.10-dev python3-setuptools python3-pip python3-distutils

Step-5
//Install Python Virtual Environment
sudo apt-get install python3.10-venv

Step-6
//Install Software Properties Common
sudo apt-get install software-properties-common

Step-7
//Install MariaDB
sudo apt install mariadb-server mariadb-client

Step-8
//Install Redis Server
sudo apt-get install redis-server

Step-9
//Install other packages, PDF
sudo apt-get install xvfb libfontconfig wkhtmltopdf
sudo apt-get install libmysqlclient-dev

Step-10
//-Configure MYSQL Server-//
//Setup the server
sudo mysql_secure_installation

//When you run this command, the server will show the following prompts. Please follow the steps as shown below to complete the setup correctly.

//Enter current password for root: (Enter your SSH root user password)
//Switch to unix_socket authentication [Y/n]: Y
//Change the root password? [Y/n]: Y
//It will ask you to set new MySQL root password at this step. This can be different from the SSH root user password.
//Remove anonymous users? [Y/n] Y
//Disallow root login remotely? [Y/n]: N
//This is set as N because we might want to access the database from a remote server for using //business analytics software like Metabase / PowerBI / Tableau, etc.
//Remove test database and access to it? [Y/n]: Y
//Reload privilege tables now? [Y/n]: Y
--------------------

Step-11
//Edit MYSQL default config file
sudo nano /etc/mysql/my.cnf
---------------
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

[mysql]
default-character-set = utf8mb4
----------------

Step-12
//Restart Mysql Server
sudo service mysql restart

Step-13
//Install CURL//
sudo apt install curl

Step-14
//Install Node//
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.profile
nvm install 18

Step-15
//Install NPM//
sudo apt-get install npm

Step-16
//Install Yarn//
sudo npm install -g yarn

Step-17
//Install Frappe Bench//
sudo pip3 install frappe-bench

Step-18
//Initialize Frappe Bench//
bench init --frappe-branch version-14 frappe-bench
cd frappe-bench

Step-19
//Change user directory permissions.//
//This will give the bench user execution permission to the home directory.//
chmod -R o+rx /home/[frappe-user]

Step-20
//Install ERPNext and other Apps
//Download all the apps we want to install
//The first app we will download is the payments app. This app is required when setting up ERPNext.
bench get-app payments

Step-21
//Download ERPNext app
bench get-app --branch version-14 erpnext

Step-22
//Download HRMS
bench get-app hrms

Step-23
//Install ERPNEXT
bench --site site1.local install-app erpnext

Step-24
//Install HRMS
bench --site site1.local install-app hrms

Step-25
BENCH START
-----------------------

 Step-26
 //Enable Scheduler
bench --site site1.local enable-scheduler

Step-27
//Disable maintenance mode
bench --site site1.local set-maintenance-mode off

Step-28
//Setup production config
sudo bench setup production [frappe-user]

Step-29
// NGINX Install
bench setup nginx

Step-30
//Restart Supervisor and Launch Production Mode
sudo supervisorctl restart all
sudo bench setup production [frappe-user]
Update Your Ubuntu Operating System:
------------------------------------
Step-1  //Install GIT//
sudo apt-get install git
 
Step-2 //Install Python//
sudo apt-get install python3-dev
 
Step-3
sudo apt-get install python3-setuptools python3-pip
 
Step-4 //Install Python Virtual Enviroment//
sudo apt-get install virtualenv
sudo apt install python3.10-venv
 
Step-5 //Install Software Properties Common//
sudo apt-get install software-properties-common

Step-6 // Install MYSQL Server//
sudo apt install mariadb-server
sudo mysql_secure_installation
 
Step-7 //Install Other Package//
sudo apt-get install libmysqlclient-dev
---------------------------
 
Step-8 // Setup the Server//
sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf

//--Empty or Clear Completly the CNF File and Copy the bellow Code and Paste it.....//
//Ctrl+s --- To Save file.
//Ctrl+x --- To Exit/Close the file.
=================================================
-------------------------------------------------

[server]
user = mysql
pid-file = /run/mysqld/mysqld.pid
socket = /run/mysqld/mysqld.sock
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
bind-address = 127.0.0.1
query_cache_size = 16M
log_error = /var/log/mysql/error.log


[mysqld]
innodb-file-format=barracuda
innodb-file-per-table=1
innodb-large-prefix=1
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci


[mysql]
default-character-set = utf8mb4

-------------------------------------------------
=================================================
-------------------------------------------------
 
Step-9 //Restart SQL//
sudo service mysql restart
 
Step-10 // Install Redis Server//
sudo apt-get install redis-server
 
Step-11 // Install Curl//
sudo apt install curl 
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.profile

Step-12
// Install Node//
nvm install 18
nvm install 20
nvm install 21

Step-13 // Install NPM//
sudo apt-get install npm

Step-14 // Install Yarn//
sudo npm install -g yarn
 
Step-15 // Install PDF//
sudo apt-get install xvfb libfontconfig wkhtmltopdf
 
Step-16 // Install Frappe-Bench//
sudo -H pip3 install frappe-bench
bench --version

Step-17 // Initialize/Install Frappe-Bench//

bench init frappe-bench --frappe-branch version-15
//---OR----//
//For any latest version.
bench init frappe-bench

cd frappe-bench/
bench start
 
Step-18 // create a site in frappe bench//
bench new-site site1.local
bench use site1.local
 
Step-19 //Install Payment Module//
bench get-app payments
bench --site site1.local install-app payments

Step-20 //Download ERPNExt//
bench get-app erpnext --branch version-15
//---OR----//
bench get-app https://github.com/frappe/erpnext --branch version-15

Step-21 //Install ERPNExt//
bench --site site1.local install-app erpnext

Step-22 //BENCH START//
bench start
-------------------------------------------------
-------------------------------------------------
  
INSTALL HRMS
-------------
Step-22 //Download & Install HRMS //
To Install the Latest Version:
Latest Vesion is Version-16.xxx
bench get-app hrms

or
To Install Version-15
bench get-app hrms --branch version-15
bench --site site1.local install-app hrms
-----------------------------------------

INSTALL LOAN / LENDING
----------------------
Step-23 //Download Lending/Loan App//
bench get-app lending
bench --site site1.local install-app lending
--------------------------------------------
// IF ERROR AFTER HRM INSTALLATION//
bench update --reset

//IF ERROR Updating...//
//Disable maintenance mode
bench --site site1.local set-maintenance-mode off


----------------
INSTALL CHAT APP
----------------
Step-24
bench get-app chat
bench --site site1.local install-app chat
-----------------------------------------

  
INSTALL Print Designer
----------------------
bench start
bench new-site print-designer.test
bench --site print-designer.test add-to-hosts
bench get-app https://github.com/frappe/print_designer
bench --site print-designer.test install-app print_designer
 
//Check Installed App List
bench --site site1.local list-apps
 
--------------
IF Not Working
--------------
 
bench --site site1.local clear-cache
bench --site site1.local clear-website-cache
bench --site site1.local reload-doc print_designer
bench --site site1.local migrate
 
bench --site site1.local list-apps
 
----------------
//If Not Working..........
----------------
 
//Uninstall the App:
bench --site site1.local uninstall-app print_designer
//Reinstall the App:......
bench --site site1.local install-app print_designer
//Restart Supervisor......
sudo supervisorctl restart all
 
Restart Your Computer.........

-----------------------
  
  
-----------------------
INSTALL INSIGHTS
----------------
bench start
bench new-site insights.test
bench --site insights.test add-to-hosts
bench get-app https://github.com/frappe/insights
bench --site insights.test install-app insights
-------
http://insights.test:8000/insights

-----------------------------------------------
  
  
-----------------------------------------------
  
 INSTALL BUILDER FOR WEBSITE
---------------------------
 bench get-app builder
 bench --site sitename.localhost install-app builder
 bench browse sitename.localhost --user Administrator
 sitename.localhost:8000/builder
--------------------------------
   
  
  
// IF ERROR//
bench update --reset


//Disable maintenance mode
bench --site site1.local set-maintenance-mode off
_________________________________________________











============================================================
//WARN: restart failed: couldnot find supervisorctl in PATH//

sudo apt-get install supervisor
sudo nano /etc/supervisor/supervisord.conf

     [inet_http_server]
     port = 127.0.0.1:9001
     username = your_username
     password = your_password

sudo nano /etc/supervisor/supervisord.conf


[program:supervisord]
command=/usr/bin/supervisord -c /etc/supervisor/supervisord.conf
autostart=true
autorestart=true
redirect_stderr=true
environment=PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/path/to/your/virtualenv/bin"

sudo service supervisor restart

//Check Supervisor Status://
sudo service supervisor status
sudo service supervisor start
which supervisorctl

//Check Permissions://
sudo usermod -aG sudo your_username
supervisorctl status

//Activate Virtual Environment//
source /path/to/your/virtualenv/bin/activate

//supervisorctl status//
sudo supervisorctl status

cd ~/frappe-bench
bench restart


//Restart all services after the update://
$ supervisorctl reload


  
$> md5sum mysql-standard-8.1.0-linux-i686.tar.gz
aaab65abbec64d5e907dcd41b8699945  mysql-standard-8.1.0-linux-i686.tar.gz
wget --mirror --convert-links --wait=2 https://websitename.com
node -e "console.log(crypto.randomBytes(32).toString('hex'))"

// 8142e7beb79d8b0988fd0c22ceaf8b92c29a4ca264d70632ce0ee18e31110cdc
$ sudo hdparm -Tt /dev/sda
/dev/sda:
 Timing cached reads:   16924 MB in  2.00 seconds = 8469.95 MB/sec
 Timing buffered disk reads: 1386 MB in  3.00 seconds = 461.50 MB/sec
How to Stress Test Your Raspberry Pi
Now it's time to find out what your Pi is really made of. Open up a terminal window and enter the following to download Stress and cpuburn-a53:

sudo apt-get install stress

wget https://raw.githubusercontent.com/ssvb/cpuburn-arm/master/cpuburn-a53.S

gcc -o cpuburn-a53 cpuburn-a53.S
Now to run these tests, we're going to be monitoring the ARM CPU frequency to see whether the Pi automatically throttles the speed (indicates temperature of 80C) and the core temperature. Pay close attention to these, and if the temperature gets too hot, be prepared to pull the power. It's a good idea to run these tests on a fresh image of Raspbian to ensure that any important files don't get corrupted in case you need to pull the power (in case of a system freeze, crash or over-temp).

**If you need to shutdown your system while it's non-responsive, try pressing alt prtscr b before pulling the power, if that doesn't work, then remove the power supply**

To run Stress, use the following terminal command:

while true; do vcgencmd measure_clock arm; vcgencmd measure_temp; sleep 10; done& stress -c 4 -t 900s
Monitor the CPU frequency and temperature for 10mins and only move on to cpuburn-a53 if the test is run for 10mins without throttling or 80C temperatures.

brew services restart mongodb/brew/mongodb-community





















# Zsh
1. zsh: https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH
2. Oh My Zsh: https://github.com/ohmyzsh/ohmyzsh
3. Powerlevel10k: https://github.com/romkatv/powerlevel10k

	// Don't forget to set the theme and install the fonts
	https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf
	https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf
	https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf
	https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf

	// Execute this to configure the theme
	p10k configure

# Plugins:
// One Dark colour theme
  https://github.com/one-dark/iterm-one-dark-theme

// Look at history of previous commands used:-
  https://github.com/junegunn/fzf

// Command line auto suggestions:-
  https://github.com/zsh-users/zsh-autosuggestions
  
// Quick switch to directories
  https://github.com/agkozak/zsh-z
  
// Found these on this blog post https://udaraw.com/iterm-plugins
git clone https://github.com/ChristianChiarulli/Machfiles.git ~
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
▶ My shell setup:
* Fish shell: https://fishshell.com/
* Fisher: https://github.com/jorgebucaran/fisher
* Shellder: https://github.com/simnalamburt/shellder
* Nerd fonts: https://github.com/ryanoasis/nerd-fonts
* z for fish: https://github.com/jethrokuan/z
* Exa: https://the.exa.website/
* ghq: https://github.com/x-motemen/ghq
* peco: https://github.com/peco/peco
//screenshot entire screen, named ‘test.jpg’ in current working Terminal directory
screencapture test.jpg

// change path
screencapture ~/Desktop/screenshot.jpg

// copy to clipboard
screencapture -c

// specify file type
screencapture -t tiff sample.tiff
open a new tab                             # cmd + t
close tab                                  # cmd + w
clear window (keeping history)             # ctrl + l
clear window (losing history)              # cmd + k
reach next word                            # alt + →
reach previous word                        # alt + ←
reach beginning of line                    # ctrl + a
reach end of line                          # ctrl + e
erase the whole line                       # ctrl + u
navigate to tab on the right               # cmd + shift + →
navigate to tab on the left                # cmd + shift + ←
Do you have zsh installed (ii)? dpkg -l zsh
Is your shell set to zsh? Last field of grep $USER /etc/passwd
Is Zsh a valid login shell? grep zsh /etc/shells
python@3.8 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.

If you need to have python@3.8 first in your PATH run:
  echo 'export PATH="/usr/local/opt/python@3.8/bin:$PATH"' >> ~/.zshrc

For compilers to find python@3.8 you may need to set:
  export LDFLAGS="-L/usr/local/opt/python@3.8/lib"

For pkg-config to find python@3.8 you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/python@3.8/lib/pkgconfig"

➜  ~ python --version
zsh: command not found: python3.8
➜  ~ vim .zshrc
➜  ~ source .zshrc
➜  ~ echo 'export PATH="/usr/local/opt/python@3.8/bin:$PATH"' >> ~/.zshrc
➜  ~ source .zshrc
star

Wed Jul 24 2024 00:13:20 GMT+0000 (Coordinated Universal Time) https://scoop.sh/

#scoop #terminal
star

Sun Apr 14 2024 13:49:30 GMT+0000 (Coordinated Universal Time) https://gree2.github.io/mac/2015/07/18/mac-network-commands-cheat-sheet

#bash #terminal #mac #networking
star

Sun Apr 14 2024 13:47:13 GMT+0000 (Coordinated Universal Time) https://gree2.github.io/mac/2015/07/18/mac-network-commands-cheat-sheet

#bash #mac #terminal #networking
star

Sun Apr 14 2024 13:45:53 GMT+0000 (Coordinated Universal Time) https://gree2.github.io/mac/2015/07/18/mac-network-commands-cheat-sheet

#bash #mac #terminal #networking
star

Sun Apr 14 2024 13:44:27 GMT+0000 (Coordinated Universal Time) https://gree2.github.io/mac/2015/07/18/mac-network-commands-cheat-sheet

#bash #terminal #mac #networking
star

Sun Nov 05 2023 16:44:56 GMT+0000 (Coordinated Universal Time)

#mac #terminal #commandline
star

Tue Oct 24 2023 17:23:13 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/17541614/use-images-instead-of-radio-buttons

#terminal #bash
star

Wed Sep 20 2023 07:13:40 GMT+0000 (Coordinated Universal Time)

#terminal
star

Wed Sep 20 2023 05:15:08 GMT+0000 (Coordinated Universal Time)

#terminal
star

Wed Sep 20 2023 04:58:08 GMT+0000 (Coordinated Universal Time)

#terminal
star

Mon Sep 18 2023 20:26:33 GMT+0000 (Coordinated Universal Time)

#terminal
star

Mon Sep 18 2023 20:04:45 GMT+0000 (Coordinated Universal Time)

#terminal
star

Mon Sep 18 2023 19:40:52 GMT+0000 (Coordinated Universal Time)

#terminal
star

Mon Sep 18 2023 19:27:07 GMT+0000 (Coordinated Universal Time)

#terminal
star

Mon Sep 18 2023 16:00:02 GMT+0000 (Coordinated Universal Time)

#terminal
star

Mon Sep 18 2023 15:55:48 GMT+0000 (Coordinated Universal Time)

#terminal
star

Mon Sep 18 2023 10:22:00 GMT+0000 (Coordinated Universal Time)

#terminal
star

Sat Sep 16 2023 05:44:56 GMT+0000 (Coordinated Universal Time)

#terminal
star

Fri Sep 15 2023 03:27:52 GMT+0000 (Coordinated Universal Time)

#terminal
star

Fri Sep 08 2023 16:53:18 GMT+0000 (Coordinated Universal Time)

#terminal
star

Tue Sep 05 2023 04:21:26 GMT+0000 (Coordinated Universal Time) https://dev.mysql.com/doc/refman/8.1/en/verifying-md5-checksum.html

#terminal
star

Wed Aug 02 2023 19:57:10 GMT+0000 (Coordinated Universal Time)

#terminal #bash
star

Wed Sep 07 2022 09:03:24 GMT+0000 (Coordinated Universal Time)

#terminal #private-key #api
star

Thu Jul 07 2022 10:56:49 GMT+0000 (Coordinated Universal Time) https://ineed.coffee/Old+Posts/A+beginner's+tutorial+for+mbpfan+under+Ubuntu

#mbpfan #ubuntu20.04 #commandline #macbookpro #terminal #fanspeed
star

Tue Apr 05 2022 15:48:31 GMT+0000 (Coordinated Universal Time) https://devconnected.com/how-to-list-disks-on-linux/

#terminal #linux
star

Tue Apr 05 2022 15:44:18 GMT+0000 (Coordinated Universal Time) https://www.shellhacks.com/disk-speed-test-read-write-hdd-ssd-perfomance-linux/

#linux #terminal #benchmark
star

Sun Mar 27 2022 17:02:41 GMT+0000 (Coordinated Universal Time) https://core-electronics.com.au/guides/stress-testing-your-raspberry-pi/

#raspberry #terminal
star

Sat Mar 12 2022 13:58:00 GMT+0000 (Coordinated Universal Time)

#terminal #commandline
star

Fri Feb 11 2022 23:22:04 GMT+0000 (Coordinated Universal Time)

#url #zsh #ohmyzsh #terminal #ubuntu #git #shell #bash
star

Wed Jan 26 2022 12:23:08 GMT+0000 (Coordinated Universal Time) https://github.com/ChristianChiarulli/Machfiles

#zsh #terminal
star

Sun Jan 23 2022 11:52:23 GMT+0000 (Coordinated Universal Time) https://ubuntu.com/tutorials/ubuntu-on-windows#1-overview

#wsl #wsl2 #windows #powershell #terminal #commands
star

Thu Jan 20 2022 23:52:33 GMT+0000 (Coordinated Universal Time) https://www.youtube.com/watch?v

#fisher #powershell #terminal
star

Mon Sep 20 2021 18:51:42 GMT+0000 (Coordinated Universal Time) https://axios-http.com/docs/intro

#terminal
star

Mon Jun 07 2021 07:00:32 GMT+0000 (Coordinated Universal Time) https://osxdaily.com/2011/08/11/take-screen-shots-terminal-mac-os-x/

#iterm #terminal #commandline #osx
star

Wed Apr 07 2021 09:11:03 GMT+0000 (Coordinated Universal Time) https://github.com/Eschults/useful_stuff

#terminal #shortcuts
star

Mon Jan 04 2021 12:10:49 GMT+0000 (Coordinated Universal Time) https://askubuntu.com/questions/131823/how-to-make-zsh-the-default-shell

#terminal
star

Wed Dec 23 2020 16:31:49 GMT+0000 (Coordinated Universal Time)

#terminal #commandline

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension