Skip to content

Instantly share code, notes, and snippets.

View mayurah's full-sized avatar
🧋
grooming next generation of problem solvers!

Mayur Pipaliya mayurah

🧋
grooming next generation of problem solvers!
View GitHub Profile
@mayurah
mayurah / Linux Static IP
Last active December 25, 2015 19:29 — forked from kylefoo/Linux Static IP
CentOS / Fedora / RedHat
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NAME="System eth0"
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
NM_CONTROLLED=yes
@mayurah
mayurah / keybase.md
Created April 2, 2014 13:12
keybase.md

Keybase proof

I hereby claim:

  • I am mayurah on github.
  • I am mayur (https://keybase.io/mayur) on keybase.
  • I have a public key whose fingerprint is 7E07 DC0B 0739 46C6 25B6 34BE 5FD9 A607 8890 ACB3

To claim this, I am signing this object:

@mayurah
mayurah / nullroute.sh
Created July 2, 2014 11:48
handy null route
#!/bin/bash
# echo $*
route add -host $* reject
ip route add blackhole $*
@mayurah
mayurah / sed.as
Last active August 29, 2015 14:04
Sed one-liner
Remove leading and trailing whitespace
# sed 's/^[ \t]*//;s/[ \t]*$//' filename
Replace newline (\n) with ",," (imperfect)
# sed ':a;N;$!ba;s/\n/,/g' filename
simple replace ",," with newline (\n)
# sed 's/,,/\n/g' filename
prepend "##" to each line
$ sudo sysctl -w net.inet.ip.forwarding=1
$ sudo natd -interface en1
$ sudo ipfw add divert natd ip from any to any via en1
=== VSFTPd with chroot and nginx compatibility ===
* curator: Mayur Pipaliya [ mayur {at} pipaliya {dot} com ]
* copyleft (ɔ) distribute, alter and use at your own risk.
* apply necessary alternation accordingly.
~~ Install vsftpd, nginx & nano editor ~~
$ sudo apt-get install vsftpd nginx nano
@mayurah
mayurah / fetchImage.js
Last active August 29, 2015 14:06
jQuery to fetch images from current page
/*
* curator: Mayur Pipaliya [ mayur {at} pipaliya {dot} com ]
* copyleft (ɔ) distribute, alter and use at your own risk.
* apply necessary alternation accordingly.
*/
// Dynamically loading jQuery if it doesn't already.
if (typeof jQuery == 'undefined') {
document.write('<scr'+'ipt type="text/javascript" src="http://ajax.googleapis.com /ajax/libs/jquery/1.7.1/jquery.min.js">'+'</scr'+'ipt>');
}
@mayurah
mayurah / fetchImages.php
Last active August 29, 2015 14:06
fetching images from URL and saving it into folder.
<?php
/*
* title: fetching images from URL and saving it into folder.
* curator: Mayur Pipaliya [ mayur {at} pipaliya {dot} com ]
* demo : http://pentest.0x10.info/temp_demo/parse_img.php
* copyleft (ɔ) distribute, alter and use at your own risk.
* apply necessary alternation accordingly.
*/
@mayurah
mayurah / httpd server
Last active August 29, 2015 14:10
Apache httpd directives / .htaccess / httpd.conf
RewriteEngine On
# IP Canonicalization
RewriteCond %{HTTP_HOST} ^123\.123\.123\.222
RewriteRule (.*) http://www.onezero.com/$1 [R=301,L]
# Libwww-perl Access Test
RewriteCond %{HTTP_USER_AGENT} libwww-perl.*
RewriteRule .* - [F,L]
@mayurah
mayurah / countriesToCities.json
Created January 3, 2015 03:40
Countries To Cities - JSON
This file has been truncated, but you can view the full file.
{"China":["Guangzhou","Fuzhou","Beijing","Baotou","Hohhot","Guiyang","Yinchuan","Nanjing","Changzhou","Chuzhou","Hefei","Jinan","Qingdao","Harbin","Zhaodong","Taiyuan","Xi'an","Xianyang","Shenzhen","Nanning","Zhengzhou","Xinxiang","Luohe","Luoyang","Chaoyang","Xingyi","Foshan","Haikou","Chengdu","Dongguan","Mingzhou","Chongqing","Zhuhai","Kunming","Wuhan","Xiling","Huizhou","Jiangmen","Shantou","Changxiacun","Zhongshan","Lhasa","Nanchang","Tianjin","Shanghai","Hebei","Shijiazhuang","Quanzhou","Putian","Xiamen","Chengyang","Zhangzhou","Sanming","Nanping","Baoding","Langfang","Yantai","Binzhou","Lanzhou","Yueqing","Zhongxin","Zhoushan","Hangzhou","Ningbo","Wenzhou","Changchun","Fuyang","Jieshou","Anqing","Wuhu","Shishi","Shishi","Weitang","Shenyang","Changsha","Yongjiawan","Lengshuijiang","Shijiazhuang","Xuchang","Suzhou","Xuzhou","Taizhou","Nanyang","Xinhua","Ürümqi","Yan'an Beilu","Baotao","Macao","Wuxi","Yangzhou","Baiyin","Tongren","Kunshan","Zhangjiagang","Jiangyin","Zhenjiang","Zhoukou","Anyang","Dalian