Latest Posts

Large projects with a good amount of design and creative work require a strategy to organize and maintain all of its CSS components. In such large projects, it becomes harder to maintain or scale the components if there is no clear naming convention in place to identify the different components used in many different views. 

BEM ( Block, Element, Modifier )

 

The BEM approach ensures that everyone who participates in the development of a website works with a single codebase and speaks the same language. Using proper naming will prepare you for the changes in design of the website.

Block

Encapsulates a standalone entity that is meaningful on its own. While blocks can be nested and interact with each other, semantically they remain equal; there is no precedence or hierarchy. Holistic entities without DOM representation (such as controllers or models) can be blocks as well.

Naming

Block nam....... Read More

To start a shell connection:

psql -h hostname -U username databasename

Import data into a table:

psql -h hostname -U username database_name > data.sql 

The database can return its own configuration file location on the server with:

SHOW config_file;

Same for data directory:

SHOW data_directory;

OR:

select setting from pg_settings where name = 'Name of a setting';

CREATING DATABASES, CHANGING SCHEMAS and the normal tasks:

Use schema name with period in psql command to obtain information about this schema.

Setup:

test=# create schema test_schema;
CREATE SCHEMA
test=# create table test_schemaRead More
			

find php syntax errors in a directory :

 

find -L directory/to/scan -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l

You can do that in one command:

sudo openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days XXX

You can add -nodes if you don't want to protect your private key with a passphrase.

Self-signed certs are not validated with any third party unless you import them to the browsers previously. If you need more security, you should use a certificate signed by a CA.

 

Generally, these are the steps to generate a self signed certificate

 

1- Generate a a private key

sudo openssl genrsa -out example.key 2048

 

2- Request a Certificate signing request

sudo openssl req -new -key example.key -out example.csr

 

3- Generate the certificate signed with our generated key

sudo openssl x509 -req -days 365 -in example.csr -signkey example.key -out example.key

 

Once the certificate is generated, the server configuration should be updated to include the new certificate. Next, we check if it works

curl -I -k https://ipaddress
-k skips the check of ssl authenticity

 

Loading