https://www.learnpython.org/en/
Author Archives: barewabar
How to setup
You can
Searching the entire DB for a column by name
Method 1:
SELECT * FROM `information_schema`.`COLUMNS`
where COLUMN_NAME LIKE "%sdfgsdfg%"
LIMIT 2000;
Method 2
Oracle:
SELECT owner,table_name, column_name
FROM all_tab_columns
WHERE column_name like '%YOUR_COLUMN_NAME%'
AND OWNER in ('YOUR_SCHEMA_NAME'); )
Common Commands
See list of actions on server: netstat -punta |grep nginx |wc -l
How do I login as root user?
Open terminal and simply type the following command:
$ sudo bash
OR
$ sudo -s
ls, ls -1 list dir
cd, cd-, cd ~ change dir
pwd
su -i
xmp
You can copy the content of a folder /source to another existing folder /dest with the command
cp -a /source/. /dest/
The -a option is an improved recursive option, that preserve all file attributes, and also preserve symlinks.
The . at end of the source path is a specific cp syntax that allow to copy all files and folders, included hidden ones.
grep -Ril “text-to-find-here” /
i stands for ignore case (optional in your case).
R stands for recursive.
l stands for “show the file name, not the result itself”.
/ stands for starting at the root of your machine.
Find file anywhere in system:
find / -name my.cnf
See your disc sizes report:
df -h
tail -f /var/log/syslog | grep mysql
tail -f frappe.log
Introduction
What is HTML?
HTML is the standard markup language for creating Web pages.
- HTML stands for Hyper Text Markup Language
- HTML describes the structure of Web pages using markup
- HTML elements are the building blocks of HTML pages
- HTML elements are represented by tags
- HTML tags label pieces of content such as “heading”, “paragraph”, “table”, and so on
- Browsers do not display the HTML tags, but use them to render the content of the page
A Simple HTML Document
!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body><h1>My First Heading</h1>
<p>My first paragraph.</p></body>
</html>Create New Site
Assuming that you’ve already got your first site running and you’ve performed the production deployment steps, this section explains how to host your second site (and more). Your first site is automatically set as default site. You can change it with the command,
bench use sitename
Port based multitenancy
You can create a new site and make run it on a different port (while the first one runs on port 80).
- Create a new site
bench new-site site2name - Set port
bench set-nginx-port site2name 82 - Re generate nginx config
bench setup nginx - Reload nginx
sudo service nginx reload
DNS based multitenancy
You can name your sites as the hostnames that would resolve to it. Thus, all the sites you add to the bench would run on the same port and will be automatically selected based on the hostname.
DNS based multitenancy mode is disabled by default, you can switch it on / off using the command,
bench config dns_multitenant on
To make a new site under DNS based multitenancy, perform the following steps.
- Create a new site
bench new-site site2name - Re generate nginx config
bench setup nginx - Reload nginx
sudo service nginx reload
Note : For “DNS based multitenancy”, currentsite.txt in frappe-bench/sites/ should be empty.
Source: https://github.com/frappe/bench/wiki/Multitenant-Setup
Installation
Here are steps to install frappe
Resources
https://frappe.io/docs/user/en/bench/resources/bench-commands-cheatsheet
https://github.com/frappe/bench/wiki/Quick-Reference-Guide
https://github.com/frappe/bench/wiki/Quick-Reference-Guide
https://frappe.io/docs/user/en/bench/resources
Back Up SIte with all files: bench –site all backup –with-files
Show current tasks of Ubuntu: netstat -punta |grep nginx |wc -l
MYSQL:
mysql -u root -p
Database:
select * from `tabPayment Entry` where base_total_allocated_amount=24;
Frappe and site:
bench version, gives you the verison of the bench and frappe and erpnext etc
bench drop-site [sitename] This will remove the site folder and the database as well.
Install cusjtom frappe apps by fra: bench get-app meeting https://github.com/frappe/meeting
https://frappe.io/docs/user/en/bench/resources
Cache
- bench clear-cache
- bench clear-website-cache …You can run these from your frappe-bench folder.
How to manage processes from the Ubuntu Linux terminal
The ps command is a traditional Ubuntu Linux command to lists running processes. The following command shows all processes running on your system:
{vivek@ubuntu-box:~}$ ps -aux
{vivek@ubuntu-box:~}$ sudo ps -a
{vivek@ubuntu-box:~}$ sudo ps -U vivek
{vivek@ubuntu-box:~}$ ps -U tom
https://www.cyberciti.biz/faq/how-to-check-running-process-in-ubuntu-linux-using-command-line/