CapitalizedWords (or CapWords, or CamelCase – so named because of the bumpy look of its letters [4]). This is also sometimes known as StudlyCaps.Note: When using acronyms in CapWords, capitalize all the letters of the acronym. Thus HTTPServerError is better than HttpServerError.
mixedCase (differs from CapitalizedWords by initial lowercase character!)
Capitalized_Words_With_Underscores (ugly!)
Class Names
Class names should normally use the CapWords convention.
Function Names
Function names should be lowercase, with words separated by underscores as necessary to improve readability. (lower_case_with_underscores)
Variable Names
Variable names follow the same convention as function names.
Before you can use the Databricks extension for Visual Studio Code, your Databricks workspace and your local development machine must meet the following requirements. You must also have an access token to authenticate with Databricks.
%sql
SELECT * FROM delta.`${DA.paths.datasets}/nyctaxi-with-zipcodes/data`
SELECT * FROM text.`dbfs:/databricks-datasets/Rdatasets/data-001/datasets.csv`
SELECT * FROM csv.`dbfs:/databricks-datasets/Rdatasets/data-001/datasets.csv`
ใช้ SQL อ่านไฟล์แบบ text
ใช้ backtick ` ครอบ
%sql
SELECT * FROM text.`dbfs:/databricks-datasets/Rdatasets/data-001/datasets.csv`
ใช้ SQL อ่านไฟล์แบบ CSV
%sql
SELECT * FROM csv.`dbfs:/databricks-datasets/Rdatasets/data-001/datasets.csv`
%sql
/*Table creation with schema*/
CREATE OR REPLACE TABLE table1 (
Package string,
Item string,
Title string,
csv string,
doc string
);
SHOW TABLE อีกทีจะเห็นตาราง table1
ลอง SHOW CREATE TABLE
%sql
SHOW CREATE TABLE table1;
copy ข้อมูลจากไฟล์ csv ลงตาราง
%sql
/*Copying dbfs csv data into table*/
COPY INTO table1
FROM "dbfs:/databricks-datasets/Rdatasets/data-001/datasets.csv"
FILEFORMAT = csv
FORMAT_OPTIONS('header'='true','inferSchema'='True');
Before we can use any SSL certificates, we first have to enable mod_ssl, an Apache module that provides support for SSL encryption.
Enable mod_ssl with the a2enmod command:
$ sudo a2enmod ssl
[sudo] password for jack:
Considering dependency setenvif for ssl:
Module setenvif already enabled
Considering dependency mime for ssl:
Module mime already enabled
Considering dependency socache_shmcb for ssl:
Enabling module socache_shmcb.
Enabling module ssl.
See /usr/share/doc/apache2/README.Debian.gz on how to configure SSL and create self-signed certificates.
To activate the new configuration, you need to run:
systemctl restart apache2
Restart Apache to activate the module:
sudo systemctl restart apache2
Creating the SSL Certificate
Now that Apache is ready to use encryption, we can move on to generating a new SSL certificate. The certificate will store some basic information about your site, and will be accompanied by a key file that allows the server to securely handle encrypted data.
We can create the SSL key and certificate files with the openssl command:
Then make the web server user (www-data) as the owner of this directory.
sudo chown -R www-data:www-data /var/www/mautic/
Step 2: Create a MariaDB Database and User for Mautic
Log in to MariaDB console.
sudo mysql
Next, create a new database for Mautic using the following command. This tutorial names it mautic, you can use whatever name you like for the database.
CREATE DATABASE mautic DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
จะมี warning ประมาณนี้
CREATE DATABASE mautic DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci 1 row(s) affected, 2 warning(s):
3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
3778 'utf8mb3_unicode_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead.
ให้เปลี่ยนเป็นใช้คำสั่งนี้แทน
CREATE DATABASE mautic DEFAULT CHARACTER SET UTF8MB4 COLLATE utf8mb4_unicode_ci;
The following command will create a database user and password, and at the same time grant all permission of the new database to the new user so later on Mautic can write to the database. Replace red texts with your preferred database name, username and password.
CREATE USER 'jack'@'localhost' IDENTIFIED BY 'password';
GRANT ALL ON mautic.* TO 'jack'@'localhost' IDENTIFIED BY 'password';
Flush privileges table and exit MariaDB console.
FLUSH PRIVILEGES;
EXIT;
Step 3: Install Required and Recommended PHP Modules.
Run the following command to install PHP modules required or recommended by Mautic
If you use Apache web server, then you need to disable the PHP module for Apache.
sudo a2dismod php7.4
You also need to disable the prefork MPM module in Apache.
sudo a2dismod mpm_prefork
Now you need to run the following command to enable three modules in order to use PHP-FPM in Apache, regardless of whether mod_php is installed on your server.
sudo a2enmod mpm_event proxy_fcgi setenvif
Then restart Apache.
sudo systemctl restart apache2
Step 4: Create Apache Virtual Host for Mautic
If you use Apache web server, create a virtual host for Mautic.
$ sudo mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.32-0ubuntu0.20.04.2 (Ubuntu)
Copyright (c) 2000, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
สร้าง user
CREATE USER 'jack'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON * . * TO 'jack'@'localhost';
FLUSH PRIVILEGES;
SELECT user,authentication_string,plugin,host FROM mysql.user;
You now have access to the MySQL server configuration file. Scroll down to the bind-address line and change the IP address. The current default IP is set to 127.0.0.1. This IP limits MySQL connections to the local machine.
The new IP should match the address of the machine that needs to access the MySQL server remotely. For example, if you bind MySQL to 0.0.0.0, then any machine that reaches the MySQL server can also connect with it.
bind-address = 0.0.0.0
sudo systemctl restart mysql
สร้าง remote user โดย remote ไปจากเครื่อง 192.168.1.124
CREATE USER 'jack'@'192.168.1.124' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON * . * TO 'jack'@'192.168.1.124';
FLUSH PRIVILEGES;