Skip to content

Instantly share code, notes, and snippets.

@korayal
korayal / nodejs-udpclient.js
Created December 7, 2012 12:34
Node.js: UDP client (that should wait for a response before closing)
var dgram = require('dgram');
sendUDPMessage("10.1.2.3", 1234, Buffer("Release The Kraken!"));
function sendUDPMessage(targetIP, targetPORT, message){
var client = dgram.createSocket("udp4");
client.on('error', function(e) {
throw e;
void setup() {
Serial.begin(9600);
//buradan sonrası sadece Mega'lar için geçerli
//Serial1.begin(19200);
//Serial2.begin(38400);
//Serial3.begin(4800);
}
void loop() {
void setup() {
Serial.begin(9600);
//buradan sonrası sadece Mega'lar için geçerli
Serial1.begin(19200);
Serial2.begin(38400);
Serial3.begin(4800);
}
void loop() {
while(Serial.available()) Serial.print(Serial.read());
// TCP Kütüphanesi Yükleniyor
net = require('net');
var clients = [];
// TCP Sunucusu Başlatılıyor
net.createServer(function (socket) {
// Bağlanan kullanıcının adı IP adresi ve Portundan oluşturuluyor
socket.name = socket.remoteAddress + ":" + socket.remotePort
// Kullanıcı client listesine ekleniyor
@korayal
korayal / nodejs-notifymyandroid.js
Created December 13, 2012 11:27
Sending notification to your Android device via "Notify my Android" on Node.js
// install these before (via 'npm install')
// https://github.com/Leonidas-from-XIV/node-xml2js
var xml2js = require('xml2js');
// https://github.com/mikeal/request
var request = require('request');
// fill in here with your api key from http://www.notifymyandroid.com/account.jsp
var apikey = "";
var net = require("net");
var request = require('request');
var xml2js = require('xml2js');
// fill in here with your api key from http://www.notifymyandroid.com/account.jsp
var apikey = "";
// creating states
var HOTstate = 2, NORMALstate = 1, COLDstate = 0;
// setting the state to normal
@korayal
korayal / gotersan.py
Created May 28, 2013 11:47
salon ışığı açmatik
import socket
import sys
UDP_IP = "192.168.1.254"
UDP_PORT = 5000
MESSAGE = "AT+D" + sys.argv[1] + "," + chr(0xFE) + chr(int(sys.argv[2])) + chr(0xFE) + chr(0xFF)
sock = socket.socket(socket.AF_INET,
socket.SOCK_DGRAM)
@korayal
korayal / checkmeb.py
Last active December 21, 2015 18:19
Mebmatik
import mechanize
import cookielib
import subprocess
import sched
import time
TCKimlikNo = "1234567890"
aranacakSelect = "Select$7"
kontrolSikligi = 60
@korayal
korayal / fffetcher.py
Created November 8, 2013 21:46
FF'ten feedleri çekme şeyi. commentler/layklar hariç.
import urllib2
import json
# Update values from here : https://friendfeed.com/account/api
username = "korayal"
remotekey = ""
index = 10000
mainurl = "http://friendfeed-api.com/v2/feed/%s" % username

Keybase proof

I hereby claim:

  • I am korayal on github.
  • I am koray (https://keybase.io/koray) on keybase.
  • I have a public key whose fingerprint is 0BB6 AE33 80ED 701A AEE0 A6AC 4E6C 4600 9F45 4264

To claim this, I am signing this object: