Skip to content

Instantly share code, notes, and snippets.

@halit
halit / phpencoder.php
Created May 13, 2012 22:53
PHP Encoder
<?php
function rstr() //Random String Function
{
$len=rand(3,6);
$chr='';
for($i=1;$i<=$len;$i++)
{
$chr.=rand(0,1) ? chr(rand(65,90)) : chr(rand(97,122));
}
return $chr;
@halit
halit / hdblogstatus.py
Created June 7, 2012 20:28
Python Sms Server Status Sender
#!/usr/bin/env python
import tweepy
import os
import commands
consumer_anahtari = 'consumer_key yaziniz'
consumer_gizli = 'consumer_secret yaziniz'
giris_anahtari = 'access_key yaziniz'
giris_gizli = 'access_secret yaziniz'
baglanti = commands.getoutput('echo `netstat -an|wc -l`')
load = commands.getoutput("""uptime | awk -F "load average: " '{ print $2 }' | cut -d, -f1 | cut -d. -f1""")
@halit
halit / mail.py
Created June 8, 2012 14:16
Python Mass Mailer
#!/usr/bin/env python
import os
mailler = open("mailler.txt","r")
for mail in mailler:
print mail
os.system("""echo " Uzun suredir kapali kalan sitem www.halitalptekin.com tekrardan acildi.Tekrardan siteme beklerim. " | mail -s " Yeniden Acildi " """ + mail)
@halit
halit / rpcpython.py
Created July 2, 2012 15:20
Remote Pc Controller via Arduino,Python and Xdotool
#!/usr/bin/env python
import os
import serial
# Halit Alptekin - www.halitalptekin.com - Remote Pc Controller via Arduino,Python and Xdotool
# Blog Post: http://www.halitalptekin.com/arduino-ile-basit-pc-kontrolu.html
# Video: http://www.youtube.com/watch?v=7cbUqbsQyto
SERIAL_PORT = '/dev/ttyACM1'
SERI_BAUDRATE = 9600
@halit
halit / googledoodle.py
Created August 8, 2012 09:47
Google Doodle Hack(Python)
## www.halitalptekin.com - Halit Alptekin
import time
import win32api, win32con
VK_CODE = {'left_arrow':0x25,
'spacebar':0x20,
'right_arrow':0x27}
def press(x):
@halit
halit / googledoodle.py
Created August 8, 2012 09:56
Google Doodle Hack(Python and Selenium)
from selenium import webdriver
from selenium.webdriver.common.keys import Keys as k
br = webdriver.Chrome()
br.get(r'http://google.com')
elem = br.find_element_by_id('hplogo')
def mashButton(loops):
for i in xrange(loops):
@halit
halit / arama.py
Created August 16, 2012 10:55
My Recursive File Searcher in Python
def dosyalama(yer, uzanti):
dosyalist = []
for kok, altdizinler, dosyalar in os.walk(yer):
for dosya in dosyalar:
if dosya.endswith(uzanti):
dosyalist.append(os.path.join(kok,dosya))
return dosyalist
def aramayap(yer, kelime, uzanti):
@halit
halit / model.py
Created August 18, 2012 11:51
My Elixir Model
from elixir import *
# veritabani seciliyor
metadata.bind = "sqlite:///siteler.db"
# sql sorgusu ekrana basiliyor
metadata.bind.echo = False
class Siteler(Entity):
@halit
halit / ver.py
Created August 18, 2012 12:05
My Elixir Data Check
from model import *
from elixir import session
# kurulum yapiliyor
setup_all()
# olusuturuluyor
create_all()
# 1. kayit ekleniyor
@halit
halit / run.py
Created August 24, 2012 08:14
run.py
from PyQt4 import QtCore
from PyQt4 import QtGui
from PyDuino import Ui_PyDuino
import sys, arduino
class MainWindow(QtGui.QMainWindow, Ui_PyDuino):
def __init__(self):
QtGui.QMainWindow.__init__(self)
self.setupUi(self)