Categories
Books Interview

Book Review – Complete Software Developers Career Guide

Overall Grade : 3/5
Easy to read : 5/5

Take away : Very Good for starter in software development or novice in this area. This overview matches some of my professional experience.

The book contains about 800 pages and it quite covering a lot of elements

Missing Part [Politics]: Political IT environment – struggle – In an IT department, it is likely that the most efficient and logical decision will not be taken into account. Nowadays ITs/developers are run by marketers and political ambitious individuals. A full chapter should be dedicated on surviving such environment. Hard work is not rewarded anymore but eloquent techie speech makes the difference.

IT people are at fault somehow as they are easily dominated and replaced by consultants fabulous promises and speeches

Other missing Part Align business and IT: As professor Jerry Luftman mentionned many times IT and Business should be aligned

Categories
Technical

PGadmin v4.14 released

Postgres PG admin has been released. Let’s see how it turns out @

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
Database SQL

SQL HELPER

RDS AUTHENTICATION

mysql -h xxxxxxxxxta.us-east-1.rds.amazonaws.com  -u admin -p 

SELECT User,Host FROM mysql.user;
SHOW GRANTS FOR 'drupal'@'%';

SQL Client Recommendation

TablePlus(Mac)

DBeaver

Mysql Workbench

SequelPro

Import database

#1 mysql h xxxxx.com -u username -p dbname < dbexport.sql

OR 

#1 mysql h xxxxx.com -u username -p 
#2 use database-name;
#3 source file.sql

Export all Databases

    sudo mysqldump --all-databases -udxxxx -p > oct-16-2019-database.sql

Export Specific Database

mysqldump --databases xxxxxx-name -udxxxx -p > oct-16-2019-database-david-raleche.sql

NOT A ROOT USER

mysqldump –all-databases> database.sql

mysqldump -all-databases -uuser -ppassword> database.sql

mysqldump –all-databases –skip-lock-tables -u user-ppassword  > Sept2018database.sql

Long Queries

Explain 

SQL TABLE SIZE

select table_schema, sum((data_length+index_length)/1024/1024) AS MB from information_schema.tables group by 1;

CRON NACKUP DATABSECron Backup Database

mysqldump -uroot -p MyDatabase >/home/users/backup_MyDB/$(date +%F)_full_myDB.sql
Categories
Operating System Unix

Unix Command Helper List

Mac Find PID using port unix

$ sudo lsof -i :80

Block IPV6 malicious connection

 vi /etc/sysconfig/ip6tables

-A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT

-A INPUT -m state –state NEW -m tcp -p tcp –dport 443 -j ACCEPT

-A INPUT -m state –state NEW -m tcp -p tcp –dport 22 -j ACCEPT

service ip6tables restart
iptables restart

Find a specific word in Unix file

find . -type f -name "*.*" -exec grep -il "YOUR TEXT" {} \;

AWS package release

chkconfig --list httpd
 sudo chkconfig httpd on
 
 cat /etc/system-release

Count number of files in unix directory

find .//. ! -name . -print | grep -c //

Cat

cat file.php

hacker helper

https://dfarq.homeip.net/find-php-malware-linux/?cn-reloaded=1

LINUX Command = Better/Faster than SCP -> Rsync

rsync -av --progress --inplace --compress [email protected]:/path/to/sourceserver /path/to/newserversirectory

Copy as is – rsync with aws key

rsync -avz -e "ssh -i /root/xxxxxx.pem" [email protected]:/var/www/ /var/www/copywww/

tail

tail -n 20 xxx.php
tail -f

Memory space

df

du -skh .

Linux Iptables Setup Firewall For a Web Server

https://www.cyberciti.biz/faq/linux-web-server-firewall-tutorial/

yum list isntalled packaged

 yum list installed

Clam Antivirus

yum install clamav
yum-complete-transaction --cleanup-only
 /etc/init.d/iptables restart
 
 tail -f /var/log/httpd/access_log
 vim /etc/fail2ban/jail.conf 
 /etc/init.d/fail2ban start
  vim /etc/fail2ban/jail.conf 
   yum install fail2ban
   
   ps -ef
   
   vim notrace.conf 

IPTraf │ An IP Network Statistics Utility

yum install iptraf
iptraf 

   yum install iptraf
   iptraf 
   ps -ef
   ps -ef |less
   service httpd stop
   netstat -natu
   netstat -pnatu
   netstat -patu
   netstat -patu |less
   ps -ef
  yum install chkroo
   chkrootkit 
   yum search anti
   iptraf
   ps -ef | grep httpd
   ps -ef
   ps -aux
  yum install htop
   yum install perf
   perf
   perf stat
   ps -ef
   strace -p 4322
   yum -y  install strace
   strace -p 4322
   yum -y  install strace
   ps -ef
   strace -p 4522
   tail -f /var/log/httpd/error_log 

