Categories
Technology

Install frappe on Debian base (ubuntu)

Debian / Ubuntu

install python3.10
https://cloudbytes.dev/snippets/upgrade-python-to-latest-version-on-ubuntu-linux

install supervisor :
apt-get install supervisor
systemctl enable supervisor
systemctl start supervisor
sudo systemctl restart supervisor

Install git, python, and redis

sudo apt install git python-dev python-pip redis-server
# use below commadn on ubunntu 20
sudo apt install git python-dev python3-pip redis-server

Install MariaDB

sudo apt install software-properties-common

If you are on Ubuntu version older than 20.04, run this before installing MariaDB:

sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://ftp.ubuntu-tw.org/mirror/mariadb/repo/10.3/ubuntu xenial main'

If you are on version Ubuntu 20.04, then MariaDB is available in default repo and you can directly run the below commands to install it:

sudo apt-get update
sudo apt-get install mariadb-server

During this installation you’ll be prompted to set the MySQL root password. If you are not prompted, you’ll have to initialize the MySQL server setup yourself. You can do that by running the command:

mysql_secure_installation

Remember: only run it if you’re not prompted the password during setup.

It is really important that you remember this password, since it’ll be useful later on. You’ll also need the MySQL database development files.

apt-get install mariadb-client-10.3

Now, edit the MariaDB configuration file.

nano /etc/mysql/my.cnf

And add this configuration

[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

[mysql]
default-character-set = utf8mb4

Now, just restart the mysql service and you are good to go.

service mysql restart

Install Node

We recommend installing node using nvm

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash

After nvm is installed, you may have to close your terminal and open another one. Now run the following command to install node.

nvm install 14

Verify the installation, by running:

node -v
# output
v14.17.2

Finally, install yarn using npm

npm install -g yarn

Install wkhtmltopdf

apt-get install xvfb libfontconfig wkhtmltopdf

Install Bench CLI

Install bench via pip3

pip3 install frappe-bench

Confirm the bench installation by checking version

bench --version

# output
5.2.1

Create your first bench folder.

cd ~
bench init frappe-bench

After the frappe-bench folder is created, change your directory to it and run this command

bench start

Congratulations, you have installed bench on to your system.

Categories
Linux Technology

apt update vs apt upgrade: What’s the difference?

https://dev.to/kcdchennai/apt-update-vs-apt-upgrade-whats-the-difference-2ff8

Categories
Linux Technology

Install def file in ubuntu

Use command below :
sudo dpkg -i PACKAGEFILE

reference :
https://askubuntu.com/questions/1407494/screen-share-not-working-in-ubuntu-22-04-in-all-platforms-zoom-teams-google-m

Categories
Linux Technology

Share screen in ubunut 22

You need to disable Wayland


refrence :
https://askubuntu.com/questions/1407494/screen-share-not-working-in-ubuntu-22-04-in-all-platforms-zoom-teams-google-m

Categories
Linux Technology

Find software which is using a port on linux

lsof -i :8000

Categories
Linux Shell Technology

Watch all tpc port that are listening :

ss -apt
Categories
Linux Technology

Remove A app from linux completely

first , purge main package name :

sudo apt-get purge mariadb-server 

then

sudo apt autoremove

then run this command to find all packages that may are related to the package which you want to purge :

sudo dpkg -l | grep mariadb 

after that purg services that are returned one by one

Categories
Technology

telegram proxy

https://iransec-team.ir/266/%D8%B3%D8%A7%D8%AE%D8%AA-%D9%BE%D8%B1%D9%88%DA%A9%D8%B3%DB%8C-mtproto-%D8%AF%D8%B1-%D8%B3%D8%B1%D9%88%D8%B1-%D9%84%DB%8C%D9%86%D9%88%DA%A9%D8%B3-%D9%88-%D9%88%DB%8C%D9%86%D8%AF%D9%88%D8%B2

Categories
devops Technology

DockerFile properties

ARG

On building a docker image you may want to have some variables (you can also have them in docker-compose)

you can define ARG in docker file (you can also set default value for them in docker file)

for example :

# in docker file
ARG some_variable_name = xxxx
ARG uid

#on building image : 
$ docker build --build-arg some_variable_name=a_value

ENV

ENV variables are also available during the build, as soon as you introduce them with an ENV instruction. However, unlike ARG, they are also accessible by containers started from the final image. ENV values can be overridden when starting a container, more on that below.

# no default value
ENV hey
# a default value
ENV foo /bar
# or ENV foo=/bar

# ENV values can be used during the build
ADD . $foo
# or ADD . ${foo}
# translates to: ADD . /bar


on running docker : 
$ docker run -e "env_var_name=another_value" alpine env

RUN

for example :

# Install system dependencies
RUN apt-get update && apt-get install -y \
    git \
    curl \
    libpng-dev \
    libonig-dev \
    libxml2-dev \
    zip \
    unzip

# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

# Install PHP extensions
RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd

ADD , COPY

COPY and ADD are both Dockerfile instructions that serve a similar purpose. They let you copy files from a specific location into a Docker image.

ADD

ADD  does that same but in addition, it also supports 2 other sources. 

  1. A URL instead of a local file/directory.
  2. Extract tar from the source directory into the destination.

COPY

COPY takes in a source and destination. It only lets you copy in a local or directory from your host (the machine-building the Docker image) into the Docker image itself.

for example :

# Get latest Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

WORKDIR

for example:

# Set working directory
WORKDIR /var/www

USER

for example:

USER $user
Categories
Technology Web Development

change PHP version

Change Global (command line) php version (for laravel):

use this command :

sudo update-alternatives --config php

for more see link below :

https://bytexd.com/fix-laravel-return-type-of-illuminatesupportcollectionoffsetexistskey/

Change apache PHP version (for projects which you run with apache):

#(old php version)
sudo a2dismod php5 

#(new php version )
sudo a2enmod php7.1 

sudo systemctl restart apache2

https://superuser.com/questions/969861/phpinfo-and-php-v-shows-different-version-of-php