Skip to content

Instantly share code, notes, and snippets.

View anandpathak's full-sized avatar
🐜
building slowly!

Anand anandpathak

🐜
building slowly!
View GitHub Profile
@anandpathak
anandpathak / Dockerfile
Last active August 8, 2016 16:53
Dockerfile :- image contians apache2, php-fpm, mysql-client,git and ssh
FROM ubuntu:14.04
MAINTAINER Anand Pathak <[email protected]>
RUN echo "deb http://mirrors.digitalocean.com/ubuntu trusty main multiverse" >> /etc/apt/sources.list && \
echo "deb http://mirrors.digitalocean.com/ubuntu trusty-updates main multiverse" >> /etc/apt/sources.list && \
echo "deb http://security.ubuntu.com/ubuntu trusty-security main multiverse" >> /etc/apt/sources.list
RUN apt-get update && apt-get install -y openssh-server
RUN mkdir /var/run/sshd
RUN echo 'root:root' | chpasswd
wget --spider -e robots=off -r -nd -nv -H -l 1 -o outfile.log http://URL
# -w 2 : pause between each crawl
#
@anandpathak
anandpathak / UrlStatus.sh
Created January 27, 2016 10:05
Url status from using Curl command
#!/bin/bash
#pass the input url file
#urls must be in new lines
File=$1
while read url; do
status=$(curl -sI $url | head -1 | awk '{print $2}')
redirect=`curl -sI $url | grep "Location\|location" | awk '{print $2}'`
echo $url $status $redirect >>url_out.txt
done <$File
@anandpathak
anandpathak / linkedListreveseRecursively.c
Created January 24, 2016 16:47
Reversing linkedlist node recursively
//head points to the first node of the linked list
void reverse(struct node * ptr1){
struct node *ptr2;
if(ptr1->next !=NULL){
ptr2=ptr1->next;
reverse(ptr1->next);
temp=ptr2->next;
ptr2->next=ptr1;
ptr1->next=temp;
return ;
@anandpathak
anandpathak / slack-browserBot.js
Last active January 13, 2017 09:09
Slack auto message sender from browser
values1 = ["Hi!" , "How are you ? " , "fine " , "do you know, who I am ? " , "A bot ! :)"]
function dothis(i){
setTimeout(function(){
document.getElementById("msg_input").value= values1[i];
TS.view.submit()
},
i*6000);}
for(i=0;i<values1.length;i++)
dothis(i);