Skip to content

Instantly share code, notes, and snippets.

View yuxel's full-sized avatar

Osman Yüksel yuxel

View GitHub Profile
#!/bin/bash
user="root"
pass="12345678"
excludeList="mysql|performance_schema|information_schema" #dont remove these databases
tmpDir="/tmp"
# PART1
# Uncomment first block to get your database dumps into tmpDir
var graylog2 = require("graylog2");
var logger = new graylog2.graylog({
servers: [
{ 'host': 127.0.0.1, port: 12201 },
{ 'host': 127.0.0.2, port: 12201 }
],
hostname: 'server.name', // the name of this host
facility: 'Node.js', // the facility for these log messages
bufferSize: 1350 // max UDP packet size, should never exceed the
@yuxel
yuxel / cookie.js
Last active August 29, 2015 14:05
"""
Kullanici kayit islemlerinden gelen mesajlari dinleyen,
mesaj geldiginde ilgili kullanicinin bulundugu yeri veritabanindan cekme,
kullanicinin bulundugu bu yere yakin diger kullanicilari cekme,
ve bulunan diger kullanicilara e-posta gonderme islemlerini
simule eden kod
http://barryp.org/software/py-amqplib/ adresinden py-amqplib'i indirip kurmalisiniz
"""
<?php
/**
* Kullanici kayit olduktan sonra kuyruga kullanici id'sini
* mesaj gonderen uygulama
*
* http://code.google.com/p/php-amqplib/ adresinden PHP kutuphanesini indirmelisiniz
*/
//indirdiginiz kutuphane icindeki dosyanin yolunu gosterin
require_once('../amqp.inc');
<?php
function tablolariOlustur() {
//burada baglanti aciliyor
$baglanti = new SQLiteDatabase('veritabani.sqlite');
//burada create table sql komutu calistiriliyor
//burada users adinda bi tablo olusturup, userId ve password diye iki tane alan ekliyoruz
//bu alanlar da 100 karakterlik veri tutabiliyor
<?php
error_reporting(E_ALL);
ini_set("display_errors",true);
$ch = curl_init();
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_URL, 'http://sozluk.sourtimes.org/login.asp');
<!-- sayfadaki orijinal -->
<h1 class="title" style="visibility: hidden; display: none">
<a href="show.asp?t=ezel">ezel</a>
<span class="eksigator_subscribe">[ Takipten çıkar ]</span>
</h1>
<!-- sizin eklediginiz -->
<h1 class="title" id="epp_sabitBaslik" style="position: fixed; top: 0px; left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0.2em; padding-right: 0.2em; padding-bottom: 0.2em; padding-left: 0.5em; background-color: #b1ac99">
<a href="show.asp?t=ezel">ezel</a>
import tornado.httpserver
import tornado.ioloop
import tornado.web
import time
class FeedgetService(tornado.web.RequestHandler):
def doSomethingWhichTakes10Seconds(self, url):
time.sleep(10)
import tornado.httpserver
import tornado.ioloop
import tornado.web
import time
class FeedgetService(tornado.web.RequestHandler):
#i'm willing that method will run async
@tornado.web.asynchronous