Skip to content

Instantly share code, notes, and snippets.

View mertcangokgoz's full-sized avatar
👋
Hi

Mertcan GÖKGÖZ mertcangokgoz

👋
Hi
View GitHub Profile
from bs4 import BeautifulSoup
from urllib.request import urlopen, Request
def DolarParse():
pasteURL = "http://tr.investing.com/currencies/usd-try"
data = urlopen(Request(pasteURL, headers={'User-Agent': 'Mozilla'})).read()
parse = BeautifulSoup(data)
for dolar in parse.find_all('span', id="last_last"):
liste = list(dolar)
<script>
function go() {
window.frames[0].document.body.innerHTML = '<form target="_parent" method="post" action="http://www.whatismyreferer.com"></form>';
window.frames[0].document.forms[0].submit()
}
</script>
<iframe onload="window.setTimeout('go()', 99)" src="about:blank" style="visibility:hidden"></iframe>
#! /bin/bash
#Check root
if [ $(id -u) != "0" ];
then
echo "Needs to be run by a user with root privilege."
exit 1
fi
# Check debian packages manager
#!/bin/sh
#
# Author Mertcan GOKGOZ - 2016
# Bir sistemdeki tüm yazicilar icin cupsenable komutunun calıstirilmasi
set -e
YAZICILAR=`lpstat -p | grep printer | grep -v enable | awk '{print $2}' | sed '/^$/d'`
if [ "x$YAZICILAR" != "x" ]; then
for yaziciadi in $YAZICILAR; do
#!/bin/bash
function try()
{
[[ $- = *e* ]]; SAVED_OPT_E=$?
set +e
}
function throw()
{
function ajaxGet(url, callback) {
$.support.cors = true;
$.ajax({
type: 'GET',
url: url,
dataType: 'json',
crossDomain: true,
success: function (data) {
callback(data);
}
function getUrlVars() {
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for (var i = 0; i < hashes.length; i++) {
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}
//--Validation
function validatePositiveDecimalsOnly(e) {
if (e.keyCode != 46 && e.keyCode > 31
&& (e.keyCode < 48 || e.keyCode > 57))
return false;
}
function validateNumbersOnly(e) {
if ((e.keyCode < 48) || (e.keyCode > 57)) {
return false;
# !/bin/sh
# Mertcan GÖKGÖZ
find /var/log/ -name '*-*-*.logptr' -type f -mtime +30 | awk -F/ '{print $6}' | awk -F. '{print $1}' | sort -u > gunler
echo "=============================================="
echo "Gonderilecek Olan Dosyalar"
cat gunler
echo "==============================================\n"
for gun in `cat gunler`
import csv
file = open('../Data/turkiye_ilceler_12042017.csv')
Read = csv.reader(file)
Data = list(Read)
sql = open('../Data/CityDistrict.sql', 'w')
for Read in Data:
for i in range(1, 970):