netstat -pvat

    netstat -pvat
    ls
    vim functions.php
    netstat -pvat
    tail -f /var/log/httpd/access_log
    tail -f /var/log/httpd/error_log 
    df
    du -skh
    df
    cd /var/log/
    ls
    df 
  du -skh
    du -skh *
    cd httpd/
    du -skh *
    ls -la
    rm error_log 
    df 
    df 
    touch error_log
    /etc/init.d/httpd restart
    tail -f /var/log/httpd/error_log 
    tail -f /var/log/httpd/access_log
    tail -f /var/log/httpd/access_log
    vin /etc/httpd/conf/httpd.conf
    vim /etc/httpd/conf/httpd.conf
    vim /etc/httpd/conf/httpd.conf
    vim /etc/httpd/conf.modules.d/
    vim /etc/httpd/conf.modules.d/00-proxy.conf 
    vim /etc/httpd/conf.modules.d/00-proxy.conf 
    /etc/init.d/httpd stop
    netstat -pvat
    netstat -pvatu
    /etc/init.d/httpd start

fail2ban

    yum search ban
    yum install fail2ban
    vim /etc/fail2ban/jail.
    vim /etc/fail2ban/jail.conf 
    /etc/init.d/fail2ban start
    vim /etc/fail2ban/jail.conf 
    lsof |grep fail
    tail -f /var/log/httpd/access_log
    /etc/init.d/iptables restart
    tail -f /var/log/httpd/access_log
    yum install clamav
  yum-complete-transaction --cleanup-only
    clamscan /vol/www/aptnewyork/
    freshclam 
    clamscan /vol/www/aptnewyork/
    clamscan /vol/www/aptnewyork/en
    clamscan -r /vol/www/aptnewyork/en
    clamscan -r /vol/www/aptnewyork/
    history
    clamscan -h

unix command Find word in files

     find . -type f -name "*.*" -exec grep -il "parse" {} \;
    vim /vol/www/aptnewyork/includes/parseRSS.php
     find . -type f -name "*.*" -exec grep -il "parseRSS.php" {} \;
    cd /vol/www/
    ls
    cd aptnewyork/
     find . -type f -name "*.*" -exec grep -il "parseRSS.php" {} \;
    cd en
     find . -type f -name "*.*" -exec grep -il "parseRSS.php" {} \;

Check yum installed modules

  yum list installed
  yum list installed | grep proxy
  yum list installed | grep 'proxy'
  yum list installed

khunter (Rootkit Hunter) is a Unix-based tool that scans for rootkits, backdoors and possible local exploits. It does this by comparing SHA-1 hashes of important files with known good ones in online databases, searching for default directories (of rootkits), wrong permissions, hidden files, suspicious strings in kernel modules, and special tests for Linux and FreeBSD. rkhunter is notable due to its inclusion in popular operating systems (Fedora,[1] Debian,[2] etc.)

vim /etc/rkhunter.conf cooment following line

#SCRIPTWHITELIST=/usr/bin/GET



   yum search rkhunter 
   yum install rkhunter 
   yum install rkhunter.noarch
   yum search rkhunter 
   yum search perl
   

   rkhunter --update
   rkhunter --propupd
   vim /etc/rkhunter.conf
   rkhunter --propupd
   rkhunter
   rkhunter /vol
   rkhunter /vol/
   ls /
   rkhunter 
   rkhunter vol
   rkhunter --check --sk

Check users

  cat /etc/passwd
  tail -f /var/log/httpd/error_log 
  netstat -pnatu
  vim  /etc/sysctl.conf
  sysctl -p
  vi /etc/ssh/sshd_config
  netstat -pnatu
  /etc/init.d/httpd stop
  netstat -pnatu

  /etc/init.d/httpd start

  netstat -pnatu
  netstat -vnatu
  netstat -vnatu
  top
  netstat -nlp
  netstat -nl
  netstat -np
  netstat -npatu
  strace -p 21865
  vim /var/www/noindex/index.html
  mv  /var/www/noindex /var/www/SUSPICIOUSnoindex
  ls /etc/httpd/htdocs
  ls /etc/httpd
  strace -p 21865 | grep open
  strace -p 21865 -o open
  ls
  grep open 
  grep open open 
  cat open 
  strace -p 21865 -o open
  netstat -npatu
  service httpd restart

Associate process and PID

  netstat -npatu

Trace PID to source look at (open)
 strace -p 22193

display port

 vim /vol/www/aptnewyork/fr/./map_francois.php
 lsof
 lsof | grep php
  
 lsof | grep aptnewyork
 lsof | grep php
 lsof | grep vol

