Skip to content

Instantly share code, notes, and snippets.

View parsibox's full-sized avatar

Mohsen Davari parsibox

View GitHub Profile
@igreenfield
igreenfield / Capture_HTTP_traffic.sh
Created June 8, 2017 07:44
Capture HTTP traffic: tcpdump
#!/bin/bash
##########################################
# Generate Filter tool:
# https://www.wireshark.org/tools/string-cf.html
#
# GET Filter:
# tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x47455420
# POST Filter:
# tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x504f5354 && tcp[((tcp[12:1] & 0xf0) >> 2) + 4:1] = 0x20
#!/bin/bash
# Replace grep domain
additional_strace_args="$1"
MASTER_PID=$(ps auwx | grep php-fpm | grep -v grep | grep domain | grep 'master process' | awk '{print $2}')
while read -r pid;
do
if [[ $pid != $MASTER_PID ]]; then
// 1. Visit a news website like cnn.com
// 2. paste this into your console
setInterval(() =>
document.querySelectorAll('p,img,a,button,h1,h2,h3,span')
.forEach(x=>x.style=`transform:rotate(${Math.random()*777}deg) scale(${Math.random()* 3}); transition:all .5s`)
, 500);
// 3. feel a lil bit better 😘
@manjeshpv
manjeshpv / radio-live-steam.bat
Created October 30, 2016 07:16
Live Stream Video with DynDNS and VLC Media Player
vlc.exe -vvv dshow:// :dshow-vdev="" :dshow-adev="M-Audio Delta AP Mon. Mixer" :live-caching=3000 :sout=#transcode{vcodec=none,acodec=mp3,ab=128,channels=2,samplerate=44100}:http{dst=:8080/radio.mp3} :sout-keep
function csv_to_array($filename='', $delimiter=',')
{
if (!file_exists($filename) || !is_readable($filename))
return FALSE;
$header = NULL;
$data = array();
if (($handle = fopen($filename, 'r')) !== FALSE) {
while (($row = fgetcsv($handle, 1000, $delimiter)) !== FALSE) {
@manjeshpv
manjeshpv / daily.sh
Created September 23, 2016 15:42
unix commands
# find number of files in folder recursively
find . -type f | wc -l
@kirilkirkov
kirilkirkov / gist:9a6ac60c2e35caca1e5eb75dfe33a153
Created April 13, 2016 13:41
Cannot connect to Mail: Can not authenticate to IMAP server: [ALERT] Please log in via your web browser: https://support.google.com/mail/acco
Error when try access gmail from php imap solution:
Login to your gmail account, enable imap.
Let the access here first: https://www.google.com/settings/security/lesssecureapps
Go to: https://accounts.google.com/b/0/DisplayUnlockCaptcha and enable access.
@kfriend
kfriend / respond_and_process.php
Created March 11, 2016 01:35
PHP: Send response and continue processing
<?php
// Buffer all upcoming output...
ob_start();
// Send your response.
echo "Testing response";
// Get the size of the output.
$size = ob_get_length();
@roshanpal
roshanpal / gist:37acd854a889f7b73a1c
Created July 16, 2015 04:33
PHP AES Encryption/Decryption Class with PKCS5 padding
<?php
/**
* Created by PhpStorm.
* User: roshan
* Date: 4/5/15
* Time: 2:46 PM
*/
class Aes
@manjeshpv
manjeshpv / pinger
Created June 19, 2015 08:10
Bash Shell Script to Ping a ip/host continuously to keep connectivity
#/bin/sh
# Description: Cyberoam Ping Script
# save in /etc/init.d/pinger
# start : $ server pinger start
# status : $ server pinger status
# stop : $ server pinger stop
# Description: Cyberoam Ping Script
address=192.168.220.250
do_start()
{