Skip to content

Instantly share code, notes, and snippets.

View hrshadhin's full-sized avatar
🏠
Working from home

H.R. Shadhin hrshadhin

🏠
Working from home
View GitHub Profile
@hrshadhin
hrshadhin / baatighar_server_init_setup.sh
Last active March 26, 2018 11:24
simple vps setup script
#!/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
##tools
Grabber
sqlninja
Hydra
acurtix
Nmap
Punker spider scanner
Burp Suite
Nikto
Skipfish
##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
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 "$@"
#!/bin/bash
###################################################################
#Script Name :
#Description :
#Args :
#Author : H.R. Shadhin
#Email : dev@hrshadhin.me
###################################################################
@hrshadhin
hrshadhin / banglaNumber.php
Created February 3, 2018 18:05 — forked from nixon1333/banglaNumber.php
Bangla number conversion from English
<?php
function toBangla ($str)
{
$convert = array (
'0' => '০',
'1' => '১',
'2' => '২',
'3' => '৩',
'4' => '৪',
'5' => '৫',
@hrshadhin
hrshadhin / banglaNumber.js
Created February 3, 2018 18:04 — forked from nixon1333/banglaNumber.js
English number to Bangla number convertion
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 {
@hrshadhin
hrshadhin / twik.js
Created February 3, 2018 18:04 — forked from nixon1333/twik.js
// 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
@hrshadhin
hrshadhin / SymfonyCommand.sh
Created February 3, 2018 18:01 — forked from nixon1333/SymfonyCommand.sh
update database from entity
#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
@hrshadhin
hrshadhin / symfony2_query_builder.php
Created February 3, 2018 18:00 — forked from nixon1333/symfony2_query_builder.php
symfomy2 custom query builder
<?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."'");