List installed Library php modules

   php -m
Categories
PHP PHPUnit Unix

Developer Helper – Command Cine

PSR-2 Code Styling

vendor/bin/phpcs --standard=PSR2  app src
vendor/bin/phpcbf --standard=PSR2  app src
vendor/bin/phpcbf --standard=PSR2 --report=json app src

phpunit

vendor/bin/phpunit
vendor/bin/phpunit --log-junit web/phpunit/phpunit.xml --coverage-clover web/phpunit/coverage.xml --coverage-html web/phpunit/

Swagger Generate swagger documentation Swagger endpoint

vendor/bin/openapi -o "web/swagger.json" app/ src/ web/
Categories
Operating System Version-control system

Where to find GIT command Helper ?

Successful Git Connection

ssh -Tvvv [email protected]

Copy Shh key from Macbook

pbcopy < ~/.ssh/id_rsa.pub

Generate SSH Key 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

SETUP REMOTE GIT

 git init
 git add .
 git status
 git commit -m "First commit"
 git remote add origin [email protected]:xxxxxx/xxxxxxx.git
 git remote -v
 git push -u origin master

Add Key to github

cat ~/.ssh/authorized_keys 
cat ~/.ssh/known_hosts 

SYNC GIT

git remote update

git fetch Downloads the latest from remote without trying to merge or rebase anything.

git fetch -- all

REMOVE untracked files

git clean -f -d

RESET BRANCH/FILE

-- force discard local changes —
git reset --hard origin/master 
-- force discard —
git reset --hard origin/<davidBranch_name> 
git checkout -f <localfile> 

COMMIT

git commit -m ‘My commit David Raleche’

Amend a COMMIT

git commit --amend

remove git add

git reset HEAD -file-

PUSH

git push origin <davidBranch>

CONFLICTED FILES

git diff --name-only --diff-filter=U GIT ADD git add <file> git commit -m “message of your commit” git push origin

GIT RESET ADD

git reset <file> git reset

(VERY DANGEROUS) REMOVING LAST COMMIT (VERY DANGEROUS)

git reset --soft HEAD~1
git reset --hard HEAD^

(VERY DANGEROUS)

GIT CHECKOUT SOMEONE ELSE REPO

git checkout --track origin/ECOM-307

Git Diff

git diff –name-only –diff-filter=U

Git log HELPER

git log –graph git log –oneline
Categories
Technical

WordPress URL rebase

Changing the Site URL #Changing the Site URL

There are four easy methods to change the Site URL manually. Any of these methods will work and perform much the same function.

Edit wp-config.php #Edit wp-config.php

It is possible to set the site URL manually in the wp-config.php file.

Add these two lines to your wp-config.php, where “example.com” is the correct location of your site.

define( 'WP_HOME', 'http://example.com' );define( 'WP_SITEURL', 'http://example.com' );
Categories
Technical USPS

Direct Mailing CASS and NCOA

NCOA and CASS Certification

NCOA is a database maintained by the U.S. Postal Service of all individuals and companies who completed a Change of Address form in the previous four years.

Over 40 million Americans change their address each year. Outdated address information or address information that was not entered correctly, or is not in the correct USPS format are a major cause of undeliverable-as-addressed (UAA) mail.

This can lead to wasted resources and missed revenue when your mailings are not being received by your intended audience.

An NCOA update can reduce undeliverable and duplicate mail pieces by identifying incorrect addresses and correcting them prior to mailing.

National Change of Address (NCOALink) is a secure dataset of approximately 160 million permanent change-of-address (COA) records consisting of the names and addresses of individuals, families and businesses who have filed a change-of-address with the USPS”. [USPS] The USPS offers licenses for Interface Developers and Interface Distributors and all NCOALink interfaces are USPS certified. There are six licenses available including Full Service Providers (48 months) and Limited Service Providers (18 months). To obtain bulk mail rates, NCOALink is required, as it reduces the number of “undeliverable-as-addressed” mailpieces, saving money and reducing the USPS’s processing of this type of mail.

The Coding Accuracy Support System (CASS)

CASS certification is offered by the USPS to all mailers, service bureaus, and software vendors that would like to evaluate the quality of their address-matching software and improve the accuracy of their ZIP+4, carrier route, and five-digit coding. When choosing a vendor to process your mail, you want to make sure they are CASS certified. CASS Certification must be renewed annually with the USPS to meet current CASS Certification cycle requirements.

For more information on CASS Certification, visit the address management section of the USPS web site. CASS software will correct and standardize addresses. It will also add missing address information, such as ZIP codes, cities, and states to ensure the address is complete. Any mailing claimed at an automation rate must be produced from address lists properly matched and coded with CASS-certified address matching methods.

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.