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
@sayz
sayz / gist:619255
Created October 10, 2010 13:59 — forked from roktas/gist:618030
cd /tmp
sudo apt-get install xclip
wget http://github.com/dblevins/gistpaste/raw/master/gistpaste
chmod 755 gistpaste
sudo mv gistpaste /usr/local/bin/
git clone git://gist.github.com/618030.git
cd 618030
/usr/lib/gnome-panel/gnome-panel-add --panel=top_panel_screen0 --copy-launcher --launcher=gistpaste.desktop
# üst panelde artık bir ikon olmalı
# şimdi... herhangi bir metni seç ve o ikona tıkla
@sayz
sayz / e-h.sh
Created January 21, 2011 22:34 — forked from gdemir/e-h.sh
#!/bin/bash
cevir() {
local msj=$1
local default=$2
while :; do
echo $msj
read cevap
[ -z "$cevap" ] && cevap=$default
case $cevap in
[Ee]) return 0;;
@sayz
sayz / Makefile
Created April 8, 2011 10:52 — forked from roktas/Makefile
# Test kodlarını üret.
# Kullanım:
# make # üret
# make clean # temizle
PROGS := $(patsubst %.c,%,$(wildcard *.c))
# pthread kitaplığını ekle.
CFLAGS += -Wall -lpthread
process; ikili kodun bellekte çalıştırılabilir hale gelmiş haline denir.
scheduling; zaman tahsili
dispatch; scheduling bittiğinde başka bir processe geç
nice; işletim sistemine oncelikli görev belirleme
scheduler dispatch; kuyruga geri yolla yenisini al
@sayz
sayz / kullan.sh
Created May 30, 2011 21:42 — forked from semihozkoroglu/kullan.sh
gerekli kod parçacıkları
rename 's/eski/yeni/' * #bulundugumuz dizinde dosya ismi değiştirmek için.
echo '/tmp/foo/bar/baz.jpeg' | sed -ne 's/\(.*\)\.\(.*\)$/dosya:\1\nuzanti:\2\n/p' # p parametresini kaldırırsak sed'in sesiz kalmasını `-n` paremetresini kaldırmalıyız. `-ne` olmalı `-en` olamıyor
echo '<a href="http:www.google.com">' | sed -ne 's/\(.*\)\:\(.*\)">$/link:\2/p'
echo '10-12-2011' | sed -e 's/\(\d\{2\}\)-\(\d\{2\}\)-\(\d\{4\}\)/\3-\2-\1/'
echo '10-12-2011' | sed -e 's/\([^-]*\)-\(\([^-]*\)-\(.*\)\)$/\4-\3-\1/'
#!/usr/bin/python3
#-*- coding:utf-8 -*-
import sys
import re
sesli = ['a', 'e', 'ı', 'i', 'o', 'ö', 'u', 'ü', 'A', 'E', 'I', 'i', 'O', 'Ö', 'U', 'Ü']
sessiz = ['b', 'c', 'ç', 'd', 'f', 'g', 'ğ', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'r', 's', 'ş', 't', 'v', 'y', 'z', 'B', 'C', 'Ç', 'D', 'F', 'G', 'Ğ', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'R', 'S', 'Ş', 'T', 'V', 'Y', 'Z' ]
def reg_exp(list):
@sayz
sayz / isimler.sql
Created June 30, 2016 05:42 — forked from berkayunal/isimler.sql
isim sözlüğü
CREATE TABLE `isimler` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`ad` varchar(255) COLLATE utf8_bin NOT NULL,
`cinsiyet` varchar(50) COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `ad` (`ad`),
KEY `cinsiyet` (`cinsiyet`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
@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 / 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: