# ----------------------------------------------------------------------------- # DEBIAN WHEEZY KURULUM NOTLARI # ----------------------------------------------------------------------------- Kurulum, Netinstall CD'si ile yapılacak. # ----------------------------------------------------------------------------- # Temel sistemin kurulması # ----------------------------------------------------------------------------- Select a language : English Select your location : other -> Asia -> Turkey Configure locales : United States en_US.UTF-8 Additional locales : tr_TR.UTF-8 System Locale : en_US.UTF-8 Select a keyboard layout : PC-style -> Turkish (Q layout) Configure the network : Özel bi durum olmadıkça DHCP kulan. Sabit IP adresi alacak makineleri DHCP sunucudan ayarla. DNS ayarlamak gerekirse, aşağıdakiler kullanılabilir. 4.4.4.2 Level3 4.4.4.3 Level3 4.4.4.4 Level3 208.67.222.222 OpenDNS 208.67.220.220 OpenDNS 8.8.8.8 Google 8.8.4.4 Google Configure the clock (time zone) : Europe/Istanbul Partitition disks : Manual Partition table -> gpt örnek bölümlendirme / 500 MB sda1 (bootable) /usr 5 GB sda2 (~3 GB) /var 5 GB sda3 (~2 GB) /tmp 500 MB sda4 (tmpfs yapılabilir) swap 1 GB sda5 (hibernate için ~RAM) /home X GB sda6 # ----------------------------------------------------------------------------- # Kurulum sonrası ilk ayarlar # ----------------------------------------------------------------------------- # /etc/apt/sources.list deb http://ftp.us.debian.org/debian/ wheezy main deb-src http://ftp.us.debian.org/debian/ wheezy main deb http://security.debian.org/ wheezy/updates main deb-src http://security.debian.org/ wheezy/updates main # Surum guncellemesi yapilan paketler kullanilacaksa... # Sadece masaustu makinelerde eklensin. deb http://ftp.us.debian.org/debian wheezy-updates main deb-src http://ftp.us.debian.org/debian wheezy-updates main # Iceweasel yeni surumler kullanilacaksa... deb http://mozilla.debian.net/ wheezy-backports iceweasel-release # Backports deposu kullanılacaksa deb http://http.debian.net/debian wheezy-backports main deb-src http://http.debian.net/debian wheezy-backports main # Multimedia deposu kullanilacaksa... deb http://www.deb-multimedia.org wheezy main non-free deb-src http://www.deb-multimedia.org wheezy main non-free deb http://www.deb-multimedia.org wheezy-backports main deb-src http://www.deb-multimedia.org wheezy-backports main # /etc/apt/apt.conf.d/80recommends APT::Install-Recommends "0"; APT::Install-Suggests "0"; # /etc/apt/apt.conf.d/90defaultrepo APT::Default-Release "wheezy"; # Anahtar yüklemeleri ## Iceweasel release aptitude install pkg-mozilla-archive-keyring ## Multimedia aptitude install deb-multimedia-keyring # Güncelleme apt-get update && \ apt-get -dy dist-upgrade && \ aptitude autoclean && \ aptitude full-upgrade && \ aptitude purge "~c" # İlk aşamada yüklenecek paketler aptitude install vim-nox tmux less zsh git # Default paketlerden silinecekler tasksel silinince openssh-server da otomatik siliniyor. openssh-server yeniden yüklenecek. Bu işlem esnasında SSH bağlantısı kopmuyor ama yine de tmux içinden yapılması daha güvenli. aptitude purge nfs-common rpcbind installation-report reportbug nano aptitude purge tasksel tasksel-data task-english tcpd aptitude install openssh-server # Sanal makineye kurulum yapıldıysa mpt-status paketi silinecek. aptitude purge mpt-status # Grub ayarları - Sanal makinelerde ve sunucularda Grub süresini kısaltma. /etc/default/grub GRUB_TIMEOUT=5 - Grub için parola # iki kere parola girilecek, görüntü gelmeyecek. grub-mkpasswd-pbkdf2 >>/etc/grub.d/01_password /etc/grub.d/01_password #!/bin/sh # parola grub-mkpasswd-pbkdf2 komutu ile üretiliyor cat < '-t5' ve '-r' -> '-h') ca:12345:ctrlaltdel:/sbin/shutdown -t5 -a -h now 1:2345:respawn:/sbin/getty 38400 --noclear tty1 2:23:respawn:/sbin/getty 38400 tty2 #3:23:respawn:/sbin/getty 38400 tty3 #4:23:respawn:/sbin/getty 38400 tty4 #5:23:respawn:/sbin/getty 38400 tty5 #6:23:respawn:/sbin/getty 38400 tty6 # /etc/fstab noatime eklenecek. # /etc/fstab tmpfs ayarları USB stick kurulumlarında yapılacak. tmpfs /tmp tmpfs defaults,noatime,mode=1777,size=100M 0 0 tmpfs /var/tmp tmpfs defaults,noatime,mode=1777,size=100M 0 0 tmpfs /var/log tmpfs defaults,noatime,mode=0755,size=100M 0 0 tmpfs /var/lib/dhcp tmpfs defaults,noatime,size=1M 0 0 tmpfs /var/cache/browser tmpfs noatime,size=150M,nr_inodes=10k,mode=1777 0 0 tmpfs /var/cache/sharedmem tmpfs noatime,size=100M,nr_inodes=10k,mode=1777 0 0 # /etc/modprobe.d/blacklist.conf # speaker modulu iptal blacklist pcspkr # SSH ayarları - /etc/ssh/sshd_config Port 22 # standart port kullanilmayacak PermitRootLogin no AllowUsers kullanici1 kullanici2 PasswordAuthentication no # sadece key ile baglanmaya izin verilecekse UseDNS no # Baglanan kisiler icin DNS sorgusu yapmasin - /etc/ssh/ssh_config ServerAliveInterval 100 # SSH baglantisi yaptigimizda, sunucudan kopmamamiz icin # her 100 saniyede bir ping gonderir. # /etc/network/interfaces (Emrah özel kurulum için) iface lo inet loopback # The primary network interface auto eth0 allow-hotplug eth0 iface eth0 inet dhcp # Virtualbox auto eth0:0 allow-hotplug eth0:0 iface eth0:0 inet static address 172.20.20.1 netmask 255.255.255.0 # Videojet auto eth0:1 allow-hotplug eth0:1 iface eth0:1 inet static address 192.168.1.9 netmask 255.255.255.0 # The primary wireless interface allow-hotplug wlan0 iface wlan0 inet dhcp # reboot - Normal kurulum reboot - USB Stick kurulumu rm -rf /tmp/* /var/tmp/* /var/log/* /var/lib/dhcp/*; sync; reboot # ----------------------------------------------------------------------------- # Paketlerin Kurulumu # ----------------------------------------------------------------------------- # python (temel) paketleri aptitude install python ipython aptitude install python3 ipython3 # LXC aptitude install --with-recommends lxc # monitoring paketleri aptitude install htop iotop iftop bmon bwm-ng nethogs # network paketleri aptitude install fping arping whois curl dnsutils telnet sshuttle aptitude install nuttcp ngrep netcat-openbsd aptitude install ethtool net-tools nmap tcpdump dnsmasq aptitude install minicom (Seri porttan bağlanan cihazlar için) aptitude install wvdial usb-modeswitch (USB 3G modem kullanılacaksa) aptitude install pptp-linux (VPN tunel icin) # irc, jabber, msn aptitude install weechat-curses weechat-plugins bitlbee # soft raid olacaksa aptitude install mdadm # firmware aptitude install firmware-linux-free # parallel komut çalıştırma aptitude install parallel # firmware (non-free depo) aptitude install firmware-linux-nonfree aptitude install atmel-firmware firmware-atheros firmware-b43-installer aptitude install firmware-bnx2 firmware-brcm80211 firmware-ipw2x00 aptitude install firmware-iwlwifi firmware-libertas firmware-ralink aptitude install firmware-realtek zd1211-firmware # wireless manager USB stick kurulumlarında wireless araçları olsun Diğer makinelerde wireless adaptör varsa olsun aptitude install wicd-curses wicd-cli rfkill # dosyalar, dosya sistemi, uzaktan dosya sistemlerine erişim ile ilgili paketler aptitude install bzip2 zip unzip patch tree ncdu parted autojump aptitude install lftp ncftp sshfs rsync aptitude install cryptsetup aptitude install ntfsprogs ntfs-3g aptitude install cifs-utils smbclient # CD/DVD paketleri aptitude install wodim dvd+rw-tools # Multimedia aptitude install pulseaudio pulseaudio-utils mplayer # Programlama paketleri aptitude install vim-nox # script destekli vim aptitude install git # versiyon kontrol sistemi aptitude install python-pudb # Python debugger aptitude install python-nose # unittest aptitude install python-pexpect # shell uygulamalarını interaktif çalıştırma aptitude install python-psutil # cpu, memory, process vb takip için aptitude install pychecker pylint pyflakes # kod kalitesi ve hata kontrol aptitude install python-pysqlite2 sqlite3 # SQLite kullanılacaksa aptitude install python-mysqldb # MySQL kullanılacaksa aptitude install python-psycopg2 # PostgreSQL kullanılacaksa aptitude install python-simplejson python-lxml # JSON ve XML kullanılacaksa aptitude install python-pycurl python-ipaddr python-netifaces # Network paketleri aptitude install python-openssl python-crypto # Güvenlik ve şifreleme aptitude install python-ipy # IP handling aptitude install python-serial python-parallel # Seri ve parallel portan haberleşme için aptitude install php5-cli # komut satırından PHP # Python3 paketleri aptitude install python3-psycopg2 # PostgreSQL kullanılacaksa aptitude install python3-requests # HTTP kütüphanesi, arkada urllib3 kullanıyor aptitude install python3-ipy python3-ipaddr # IP hangling aptitude install python3-lxml # XML hangling # PostgreSQL aptitude install postgresql postgresql-contrib aptitude install phppgadmin # Masaüstü paketleri aptitude install xorg aptitude install openbox # openbox kullanilacaksa... aptitude install --with-recommends i3 # i3 kullanilacaksa... aptitude install --with-recommends spectrwm # spectrwm kullanilacaksa... aptitude install xterm xtrlock unclutter numlockx aptitude install xsel scrot redshift tty-clock aptitude install iceweasel aptitude install flashplugin-nonfree aptitude install chromium dwb aptitude install pavucontrol smplayer aptitude install x11vnc xvnc4viewer rdesktop aptitude install zathura weechat-curses weechat-plugins aptitude install zenity # checkPOP3 kullanilacaksa... # Programlama (masaüstü) paketleri aptitude install python-qt4 aptitude install dia # UML ve benzeri diagramlar icin # Debian kaynak kod paketleri ile çalışılacaksa aptitude install dpkg-dev build-essential fakeroot # ----------------------------------------------------------------------------- # Yazılımların ayarlanması # ----------------------------------------------------------------------------- # LXC ayarları - /etc/fstab cgroup /sys/fs/cgroup cgroup defaults 0 0 - mount mount /sys/fs/cgroup # Klavye (Beta3 de klavye ayarlamasında problem var) dpkg-reconfigure keyboard-configuration Generic 105-key (Intl) PC Turkish The default for the keyboard layout No compose key Control+Alt+Backspace to terminate X -> No # bash - ~/.bashrc (root için) export LS_OPTIONS='--color=auto' eval "`dircolors`" alias ls='ls $LS_OPTIONS' alias ll='ls $LS_OPTIONS -l' alias l='ls $LS_OPTIONS -lA' # vi modu set -o vi # timeout export TMOUT=1200 - ~/.bashrc (normal kullanıcı) # vi modu set -o vi # sunucu kurulumlarinda history kayitli kalmasin export HISTSIZE=200 export HISTFILESIZE=0 # zargan alias z='~/bin/zargan.py' zz(){ z $@ | more } zl(){ z $@ 2>/dev/null | head -10 } # zsh - ~/.zshrc (root için) bindkey -v export TMOUT=1200 alias ls='ls --color=auto' alias ..="cd .." alias ...="cd ../.." alias ....="cd ../../.." alias .....="cd ../../../.." alias ......="cd ../../../../.." - ~/.zshrc (normal kullanıcı) bindkey -v export TMOUT=1200 # proxy alias proxy="ssh -ND 8080 emrah" # i3 kullanilacaksa alias x='ssh-agent startx' alias ls='ls --color=auto' alias ..="cd .." alias ...="cd ../.." alias ....="cd ../../.." alias .....="cd ../../../.." alias ......="cd ../../../../.." . /usr/share/autojump/autojump.sh alias z='~/bin/zargan.py' zz(){ z $@ | more } zl(){ z $@ 2>/dev/null | head -10 } # xterm default font . ~/.Xdefaults xterm*background: black xterm*foreground: green xterm*faceName: Dejavu Sans Mono:style=Regular:size=10 # spectrwm kullanılacaksa . ~/.xinitrc exec /usr/bin/spectrwm . ~/.spectrwm.conf bar_at_bottom = 1 modkey = Mod4 program[lock] = xtrlock program[iceweasel] = iceweasel bind[iceweasel] = MOD+Shift+f program[ipython3] = x-terminal-emulator /usr/bin/ipython3 bind[ipython3] = MOD+Shift+p # i3 kullanılacaksa . ~/.xinitrc exec /usr/bin/i3 . ~/.i3/config new_window 1pixel # shortcut modu mode "shortcut" { bindsym c exec /home/emrah/bin/capture_screen bindsym d exec redshift -O 5500 bindsym f exec iceweasel bindsym g exec /usr/bin/gimp bindsym n exec redshift -O 3700 bindsym p exec x-terminal-emulator /usr/bin/ipython3 # back to normal: Enter or Escape bindsym Return mode "default" bindsym Escape mode "default" } bindsym $mod+z mode "shortcut" # pass-through modu mode "pass-through" { bindsym $mod+p mode "default" } bindsym $mod+p mode "pass-through" # ~/bin/ - capture_screen Ekran görüntüsünü alıp SimpleHTTPServer ile web'ten yayınlar. Pencere yöneticisi için kısayol oluşturulsun. #!/bin/bash mkdir -p /tmp/screenshot scrot /tmp/screenshot/screenshot.png echo '' > /tmp/screenshot/index.html x-terminal-emulator -vb +sb -fg NavajoWhite1 -bg black -cr yellow \ -fn "-misc-fixed-medium-r-normal--18-120-100-100-c-90-iso10646-1" \ -T "Capture Screen" -e /bin/bash -c \ "/sbin/ifconfig eth | grep 'inet addr:' | cut -d: -f2 | cut -d' ' -f1; \ echo -e '\n\n'; \ cd /tmp/screenshot && python -m SimpleHTTPServer 9999" - zargan.py Kod deposundan kopyalanacak. # iceweasel - Vimperator manuel olarak eklensin. Depodakinde XML parser sorunu var. - NoScript manuel olarak eklensin. - Türk Trust'ı güvenilir sertifika sağlayıcılar listesinden çıkar. preferences -> Advanced -> Encryption -> View Certificates -> Authorities -> (Seçimi yap) -> Delete or Distrust Bu işlem sonrasında otorite, listede kalacak ama güvenilir olduğunu belirten OK işareti kalkacak. Silinecekler: . 2005 TÜRKTRUST . EBG Bilişim . Elektronik Bilgi Güvenliği (E-Guven) . TÜBİTAK . TÜRKTRUST - Default arama motoru Yandex olsun. mkdir -p .mozilla/firefox/34wnkw8e.default/searchplugins cd .mozilla/firefox/34wnkw8e.default/searchplugins wget http://www.emrah.com/codes/yandex.xml dialog searchengines . Edit Keyword -> yandex . Move Up (en başa) about:config . browser.search.defaultenginename -> Yandex . browser.search.order.1 -> Yandex - Proxy kullanılacaksa Preferences -> Advanced -> Network -> Settings Manual Proxy Configuration SOCKS Host localhost SOCKS Port 8080 SOCKS Type SOCKS v5 about:config -> network.proxy.socks_remote_dns -> True # bitlbee - /etc/bitlbee/bitlbee.conf DaemonInterface = 127.0.0.1 AuthMode = Closed AuthPassword = md5:... - md5 değerini bulmak için bitlbee -x hash parola1 - /etc/init.d/bitlbee restart # weechat - Ayarların default değerlerle oluşması için weechat-curses bir kere başlatılır. - ~/.weechat/weechat.conf item_time_format = "%a, %d %b %Y %H:%M" - ~/.weechat/logger.conf auto_log = off - ~/.weechat/irc.conf [server_default] nicks = "emrah,emrah_,emrah__" realname = "emrah" username = "emrah" [server] freenode.addresses = "chat.freenode.net/7000" freenode.ssl = on freenode.ssl_dhkey_size = 512 freenode.password = "parola" freenode.autoconnect = on freenode.autoreconnect = on freenode.autoreconnect_delay = 10 freenode.nicks = "emrah,emrah_,emrah__" freenode.username = "emrah" freenode.realname = "emrah" freenode.autojoin = "#gnu,#debian" freenode.autorejoin = on freenode.autorejoin_delay = 1 bitlbee.addresses = "im.bitlbee.org/6667" bitlbee.ssl = off bitlbee.password = "parola" bitlbee.autoconnect = on bitlbee.autoreconnect = on bitlbee.autoreconnect_delay = 10 bitlbee.nicks = "emrah,emrah_,emrah__" bitlbee.username = "emrah" bitlbee.realname = "emrah" bitlbee.autorejoin = on bitlbee.autorejoin_delay = 1 bitlbee_loc.addresses = "127.0.0.1/6667" bitlbee_loc.ssl = off bitlbee_loc.password = "parola1" bitlbee_loc.autoconnect = on bitlbee_loc.autoreconnect = on bitlbee_loc.autoreconnect_delay = 10 bitlbee_loc.nicks = "emrah,emrah_,emrah__" bitlbee_loc.username = "emrah" bitlbee_loc.realname = "emrah" bitlbee_loc.command = "/msg nickserv identify parola2" bitlbee_loc.autorejoin = on bitlbee_loc.autorejoin_delay = 1 - bitlbee hesabının açılması register parola2 set charset utf-8 # gtalk account add jabber emrah@gmail.com account gtalk set ssl true account gtalk set server talk.google.com account gtalk set port 5223 account gtalk set password "parola_gtalk" account gtalk on