Categories
General

Connect to your Forge server using SSH or SFTP

Create SSH Key for Github

$ ssh-keygen -t rsa -b 4096 -C "[email protected]"
$ eval "$(ssh-agent -s)"
$ ssh-add ~/.ssh/id_rsa (regular unix system)
$ ssh-add -K ~/.ssh/id_rsa (for macbook)

$ pbcopy < ~/.ssh/id_rsa.pub (for macbook)

Paste key into github

$ git remote add origin [email protected]:xxxxxx/xxxxxxx.git  
$ git remote -v 
$ git push -u origin master

Feb, 7 2019—#forge

Using Laravel Forge you can easily configure push-to-deploy to your sites, you can also manually deploy from the dashboard. However, sometimes you wish to access your sites’ files directly using SSH or SFTP.

To be able to do that you’ll need to add your machine’s public key to the server, this step allows the SSH service on your server to identify connections from your computer and grant access.

Depending on your Operating System, you can find guides on how to generate an SSH key in this link.

Adding an SSH Key

To add an SSH key to your server, head to the SSH Keys section of the server settings screen:

Adding an SSH Key

Once the key is added, you can SSH into your instance using the following command:

ssh [email protected]_address_here

To use SFTP, you need to download an SFTP client like FileZilla or Cyberduck. Once you run the client, provide the credentials as follow:

  • Protocol: SFTP
  • Address/Server: your_ip_address
  • Port: 22
  • Username: forge
  • Password: Leave this blank.
  • SSH Private Key: Location to the private key on your machine.

Once you press connect, the client will communicate with the server and acquire access to all the files and directories.

By Mohamed Said

Full-stack developer at Laravel. You can find me on Twitter and Github.

Categories
General

How to fix wordpress Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 2348617 bytes) in /wp-includes/plugin.php on line xxx?

Solution is to add the following line below to this file wp-config.php

define( 'WP_MEMORY_LIMIT', '256M' );
Categories
General

How to access cloud Magento Dasboard ?

Here is the link to access Magento cloud dashboard

https://us-3.magento.cloud/projects

Categories
General

How to Force/change default homepage of Laravel Nova ?

To Force the redirect of Laravel Nova I proceeded with modifications

#1 – Remove the default route definition

routes/web.php
routes/web.php

#2 – Address the ‘/nova’ path to just ‘/’

config/nova.php
config/nova.php
Categories
General Technical

How to mage Immutable File Unix ?

lsattr /etc/pgbouncer/users.txt
 ----i--------e- /etc/pgbouncer/users.txt

lsattr /etc/pgbouncer/users.txt
----i--------e- /etc/pgbouncer/users.txt
 
sudo chattr -i /etc/pgbouncer/users.txt
lsattr /etc/pgbouncer/users.txt
 -------------e- /etc/pgbouncer/users.txt
 
vim /etc/pgbouncer/users.txt
sudo chattr +i /etc/pgbouncer/users.txt
lsattr /etc/pgbouncer/users.txt
----i--------e- /etc/pgbouncer/users.txt
Categories
General

DBeaver Configuration : Postgres and MacOs

1 . Install postgres

2. Find path to pg_dump

/Applications/Postgres.app/Contents/Versions/latest/bin

3. configure client (Dbeaver)

to add hidden files -> command + shift + G

paste /Applications/Postgres.app/Contents/Versions/latest/bin

and select the folder

4. Voila !

Categories
General Hacker

How to Find hacked files ?

Unix Commands

grep -r --include=*.php -e '[[:alnum:]\/\+]\{64,\}'

grep -r --include=*.php -e '[[:alnum:]\/\+]\{137,\}' 

Categories
General Operating System Programming Technical

Unix – Composer Issue

Problem

[ErrorException]                                                                          

“continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”?

SOLUTION

#1 composer self-update

#2 composer update

Categories
General

EDDM and ZCTA5

EDDM

Every Door Direct Mail® (EDDM®) services to promote your small business in your local community. If you’re having a sale, opening a new location, or offering coupons, EDDM can help you send postcards, menus, and flyers to the right customers. Use the EDDM Online Tool to map ZIP Code(s) and neighborhoods—even filter by age, income, or household size1 using U.S. Census data.

ZCTA5

The TIGER/Line shapefiles and related database files (.dbf) are an extract of selected geographic and cartographic information from the U.S. Census Bureau’s Master Address File / Topologically Integrated Geographic Encoding and Referencing (MAF/TIGER) Database (MTDB). The MTDB represents a seamless national file with no overlaps or gaps between parts, however, each TIGER/Line shapefile is designed to stand alone as an independent data set, or they can be combined to cover the entire nation.

      ZIP Code Tabulation Areas (ZCTAs) are approximate area representations of U.S. Postal Service (USPS) ZIP Code service areas that the Census Bureau creates to present statistical data for each decennial
      census. The Census Bureau delineates ZCTA boundaries for the United States, Puerto Rico, American Samoa, Guam, the Commonwealth of the Northern Mariana Islands, and the U.S. Virgin Islands once each
      decade following the decennial census. Data users should not use ZCTAs to identify the official USPS ZIP Code for mail delivery. The USPS makes periodic changes to ZIP Codes to support more efficient mail
      delivery.

      The Census Bureau uses tabulation blocks as the basis for defining each ZCTA. Tabulation blocks are assigned to a ZCTA based on the most frequently occurring ZIP Code for the addresses contained within
      that block. The most frequently occurring ZIP Code also becomes the five-digit numeric code of the ZCTA. These codes may contain leading zeros.

      Blocks that do not contain addresses but are surrounded by a single ZCTA (enclaves) are assigned to the surrounding ZCTA. Because the Census Bureau only uses the most frequently occurring ZIP Code to
      assign blocks, a ZCTA may not exist for every USPS ZIP Code. Some ZIP Codes may not have a matching ZCTA because too few addresses were associated with the specific ZIP Code or the ZIP Code was not the
      most frequently occurring ZIP Code within any of the blocks where it exists.

      The ZCTA boundaries in this release are those delineated following the 2010 Census.
Categories
AWS General Operating System

Redirect to https and www

The following .htaccess technique redirects qualified requests to the https and www versions of your web pages. Add to your site’s root .htaccess file:

# Canonical https/www

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

This code does the following:

Checks if mod_rewrite is available
Check if the request does not include www
Checks if HTTPS is off,

No editing is required with this code; it’s entirely plug-n-play.