Skip to content

Instantly share code, notes, and snippets.

View bernard-ng's full-sized avatar
🎯
Focusing

Bernard Ngandu bernard-ng

🎯
Focusing
View GitHub Profile
@bernard-ng
bernard-ng / countries.php
Created June 8, 2021 11:48
french african countries list - symfony
<?php
$countries = [
Countries::getName('BJ') => 'BJ',
Countries::getName('BF') => 'BF',
Countries::getName('BI') => 'BI',
Countries::getName('CM') => 'CM',
Countries::getName('CF') => 'CF',
Countries::getName('CG') => 'CG',
Countries::getName('CD') => 'CD',
@bernard-ng
bernard-ng / GoogleDorking.md
Created February 28, 2021 18:59 — forked from sundowndev/GoogleDorking.md
Google dork cheatsheet

Google dork cheatsheet

Search filters

Filter Description Example
allintext Searches for occurrences of all the keywords given. allintext:"keyword"
intext Searches for the occurrences of keywords all at once or one at a time. intext:"keyword"
inurl Searches for a URL matching one of the keywords. inurl:"keyword"
allinurl Searches for a URL matching all the keywords in the query. allinurl:"keyword"
intitle Searches for occurrences of keywords in title all or one. intitle:"keyword"
@bernard-ng
bernard-ng / user.sh
Created December 14, 2020 11:27
create user and grant sudo
cut -d: -f1 /etc/passwd # list users on the server
sudo useradd --create-home username # create user and home directory
sudo passwd username # set password for user
usermod -aG sudo username # add user to sudo group
echo "username ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/username # create a sudoer file
userdel -f username # delete user
@bernard-ng
bernard-ng / disabled_functions.php
Created October 17, 2020 21:36
show php disabled function
<?php
error_reporting(E_ALL);
$disabled_functions = ini_get('disable_functions');
if ($disabled_functions!='')
{
$arr = explode(',', $disabled_functions);
sort($arr);
echo 'Disabled Functions: ';
for ($i=0; $i < count($arr); $i++)
@bernard-ng
bernard-ng / .htaccess
Last active August 1, 2020 11:15
angular - ionic .htaccess
<IfModule mod_rewrite.c >
RewriteEngine on
RewriteOptions inherit
# let's encrypt ssl
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/.+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^.well-known/acme-challenge - [L]
# redirect to no-www
@bernard-ng
bernard-ng / deploy-ionic-angular.sh
Last active August 31, 2020 18:23
a script that deploys a angular or ionic app to a production server using git
BUILD_DEPLOY_DIRECTORY="$HOME/dev/projects/app-build"
BUILD_DEPLOY_REMOTE=$(git config --get remote.origin.url)
BUILD_DIRECTORY="$HOME/dev/projects/app/www" # www or build
BUILD_COMMIT_MESSAGE=$(date +'%c')
R=$(tput setaf 1)
G=$(tput setaf 2)
Y=$(tput setaf 3)
NC=$(tput sgr0)
set -g status-justify left # Aligne les titres de fenetres a gauche
set -g status-bg colour1 # Status bar noir sur rouge
set -g status-fg colour0 #
set -g status-interval 2 # Evite des bug de refraichissement
setw -g window-status-current-fg colour1 # Inversion des couleur pour l'onglet selectione
setw -g window-status-current-bg colour0 #
set-option -g history-limit 10000 # Permet de scroller 10k lignes
set -g history-limit 10000 #
DirectoryIndex disabled
RewriteEngine On
RewriteRule ^$ http://127.0.0.1:3000/ [P,L]
RewriteRule ^(.*)$ http://127.0.0.1:3000/$1 [P,L]
@bernard-ng
bernard-ng / .htaccess
Last active February 10, 2024 02:26
basic root htaccess config
<IfModule mod_headers.c>
<FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>
<IfModule mod_rewrite.c >
RewriteEngine on
RewriteOptions inherit
@bernard-ng
bernard-ng / websiteupdate.sh
Created October 9, 2019 20:09
update a website after a github commit
#!/bin/sh
set -e
if [ ! -f /var/www/html/public/doDeploy ]; then
exit;
fi
rm /var/www/html/public/doDeploy
STAMP=$(date +%s)
WORKDIR=/tmp/$STAMP
NEWDIR=$WORKDIR/new