Skip to content

Instantly share code, notes, and snippets.

View rahman541's full-sized avatar
🎯
Focusing

Rahman rahman541

🎯
Focusing
View GitHub Profile
for /f "delims=" %%d in ('dir /s /b /ad ^| sort /r') do rd "%%d"

Putty command line option

putty.exe [email protected] -P 2222 -pw mypasswd -D 1234

-P port_number
-pw ssh_password
-D dynamic_port_forward

@rahman541
rahman541 / chmod.txt
Last active February 8, 2019 19:28
CHMOD
OWNER GROUP WORLD
r w x r w x r w x
1 1 1 1 0 1 1 0 1
7 5 5
|______|_______|
|
755
r = read
w = write
@rahman541
rahman541 / mtu_problem.md
Last active October 18, 2017 10:08
MTU Problem. Cant open/connect some website.

MTU Problem. Cant open/connect some website.

Per RFC 1191 leavingcisco.com, a router that returns an ICMP message which indicates "fragmentation needed and DF set" should include the MTU of that next-hop network in the low-order 16 bits of the ICMP additional header field that is labeled "unused" in the ICMP specification RFC 792 leavingcisco.com.

Determining best MTU

Windows:

ping www.google.com -f -l 1472
@rahman541
rahman541 / install_ror_on_ubuntu.md
Last active October 19, 2017 14:55
Install ruby on rails in Linux Ubuntu

Install Ruby On Rails in Ubuntu

Tested on Ubuntu Desktop 17.04 & Ubuntu Server 16.04 x64

sudo apt-get install -y gcc make zlib1g-dev sqlite3 libsqlite3-dev
sudo apt-get install -y ruby-full
sudo gem install rails
# Create new rails project. This will create weblog folder
rails new weblog
@rahman541
rahman541 / wp_docker.sh
Last active August 17, 2017 19:02
WordPress in Docker
docker run --rm -d --name mariadb -p 8081:3306 -e MYSQL_ROOT_PASSWORD=wp;MYSQL_DATABASE=wp mariadb:10.3
docker run -d --rm --link mariadb:mysql --name wp -p 8080:80 wordpress:4.8-apache
@rahman541
rahman541 / helpers.php
Last active August 30, 2019 19:06
Common PHP helper function
/*
* Get base URL
* Credit to SpYk3HH
* Ref https://stackoverflow.com/questions/2820723/how-to-get-base-url-with-php
*/
if (!function_exists('base_url')) {
function base_url($atRoot=FALSE, $atCore=FALSE, $parse=FALSE){
if (isset($_SERVER['HTTP_HOST'])) {
$http = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off' ? 'https' : 'http';
$hostname = $_SERVER['HTTP_HOST'];
@rahman541
rahman541 / simple_log.md
Last active October 19, 2017 05:30
Log to file will be write D:/log_DATE.txt

Simple Log to file. File will be write D:/log_DATE.txt

Insert this line of code:

$logs = '$name : '.$name.'; $value : '.$value.PHP_EOL;
file_put_contents('D:/log_'.date("j.n.Y").'.txt', $logs, FILE_APPEND);

Introduction

Setup intended for Raspian OS

Install Aircrack-ng

# Install required library
sudo apt-get -y install libssl-dev
wget http://download.aircrack-ng.org/aircrack-ng-1.2-rc4.tar.gz
tar -zxvf aircrack-ng-1.2-rc4.tar.gz
cd aircrack-ng-1.2-rc4
make
@rahman541
rahman541 / wkhtmltopdf_wkhtmltoimage.md
Last active October 19, 2017 14:56 — forked from isogram/wkhtmltopdf_wkhtmltoimage.md
How to manually install Wktohtmlpdf and Wkhtmltoimage in Ubuntu Server

Install Wkhtmltopdf and Wkhtmltoimage in Ubuntu

sudo apt-get install xz-utils
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz -P ~/
tar -xvf ~/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz -C ~/
cd ~/wkhtmltox/bin/
sudo mv wkhtmltopdf  /usr/bin/wkhtmltopdf
sudo mv wkhtmltoimage  /usr/bin/wkhtmltoimage