Skip to content

Instantly share code, notes, and snippets.

View akkaash's full-sized avatar
🏋️‍♂️
Working out those brain muscles

Akkaash Goel akkaash

🏋️‍♂️
Working out those brain muscles
View GitHub Profile
@akkaash
akkaash / multiple_pings.sh
Created March 17, 2015 20:34
Ping multiple hosts and extract the average ping time
function do_ping(){
echo $1
ping -c 4 $1 | tail -1| awk '{print $4}' | awk -F '/' '{print $2}'
}
declare -a arr=("google.com" "facebook.com" "linkedin.com")
for i in "${arr[@]}"
do
do_ping "$i"
@akkaash
akkaash / ansible_folder_structure
Created January 27, 2015 18:03
Create Simple ansible folder structure
mkdir -p $PROJECT_NAME/roles/{web,db}/{tasks,handlers,templates}
touch $PROJECT_NAME/main.yml $PROJECT_NAME/roles/{web,db}/{tasks,handlers,templates}/main.yml
@akkaash
akkaash / _.md
Created May 16, 2014 23:34
Tributary inlet
@akkaash
akkaash / _.md
Created May 16, 2014 23:33
Tributary inlet
@akkaash
akkaash / master.c
Created January 31, 2014 16:34
Hot Potato Game using network programming
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>
@akkaash
akkaash / client.py
Created January 31, 2014 16:32
FTP: Selective Repeat using UDP
__author__ = 'akkaash'
import sys
import socket
import threading
import signal
SERVER_HOSTNAME = sys.argv[1] # server on this ip
SERVER_SENDING_PORT = int(sys.argv[2]) # server on this port
FILE_NAME = sys.argv[3] # send this file
@akkaash
akkaash / assn1_541.c
Created January 31, 2014 16:30
In-memory vs On-disk Searching Performance
#include <stdio.h>
#include <malloc.h>
#include <stdlib.h>
#include <sys/time.h>
long mDiffTime(struct timeval end, struct timeval start){
long ret = 0L;
ret += (end.tv_sec - start.tv_sec) * 1000000L;
ret += (end.tv_usec - start.tv_usec);
@akkaash
akkaash / install_google_chrome.sh
Created November 2, 2013 06:06
Install Google Chrome Shell Script
#!/bin/bash
if [ $(getconf LONG_BIT) = "64" ]
then
echo "64bit Detected" &&
echo "Installing Google Chrome" &&