Skip to content

Instantly share code, notes, and snippets.

View sayz's full-sized avatar
🏠
Working from home

Sefa Yıldız sayz

🏠
Working from home
View GitHub Profile
import base64
from http.server import BaseHTTPRequestHandler, HTTPServer
# Base64 stringini JPEG dosyasına dönüştürme fonksiyonu
def base64_to_image(base64_string, image_path):
image_data = base64.b64decode(base64_string)
with open(image_path, 'wb') as file:
file.write(image_data)
# HTTP sunucusu için handler sınıfı
@sayz
sayz / askme.py
Created March 30, 2011 09:38
ingilizce soru-cevap programı
#!/usr/bin/env python
#-*-coding:utf-8-*-
import csv, random
#dosya açılıp, varlığı denetleniyor:
def dosyaAc():
try:
wordlist = csv.reader(open("wordlist.csv", "rb"))
return wordlist
except:
Bu rehber, yeni bir projenin bir git deposuna nasıl aktarılacağını, değişikliklerin nasıl yapılacağını ve
değişikliklerin diğer geliştiricilerle nasıl paylaştırılacağını açıklar.
Öncelikle, bir komut için yazılmış belgeyi her zaman aşağıdaki komut ile görüntüleyebilirsiniz: Örneğin git
log --graph belgesini görüntülemek için:
$ man git-log
Başlamadan önce git'e adınız ve e-posta adresinizi vermeniz önerilir. Bunu yapmanın en kolay yolu:
$ git config --global user.name "Adınız ve Soyadınız Buraya"
$ git config --global user.email mail@adresiniz.com
Komutlarını çalıştırmaktır.
Yeni Bir Projeyi Aktarmak
import csv
#! /usr/bin/env python3
#title :test_ldap_data.py
#description :read from ldif, write as csv
#author :Sefa Yıldız
#mail :XXXX
#date :01-04-2020
#==============================================================================
#ldif'i oku ve listeye at
#EXTM3U
#EXTINF:-1,Unknown Artist - Kral FM
http://sc-kral.mncdn.net:80/
#EXTINF:-1,Unknown Artist - Radyo İlaç
http://sr1.netmedya.org:1008/
#EXTINF:-1,Unknown Artist - Alem FM
http://www.bizidinle.com/player/radyoasx.asp?id=4
#EXTINF:-1,Unknown Artist - Süper FM
http://superfmaac.radyolarburada.com:9235/
#EXTINF:-1,Unknown Artist - Joy Türk
@sayz
sayz / curl_post_json.md
Created June 2, 2020 13:31 — forked from ungoldman/curl_post_json.md
post a JSON file with curl

How do you POST a JSON file with curl??

You can post a json file with curl like so:

curl -X POST -H "Content-Type: application/json" -d @FILENAME DESTINATION

so for example:

@sayz
sayz / Documentation.md
Created December 18, 2019 14:35 — forked from KartikTalwar/Documentation.md
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@sayz
sayz / 0_user-accounts.md
Created August 7, 2011 11:51
linux sistem yönetimi kampında tuttuğum notlar...

##useradd komutu.

-c "açıklama"

ex: -c "müdür bey"

-s kabukı-adı

ex:

file1 = open("wrong_ip.txt", encoding="utf-8")
wrongs = file1.readlines()
file2 = open("full_ip.txt", encoding="utf-8")
full_ip = file2.readlines()
file3 = open("match_ip.txt", "w")
match_full = [0,1,2]
#!/usr/bin/env bash
/usr/sbin/sshuttle -r sayz@sefa.404.mn 31.13.64.51/32 31.13.65.49/32 31.13.66.49/32 31.13.67.51/32 31.13.68.52/32 31.13.69.240/32 31.13.70.49/32 31.13.71.49/32 31.13.72.52/32 31.13.73.49/32 31.13.74.49/32 31.13.75.52/32 31.13.76.81/32 31.13.77.49/32 31.13.78.53/32 31.13.80.53/32 31.13.81.53/32 31.13.82.51/32 31.13.83.51/32 31.13.84.51/32 31.13.85.51/32 31.13.86.51/32 31.13.87.51/32 31.13.88.49/32 31.13.90.51/32 31.13.91.51/32 31.13.92.52/32 31.13.93.51/32 31.13.94.52/32 31.13.95.63/32 50.22.198.204/30 50.22.210.32/30 50.22.210.128/27 50.22.225.64/27 50.22.235.248/30 50.22.240.160/27 50.23.90.128/27 50.97.57.128/27 75.126.39.32/27 108.168.171.224/27 108.168.174.0/27 108.168.176.192/26 108.168.177.0/27 108.168.180.96/27 108.168.254.65/32 108.168.255.224/32 108.168.255.227/32 157.240.0.53/32 157.240.1.53/32 157.240.2.53/32 157.240.3.53/32 157.240.6.53/32 157.240.7.54/32 157.240.8.53/32 157.240.9.53/32 157.240.10.53/32 157.240.11.53/32 157.240.12.53/32 158.85.0.96/27 158.85.5.192/27 158.85.46.