Skip to content

Instantly share code, notes, and snippets.

# Required libraries:
#
# * vobject <http://vobject.skyhouseconsulting.com/>
#
# Copyright (C) 2011 Marek Stepniowski <marek@stepniowski.com>
#
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
####################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Last tested & updated 10/13/2011
####################################
sudo apt-get update
sudo apt-get upgrade
import mechanize
from BeautifulSoup import BeautifulSoup
import time
user_agent = ("sadsds")
br = mechanize.Browser()
br.addheaders = [('User-agent', user_agent)]
start = time.clock()
response = br.open("http://backdoor-problems.cognizance.org.in/misc75/misc75.php")
html = response.read()
import socket,time,zlib,sys
from struct import pack
sk = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
sk.connect(("106.187.35.165",8080))
buff = sk.recv(1024)
print 'Received', repr(buff)
buff = sk.recv(1024)
import re
import socket,time,zlib,sys
from struct import pack
sk = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
sk.connect(("106.187.35.165",8080))
buff = sk.recv(1024)
print 'Received', repr(buff)
<?php
// h4x0r's ultimate encryption algorithm
// I put the string to be encrypted here
$str = 'aaaaaaaaaaaaaaaaaa';
// I convert the string to ASCII
// I generate a random key in between 10 and the maximum value of the ASCII's
// So the key is different everytime B)
@syst3mw0rm
syst3mw0rm / gist:5469526
Created April 26, 2013 18:53
puzzle1 viennaCL
#include <iostream>
#include <vector>
#include "viennacl/vector.hpp"
#include "benchmark-utils.hpp"
#define BENCHMARK_VECTOR_SIZE 1000
#define BENCHMARK_RUNS 10
int main() {
public List<Tweet> fetchFeedsOfUser(Long user_id,int tweet_id) {
return jdbcTemplate.query("Select * from tweet where tweet_id < ? and (user_id in (select user_id2 from following where user_id1 = ?) or user_id = ? ) order by timestamp desc limit 15",
new Object[]{tweet_id,user_id,user_id}, new BeanPropertyRowMapper<>(Tweet.class));
}
@syst3mw0rm
syst3mw0rm / gist:6299407
Created August 21, 2013 19:59
user news feed
explain Select * from tweet where tweet_id < 9999999999999 and (user_id in (select user_id2 from following where user_id1 = 1) or user_id = 1 ) order by tweet_id desc limit 15;
public List<Tweet> fetchOlderFeeds(Long user_id, Long tweet_id) {
List<Tweet> tweetList = jdbcTemplate.query("select t.* from tweet t INNER JOIN following f ON (f.user_id2 = t.user_id) " +
"WHERE t.tweet_id < ? AND f.user_id1 = ? " +
"UNION ALL SELECT * FROM tweet t WHERE t.user_id=? AND t.tweet_id < ? " +
"ORDER BY tweet_id desc limit 15",
new Object[]{tweet_id, user_id, user_id, tweet_id}, new BeanPropertyRowMapper<>(Tweet.class));
return tweetList;