Postingan

Membuat User Baru dan Grant Permissions di MySQL

Gambar
Just For Fun
Membuat User Baru dan Grant Permissions di MySQL
Untuk tulisan yang saya tandai merah, silahkan disesuaikan saja

Tentang MYSQL
MySQL adalah open source database management system yang sangat populer dikalangan programmer, khususnya programmer PHP.

Untuk grant permission saya buat untuk project yang sudah di live server. Untuk meminimalisir hilangnya drop database. Namun untuk development dilocal saya pakai full acces.

Membuat User MySQL Baru
Sebelumnya sobat smua pasti sudah punya superuser dari database mysql, biasanya ini saat pertama kali install mysql/mariadb di server.

Silahkan buka terminal server sobat lalu jalankan perintah berikut:

mysql -u [username database] -p 

contoh :
mysql -u root -p


Setelah itu muncul permintaan mengisi password, dan lalu masuk ke MySQL shell,


Jalankan perintah berikut untuk membuat user

CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
cotoh :

CREATE USER 'toko'@'localhost' IDENTIFIED BY &#…

Steps to install a Comodo PositiveSSL certificate with Nginx.

Gambar
Setting up a SSL Cert from Comodo
I use https://secure.instantssl.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert
Prior to purchasing a cert, you need to generate a private key, and a CSR file (Certificate Signing Request). You'll be asked for the content of the CSR file when ordering the certificate.

First :
open your terminal

mkdir /etc/nginx/ssl
cd /etc/nginx/ssl

and run

openssl req -new -newkey rsa:2048 -nodes -keyout example_com.key -out example_com.csr

This gives you two files:

example_com.key -- your Private key. You'll need this later to configure ngxinx.
example_com.csr -- Your CSR file.



Now, purchase the certificate [1], follow the steps on their site, and you should soon get an email with your PositiveSSL Certificate. It contains a zip file with the following:

1. klik https://secure.instantssl.com/
2. Select your product, for example InstantSSL …

Install Nginx, PHP 7, MariaDB 10 (LEMP) on CentOS 7

Gambar
yum update

yum install epel-release

Nginx
yum install nginx

systemctl start nginx

systemctl enable nginx

MariaDB 10
vi /etc/yum.repos.d/MariaDB.repo

add

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
then

yum install MariaDB-server MariaDB-client

systemctl start mariadb Y, Y, Y, Y mysql_secure_installation

systemctl enable mariadb

PHP 7
add the Webtatic repo:

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

install

yum install php70w

see if it works or not

php -v


Search available modules

yum search php70



install modules you need

yum install php70w-xml php70w-soap php70w-xmlrpc php70w-mbstring php70w-json php70w-gd php70w-mcrypt php70w-mysql 
yum install php70w-intl php70w-tidy
yum install php70w-pecl-redis 
yum install php-pecl-mongodb
yum install php70w-fpm
yum install php70w-devel php70w-pear
yum install php70w-pecl-apcu php70w-opcache

vi /etc/php.ini

find cgi.fix_pathinfo=1 and then replace it with cgi.fi…

How can I copy the contents of a folder to another folder in a different directory using terminal?

Gambar
How can I copy the contents of a folder to another folder in a different directory using terminal?

Yes OF Course

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. https://askubuntu.com/questions/86822/how-can-i-copy-the-contents-of-a-folder-to-another-folder-in-a-different-directo muhamad tobiin tobidsn muhamad tobiin tobidsn@gmail http://github.com/tobidsn https://www.facebook.com/tobidsn https://github.com/tobidsn ahmad muhamad tobiin ahmad muhamad tobiin tobidsn muhamad tobiin tobidsn@gmail http://github.com/tobidsn https://www.facebook.com/tobidsn https://github.com/tobidsn ahmad muhamad tobiin ahmad muhamad tobiin tobidsn muhamad tobiin tobidsn@gmail http://github.com/tobidsn https://www.…

How To Set Up Apache Virtual Hosts on CentOS 7

Gambar
Introduction The Apache web server is the most popular way of serving web content on the Internet. It serves more than half of all of the Internet's active websites, and is extremely powerful and flexible.
In this guide, we will walk through how to set up Apache virtual hosts on a CentOS 7 VPS. During this process, you'll learn how to serve different content to different visitors depending on which domains they are requesting.
In this case, my office requires me to use apache. Prerequisites Before you begin with this guide, there are a few steps that need to be completed first.
You will need access to a CentOS 7 server with a non-root user that has sudo privileges. If you haven't configured this yet, you can run through the CentOS 7 initial server setup guide to create this account.
You will also need to have Apache installed in order to configure virtual hosts for it. If you haven't already done so, you can use yum to install Apache through CentOS's default softw…

NOTE : My Simply MariaDB/MySQL Command Line

Gambar
MySQL
Getting started:
http://www.sqlteaching.com/
https://www.codecademy.com/courses/learn-sql

Related tutorials:
MySQL-CLI
Analyzing Business Metrics
SQL joins infografic

Tools:
Heidisql

Commands
Access monitor: mysql -u [username] -p; (will prompt for password)

Show all databases: show databases;

Access database: mysql -u [username] -p [database] (will prompt for password)

Create new database: create database [database];

Select database: use [database];

Determine what database is in use: select database();

Show all tables: show tables;

Show table structure: describe [table];

List all indexes on a table: show index from [table];

Create new table with columns: CREATE TABLE [table] ([column] VARCHAR(120), [another-column] DATETIME);

Adding a column: ALTER TABLE [table] ADD COLUMN [column] VARCHAR(120);

Adding a column with an unique, auto-incrementing ID: ALTER TABLE [table] ADD COLUMN [column] int NOT NULL AUTO_INCREMENT PRIMARY KEY;

Inserting a record: INSERT INTO [table] ([column], [colum…

How to create and extract a .tar.gz archive using command line

Gambar
One of the most common compression formats used in GNU/Linux and variants is tar.gz. A tar.gz file is nothing but a gzipped tar archive. These days users of GNU/Linux system seldom have to use the command line to create or extract tar.gz archives. But it is a useful command to keep in your arsenal if you are a system administrator.

To create a tar.gz archive from a given folder you can use the following command

tar -zcvf tar-archive-name.tar.gz source-folder-name 

This will compress the contents of source-folder-name to a tar.gz archive named tar-archive-name.tar.gz

To extract a tar.gz compressed archive you can use the following command

tar -zxvf tar-archive-name.tar.gz 

This will extract the archive to the folder tar-archive-name.

http://www.zyxware.com/articles/2009/02/26/how-to-create-and-extract-a-tar-gz-archive-using-command-line