This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#date: 20/02/2017 | |
#this script will install basic server package,php,composer,mysql,webserver etc | |
#this script has code for install php 5 | |
#this script has code for install apache2 but default is apache2 | |
#check if script run by Mr.Root :P | |
set -eu | |
if [ "$(id -u)" != "0" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##tools | |
Grabber | |
sqlninja | |
Hydra | |
acurtix | |
Nmap | |
Punker spider scanner | |
Burp Suite | |
Nikto | |
Skipfish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##Access docker vm in mac | |
screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty | |
##Expose new port in existing container | |
1. stop the container | |
2. then got to /var/lib/docker/containers/<your_container_has>/ | |
3. Now open HostConfig.js file an change networking-settings | |
4. open Config2.json and change expose ports | |
5. Re-start the docker daemon | |
6. start your container |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz | |
tar xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz | |
mv wkhtmltox/bin/wkhtmlto* /usr/bin/ | |
ln -nfs /usr/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf | |
sudo apt-get install xvfb | |
sudo apt-get install libxrender1 | |
#file name "wkhtmltopdf.sh" and put below line in it. | |
xvfb-run -a -s "-screen 0 640x480x16" wkhtmltopdf "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
################################################################### | |
#Script Name : | |
#Description : | |
#Args : | |
#Author : H.R. Shadhin | |
#Email : dev@hrshadhin.me | |
################################################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function toBangla ($str) | |
{ | |
$convert = array ( | |
'0' => '০', | |
'1' => '১', | |
'2' => '২', | |
'3' => '৩', | |
'4' => '৪', | |
'5' => '৫', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function toBangla (str) | |
{ | |
//check if the `str` is not string | |
if(!isNaN(str)){ | |
//if not string make it string forcefully | |
str = String(str); | |
} | |
//start try catch block | |
try { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// similar behavior as an HTTP redirect | |
window.location.replace("http://sidanmor.com"); | |
// similar behavior as clicking on a link | |
window.location.href = "http://sidanmor.com"; | |
//get value of a input item(of a id) using raw js | |
document.getElementById('inputID').value; | |
//get value of a input item(of a name) using raw js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#symfony -> database | |
php app/console doctrine:schema:update --force | |
#database -> symfony | |
php app/console doctrine:mapping:import --force ApplicationBundle xml && php app/console doctrine:mapping:convert --force annotation ./src && php app/console doctrine:generate:entities ApplicationBundle | |
# db to doctrine xml | |
php app/console doctrine:mapping:import ApplicationBundle xml --filter="InvProducts" | |
#xml to doctrine entity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$repository = $this->getDoctrine()->getManager()->getRepository('ApplicationBundle:AccWorkloadEntry'); | |
$query = $repository->createQueryBuilder('c')->where("c.companyId = ".$this->CompanyID); | |
$query->andWhere("c.status ='1'"); | |
$query->andWhere("c.reportDate between '".$dateFrom ."' and '".$dateTo."'"); |