Aklımda Kalası Kelimeler

* давайте работать вместе
* Zarf ve Mazruf, Zerafet(xHoyratlık) ile aynı kökten(za-ra-fe) gelir
* Bedesten
* Suç subuta ermiştir - Suç sabit olmuştur

22 Ocak 2015 Perşembe

Centos'a Google Chrome yüklemek

Ref: http://tecadmin.net/install-google-chrome-in-centos-rhel-and-fedora/
// Kurulumu yapacak script'i indirelim
# wget http://chrome.richardlloyd.org.uk/install_chrome.sh
// Çalıştırılabilir hale getirelim
# chmod +x install_chrome.sh
// Scripti çalıştırarak yüklemeyi yapalım
# sh install_chrome.sh
// Google'ı çalıştıralım
# google-chrome

Tüm gerçekleşen çıktılar:
[root@localhost node-ihale]# wget http://chrome.richardlloyd.org.uk/install_chrome.sh
--2015-01-22 11:16:31--  http://chrome.richardlloyd.org.uk/install_chrome.sh
Resolving chrome.richardlloyd.org.uk... 193.110.246.53
Connecting to chrome.richardlloyd.org.uk|193.110.246.53|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 76261 (74K) [application/x-sh]
Saving to: “install_chrome.sh”

100%[======================================>] 76,261       266K/s   in 0.3s    

2015-01-22 11:16:32 (266 KB/s) - “install_chrome.sh” saved [76261/76261]

[root@localhost node-ihale]# chmod +x install_chrome.sh 
[root@localhost node-ihale]# sh install_chrome.sh 
Google Chrome Installer 6.10 on the x86_64 platform
(C) Richard K. Lloyd 2015 

*** Creating temporary directory /tmp/chrome_install ...
*** Changing working directory to /tmp/chrome_install ...
*** Checking for an update to install_chrome.sh ...

*** Downloading version.dat (please wait) ...

--2015-01-22 11:16:54--  http://chrome.richardlloyd.org.uk/version.dat
Resolving chrome.richardlloyd.org.uk... 193.110.246.53
Connecting to chrome.richardlloyd.org.uk|193.110.246.53|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5 [text/plain]
Saving to: “version.dat”

100%[======================================>] 5           --.-K/s   in 0s      

2015-01-22 11:16:54 (728 KB/s) - “version.dat” saved [5/5]

*** install_chrome.sh is already the latest version (6.10) - continuing ...
The following packages and their dependencies need downloading/installing:
 rpmdevtools

Do you want to download/install these packages and dependencies (y/n) ?y

*** Downloading/installing  rpmdevtools (please wait) ...

Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirror.dgn.net.tr
 * extras: mirror.dgn.net.tr
 * updates: mirror.dgn.net.tr
base                                                     | 3.7 kB     00:00     
extras                                                   | 3.4 kB     00:00     
nginx                                                    | 2.9 kB     00:00     
nodesource                                               | 2.5 kB     00:00     
updates                                                  | 3.4 kB     00:00     
Resolving Dependencies
--> Running transaction check
---> Package rpmdevtools.noarch 0:7.5-2.el6 will be installed
--> Processing Dependency: fakeroot for package: rpmdevtools-7.5-2.el6.noarch
--> Running transaction check
---> Package fakeroot.x86_64 0:1.12.2-22.2.el6 will be installed
--> Processing Dependency: fakeroot-libs = 1.12.2-22.2.el6 for package: fakeroot-1.12.2-22.2.el6.x86_64
--> Running transaction check
---> Package fakeroot-libs.x86_64 0:1.12.2-22.2.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package              Arch          Version                   Repository   Size
================================================================================
Installing:
 rpmdevtools          noarch        7.5-2.el6                 base        109 k
Installing for dependencies:
 fakeroot             x86_64        1.12.2-22.2.el6           base         73 k
 fakeroot-libs        x86_64        1.12.2-22.2.el6           base         23 k

Transaction Summary
================================================================================
Install       3 Package(s)

Total download size: 205 k
Installed size: 465 k
Downloading Packages:
(1/3): fakeroot-1.12.2-22.2.el6.x86_64.rpm               |  73 kB     00:00     
(2/3): fakeroot-libs-1.12.2-22.2.el6.x86_64.rpm          |  23 kB     00:00     
(3/3): rpmdevtools-7.5-2.el6.noarch.rpm                  | 109 kB     00:00     
--------------------------------------------------------------------------------
Total                                           706 kB/s | 205 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : fakeroot-libs-1.12.2-22.2.el6.x86_64                         1/3 
  Installing : fakeroot-1.12.2-22.2.el6.x86_64                              2/3 
  Installing : rpmdevtools-7.5-2.el6.noarch                                 3/3 
  Verifying  : fakeroot-1.12.2-22.2.el6.x86_64                              1/3 
  Verifying  : fakeroot-libs-1.12.2-22.2.el6.x86_64                         2/3 
  Verifying  : rpmdevtools-7.5-2.el6.noarch                                 3/3 

Installed:
  rpmdevtools.noarch 0:7.5-2.el6                                                

Dependency Installed:
  fakeroot.x86_64 0:1.12.2-22.2.el6    fakeroot-libs.x86_64 0:1.12.2-22.2.el6   

Complete!
*** Determining latest Google Chrome version number (please wait) ...

*** Downloading chrome_versions.csv (please wait) ...

--2015-01-22 11:17:29--  http://omahaproxy.appspot.com/all?os=linux&channel=stable
Resolving omahaproxy.appspot.com... 173.194.65.141, 2a00:1450:4013:c00::8d
Connecting to omahaproxy.appspot.com|173.194.65.141|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/plain]
Saving to: “chrome_versions.csv”

    [ <=>                                   ] 344         --.-K/s   in 0s      

2015-01-22 11:17:29 (48.2 MB/s) - “chrome_versions.csv” saved [344]

*** Latest google-chrome-stable version number is 40.0.2214.91 ...

*** Downloading google-chrome-stable_current_x86_64.rpm (please wait) ...

--2015-01-22 11:17:29--  https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
Resolving dl.google.com... 173.194.113.71, 173.194.113.73, 173.194.113.65, ...
Connecting to dl.google.com|173.194.113.71|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 62159770 (59M) [application/x-redhat-package-manager]
Saving to: “google-chrome-stable_current_x86_64.rpm”

100%[======================================>] 62,159,770  1.19M/s   in 66s     

2015-01-22 11:18:35 (924 KB/s) - “google-chrome-stable_current_x86_64.rpm” saved [62159770/62159770]

warning: google-chrome-stable_current_x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 7fac5991: NOKEY
*** Google Chrome 40.0.2214.91 downloaded successfully ...

*** Installing Google Chrome 40.0.2214.91 RPM (please wait) ...

warning: google-chrome-stable_current_x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 7fac5991: NOKEY
Preparing...                ########################################### [100%]
   1:google-chrome-stable   ########################################### [100%]

*** Google Chrome 40.0.2214.91 was installed successfully ...


*** Downloading libstdc++-4.6.3-2.fc15.x86_64.rpm (please wait) ...

--2015-01-22 11:19:10--  http://archives.fedoraproject.org/pub/archive/fedora/linux/updates/15/x86_64/libstdc++-4.6.3-2.fc15.x86_64.rpm
Resolving archives.fedoraproject.org... 209.132.181.23, 209.132.181.25, 209.132.181.27, ...
Connecting to archives.fedoraproject.org|209.132.181.23|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 295501 (289K) [application/x-rpm]
Saving to: “libstdc++-4.6.3-2.fc15.x86_64.rpm”

100%[===================================================================================================================================================================================================>] 295,501      200K/s   in 1.4s    

2015-01-22 11:19:13 (200 KB/s) - “libstdc++-4.6.3-2.fc15.x86_64.rpm” saved [295501/295501]

*** Installing /opt/google/chrome/lib/libstdc++.so.6.orig ...
changing security context of `/opt/google/chrome/lib/libstdc++.so.6.orig'

*** Downloading glibc-2.14.1-6.x86_64.rpm (please wait) ...

--2015-01-22 11:19:13--  http://archives.fedoraproject.org/pub/archive/fedora/linux/updates/15/x86_64/glibc-2.14.1-6.x86_64.rpm
Resolving archives.fedoraproject.org... 209.132.181.23, 209.132.181.25, 209.132.181.27, ...
Connecting to archives.fedoraproject.org|209.132.181.23|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3504537 (3.3M) [application/x-rpm]
Saving to: “glibc-2.14.1-6.x86_64.rpm”

100%[===================================================================================================================================================================================================>] 3,504,537    762K/s   in 5.0s    

2015-01-22 11:19:19 (680 KB/s) - “glibc-2.14.1-6.x86_64.rpm” saved [3504537/3504537]

*** Installing /opt/google/chrome/lib/libc.so.6.orig ...
changing security context of `/opt/google/chrome/lib/libc.so.6.orig'
*** Installing /opt/google/chrome/lib/ld-linux-x86-64.so.0.orig ...
changing security context of `/opt/google/chrome/lib/ld-linux-x86-64.so.0.orig'
*** Installing /opt/google/chrome/lib/libdl.so.2.orig ...
changing security context of `/opt/google/chrome/lib/libdl.so.2.orig'

*** Downloading gtk2-2.24.7-3.fc15.x86_64.rpm (please wait) ...

--2015-01-22 11:19:21--  http://archives.fedoraproject.org/pub/archive/fedora/linux/updates/15/x86_64/gtk2-2.24.7-3.fc15.x86_64.rpm
Resolving archives.fedoraproject.org... 209.132.181.23, 209.132.181.25, 209.132.181.27, ...
Connecting to archives.fedoraproject.org|209.132.181.23|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3401761 (3.2M) [application/x-rpm]
Saving to: “gtk2-2.24.7-3.fc15.x86_64.rpm”

100%[===================================================================================================================================================================================================>] 3,401,761    390K/s   in 10s     

2015-01-22 11:19:31 (325 KB/s) - “gtk2-2.24.7-3.fc15.x86_64.rpm” saved [3401761/3401761]

*** Installing /opt/google/chrome/lib/libgdk-x11-2.0.so.0 ...
changing security context of `/opt/google/chrome/lib/libgdk-x11-2.0.so.0'
*** Installing /opt/google/chrome/lib/libgtk-x11-2.0.so.0 ...
changing security context of `/opt/google/chrome/lib/libgtk-x11-2.0.so.0'

*** Downloading glib2-2.28.8-1.fc15.x86_64.rpm (please wait) ...

--2015-01-22 11:19:35--  http://archives.fedoraproject.org/pub/archive/fedora/linux/updates/15/x86_64/glib2-2.28.8-1.fc15.x86_64.rpm
Resolving archives.fedoraproject.org... 209.132.181.23, 209.132.181.25, 209.132.181.27, ...
Connecting to archives.fedoraproject.org|209.132.181.23|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1813252 (1.7M) [application/x-rpm]
Saving to: “glib2-2.28.8-1.fc15.x86_64.rpm”

100%[===================================================================================================================================================================================================>] 1,813,252    429K/s   in 4.1s    

2015-01-22 11:19:39 (429 KB/s) - “glib2-2.28.8-1.fc15.x86_64.rpm” saved [1813252/1813252]

*** Installing /opt/google/chrome/lib/libgio-2.0.so.0 ...
changing security context of `/opt/google/chrome/lib/libgio-2.0.so.0'
*** Installing /opt/google/chrome/lib/libglib-2.0.so.0 ...
changing security context of `/opt/google/chrome/lib/libglib-2.0.so.0'
*** Installing /opt/google/chrome/lib/libgobject-2.0.so.0 ...
changing security context of `/opt/google/chrome/lib/libgobject-2.0.so.0'

*** Downloading gdk-pixbuf2-2.23.3-2.fc15.x86_64.rpm (please wait) ...

--2015-01-22 11:19:41--  http://archives.fedoraproject.org/pub/archive/fedora/linux/updates/15/x86_64/gdk-pixbuf2-2.23.3-2.fc15.x86_64.rpm
Resolving archives.fedoraproject.org... 209.132.181.23, 209.132.181.25, 209.132.181.27, ...
Connecting to archives.fedoraproject.org|209.132.181.23|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 508020 (496K) [application/x-rpm]
Saving to: “gdk-pixbuf2-2.23.3-2.fc15.x86_64.rpm”

100%[===================================================================================================================================================================================================>] 508,020      273K/s   in 1.8s    

2015-01-22 11:19:43 (273 KB/s) - “gdk-pixbuf2-2.23.3-2.fc15.x86_64.rpm” saved [508020/508020]

*** Installing /opt/google/chrome/lib/libgdk_pixbuf-2.0.so.0 ...
changing security context of `/opt/google/chrome/lib/libgdk_pixbuf-2.0.so.0'

*** Downloading libgnome-keyring-3.4.1-2.fc17.x86_64.rpm (please wait) ...

--2015-01-22 11:19:44--  http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/17/Fedora/x86_64/os/Packages/l//libgnome-keyring-3.4.1-2.fc17.x86_64.rpm
Resolving archives.fedoraproject.org... 209.132.181.23, 209.132.181.25, 209.132.181.27, ...
Connecting to archives.fedoraproject.org|209.132.181.23|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 103229 (101K) [application/x-rpm]
Saving to: “libgnome-keyring-3.4.1-2.fc17.x86_64.rpm”

100%[===================================================================================================================================================================================================>] 103,229      121K/s   in 0.8s    

2015-01-22 11:19:45 (121 KB/s) - “libgnome-keyring-3.4.1-2.fc17.x86_64.rpm” saved [103229/103229]

*** Installing /opt/google/chrome/lib/libgnome-keyring.so.0 ...
changing security context of `/opt/google/chrome/lib/libgnome-keyring.so.0'
*** Patching /opt/google/chrome/lib/libc.so.6 ...
changing security context of `/opt/google/chrome/lib/libc.so.6'
*** Patching /opt/google/chrome/lib/ld-linux-x86-64.so.0 ...
changing security context of `/opt/google/chrome/lib/ld-linux-x86-64.so.0'
*** Patching /opt/google/chrome/lib/libstdc++.so.6 ...
changing security context of `/opt/google/chrome/lib/libstdc++.so.6'
*** Patching /opt/google/chrome/lib/libdl.so.2 ...
changing security context of `/opt/google/chrome/lib/libdl.so.2'
changing security context of `/opt/google/chrome/modify_wrapper'

*** Created /opt/google/chrome/modify_wrapper sucessfully ...

changing security context of `/opt/google/chrome/lib/unset_var.so'

*** Compiled/installed /opt/google/chrome/lib/unset_var.so ...


*** Building /tmp/chrome_install/chrome-deps-stable-2.10-1.x86_64.rpm ...

Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.6tPdvY
+ umask 022
+ cd /root/rpmbuild/BUILD
+ '[' /root/rpmbuild/BUILDROOT/chrome-deps-stable-2.10-1.x86_64 '!=' / ']'
+ rm -rf /root/rpmbuild/BUILDROOT/chrome-deps-stable-2.10-1.x86_64
++ dirname /root/rpmbuild/BUILDROOT/chrome-deps-stable-2.10-1.x86_64
+ mkdir -p /root/rpmbuild/BUILDROOT
+ mkdir /root/rpmbuild/BUILDROOT/chrome-deps-stable-2.10-1.x86_64
+ LANG=C
+ export LANG
+ unset DISPLAY
+ rm -rf /root/rpmbuild/BUILDROOT/chrome-deps-stable-2.10-1.x86_64
+ mkdir -p -m 755 /root/rpmbuild/BUILDROOT/chrome-deps-stable-2.10-1.x86_64/opt/google/chrome/lib
+ cp -pf /opt/google/chrome/modify_wrapper /root/rpmbuild/BUILDROOT/chrome-deps-stable-2.10-1.x86_64/opt/google/chrome
+ cp -pf /opt/google/chrome/lib/ld-linux-x86-64.so.0 /opt/google/chrome/lib/libc.so.6 /opt/google/chrome/lib/libdl.so.2 /opt/google/chrome/lib/libgdk-x11-2.0.so.0 /opt/google/chrome/lib/libgdk_pixbuf-2.0.so.0 /opt/google/chrome/lib/libgio-2.0.so.0 /opt/google/chrome/lib/libglib-2.0.so.0 /opt/google/chrome/lib/libgnome-keyring.so.0 /opt/google/chrome/lib/libgobject-2.0.so.0 /opt/google/chrome/lib/libgtk-x11-2.0.so.0 /opt/google/chrome/lib/libstdc++.so.6 /opt/google/chrome/lib/unset_var.so /root/rpmbuild/BUILDROOT/chrome-deps-stable-2.10-1.x86_64/opt/google/chrome/lib/
+ /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/redhat/brp-compress
+ /usr/lib/rpm/redhat/brp-strip /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
+ /usr/lib/rpm/brp-python-bytecompile
+ /usr/lib/rpm/redhat/brp-python-hardlink
+ /usr/lib/rpm/redhat/brp-java-repack-jars
Processing files: chrome-deps-stable-2.10-1.x86_64
Provides: ld-linux-x86-64.so.0()(64bit) ld-linux-x86-64.so.0(GLIBC_2.2.5)(64bit) ld-linux-x86-64.so.0(GLIBC_2.3)(64bit) ld-linux-x86-64.so.0(GLIBC_2.4)(64bit) ld-linux-x86-64.so.0(GLIBC_PRIVATE)(64bit) libc.so.6()(64bit) libc.so.6(GLIBC_2.10)(64bit) libc.so.6(GLIBC_2.11)(64bit) libc.so.6(GLIBC_2.12)(64bit) libc.so.6(GLIBC_2.13)(64bit) libc.so.6(GLIBC_2.14)(64bit) libc.so.6(GLIBC_2.2.5)(64bit) libc.so.6(GLIBC_2.2.6)(64bit) libc.so.6(GLIBC_2.3)(64bit) libc.so.6(GLIBC_2.3.2)(64bit) libc.so.6(GLIBC_2.3.3)(64bit) libc.so.6(GLIBC_2.3.4)(64bit) libc.so.6(GLIBC_2.4)(64bit) libc.so.6(GLIBC_2.5)(64bit) libc.so.6(GLIBC_2.6)(64bit) libc.so.6(GLIBC_2.7)(64bit) libc.so.6(GLIBC_2.8)(64bit) libc.so.6(GLIBC_2.9)(64bit) libc.so.6(GLIBC_PRIVATE)(64bit) libdl.so.2()(64bit) libdl.so.2(GLIBC_2.2.5)(64bit) libdl.so.2(GLIBC_2.3.3)(64bit) libdl.so.2(GLIBC_2.3.4)(64bit) libdl.so.2(GLIBC_PRIVATE)(64bit) libgdk-x11-2.0.so.0()(64bit) libgdk_pixbuf-2.0.so.0()(64bit) libgio-2.0.so.0()(64bit) libglib-2.0.so.0()(64bit) libgnome-keyring.so.0()(64bit) libgobject-2.0.so.0()(64bit) libgtk-x11-2.0.so.0()(64bit) libstdc++.so.6()(64bit) libstdc++.so.6(CXXABI_1.3)(64bit) libstdc++.so.6(CXXABI_1.3.1)(64bit) libstdc++.so.6(CXXABI_1.3.2)(64bit) libstdc++.so.6(CXXABI_1.3.3)(64bit) libstdc++.so.6(CXXABI_1.3.4)(64bit) libstdc++.so.6(CXXABI_1.3.5)(64bit) libstdc++.so.6(GLIBCXX_3.4)(64bit) libstdc++.so.6(GLIBCXX_3.4.1)(64bit) libstdc++.so.6(GLIBCXX_3.4.10)(64bit) libstdc++.so.6(GLIBCXX_3.4.11)(64bit) libstdc++.so.6(GLIBCXX_3.4.12)(64bit) libstdc++.so.6(GLIBCXX_3.4.13)(64bit) libstdc++.so.6(GLIBCXX_3.4.14)(64bit) libstdc++.so.6(GLIBCXX_3.4.15)(64bit) libstdc++.so.6(GLIBCXX_3.4.16)(64bit) libstdc++.so.6(GLIBCXX_3.4.2)(64bit) libstdc++.so.6(GLIBCXX_3.4.3)(64bit) libstdc++.so.6(GLIBCXX_3.4.4)(64bit) libstdc++.so.6(GLIBCXX_3.4.5)(64bit) libstdc++.so.6(GLIBCXX_3.4.6)(64bit) libstdc++.so.6(GLIBCXX_3.4.7)(64bit) libstdc++.so.6(GLIBCXX_3.4.8)(64bit) libstdc++.so.6(GLIBCXX_3.4.9)(64bit) unset_var.so()(64bit)
Requires(interp): /bin/sh
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires(post): /bin/sh
Requires: /bin/bash ld-linux-x86-64.so.0()(64bit) ld-linux-x86-64.so.0(GLIBC_2.3)(64bit) ld-linux-x86-64.so.0(GLIBC_PRIVATE)(64bit) libX11.so.6()(64bit) libXcomposite.so.1()(64bit) libXcursor.so.1()(64bit) libXdamage.so.1()(64bit) libXext.so.6()(64bit) libXfixes.so.3()(64bit) libXi.so.6()(64bit) libXinerama.so.1()(64bit) libXrandr.so.2()(64bit) libXrender.so.1()(64bit) libatk-1.0.so.0()(64bit) libc.so.6()(64bit) libc.so.6(GLIBC_2.11)(64bit) libc.so.6(GLIBC_2.14)(64bit) libc.so.6(GLIBC_2.2.5)(64bit) libc.so.6(GLIBC_2.3)(64bit) libc.so.6(GLIBC_2.3.2)(64bit) libc.so.6(GLIBC_2.3.3)(64bit) libc.so.6(GLIBC_2.3.4)(64bit) libc.so.6(GLIBC_2.4)(64bit) libc.so.6(GLIBC_2.5)(64bit) libc.so.6(GLIBC_2.7)(64bit) libc.so.6(GLIBC_2.8)(64bit) libc.so.6(GLIBC_2.9)(64bit) libc.so.6(GLIBC_PRIVATE)(64bit) libcairo.so.2()(64bit) libdbus-1.so.3()(64bit) libdl.so.2()(64bit) libdl.so.2(GLIBC_2.2.5)(64bit) libfontconfig.so.1()(64bit) libgcc_s.so.1()(64bit) libgcc_s.so.1(GCC_3.0)(64bit) libgcc_s.so.1(GCC_3.3)(64bit) libgcc_s.so.1(GCC_3.3.1)(64bit) libgcc_s.so.1(GCC_4.2.0)(64bit) libgcrypt.so.11()(64bit) libgcrypt.so.11(GCRYPT_1.2)(64bit) libgdk-x11-2.0.so.0()(64bit) libgdk_pixbuf-2.0.so.0()(64bit) libgio-2.0.so.0()(64bit) libglib-2.0.so.0()(64bit) libgmodule-2.0.so.0()(64bit) libgobject-2.0.so.0()(64bit) libgthread-2.0.so.0()(64bit) libm.so.6()(64bit) libm.so.6(GLIBC_2.2.5)(64bit) libpango-1.0.so.0()(64bit) libpangocairo-1.0.so.0()(64bit) libpangoft2-1.0.so.0()(64bit) libpng12.so.0()(64bit) libpng12.so.0(PNG12_0)(64bit) libpthread.so.0()(64bit) libpthread.so.0(GLIBC_2.2.5)(64bit) libresolv.so.2()(64bit) libresolv.so.2(GLIBC_2.2.5)(64bit) librt.so.1()(64bit) librt.so.1(GLIBC_2.2.5)(64bit) libselinux.so.1()(64bit) libz.so.1()(64bit) libz.so.1(ZLIB_1.2.2)(64bit) rtld(GNU_HASH)
Obsoletes: chrome-deps
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/chrome-deps-stable-2.10-1.x86_64
Wrote: /root/rpmbuild/RPMS/x86_64/chrome-deps-stable-2.10-1.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.YxUbCB
+ umask 022
+ cd /root/rpmbuild/BUILD
+ rm -rf /root/rpmbuild/BUILDROOT/chrome-deps-stable-2.10-1.x86_64
+ exit 0

*** Installing /tmp/chrome_install/chrome-deps-stable-2.10-1.x86_64.rpm ...

Preparing...                ########################################### [100%]
   1:chrome-deps-stable     ########################################### [100%]
changing security context of `/opt/google/chrome/lib'
*** /opt/google/chrome tree contains 100 files totalling 190 MB ...
*** /tmp/chrome_install tree contains 8 files totalling 72 MB ...

Google Chrome 40.0.2214.91 and Fedora 15/17 libs were installed successfully.
Please run the browser via the 'google-chrome' command as a non-root user.

To update Google Chrome, run "yum update google-chrome-stable" or
simply re-run this script with "./install_chrome.sh".

To uninstall Google Chrome and its dependencies added by this script,
run "yum remove google-chrome-stable chrome-deps-stable" or "./install_chrome.sh -u".

[root@localhost node-ihale]# 

21 Ocak 2015 Çarşamba

Centos üzerine NodeJs

İndirelim
curl -sL https://rpm.nodesource.com/setup | bash -
Yükleyelim
yum install -y nodejs
Versiyonumuz kaçmış?
[root@localhost Downloads]# node -v
v0.10.35
[root@localhost Downloads]# 

Ref: https://github.com/joyent/node/wiki/installing-node.js-via-package-manager

Uygulamamıza geçmeden önce uygulamamıza özel bir kullanıcı tanımlayalım ki sisteme erişim yetkileri verebilelim:




Ref: https://www.digitalocean.com/community/tutorials/how-to-deploy-node-js-applications-using-systemd-and-nginx

CentOS nginx kurulumu

Kurulumun nasılına buradan erişebilirsiniz.
/etc/yum.repos.d/nginx.repo dosya yolunu oluşturun ve içine aşağıdakini yazınki yum paket sistemi nginx'i bulabilsin.
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1

[root@localhost ~]# yum install nginx
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirror.vit.com.tr
 * extras: mirror.vit.com.tr
 * updates: mirror.vit.com.tr
google-chrome                                            |  951 B     00:00     
nginx                                                    | 2.9 kB     00:00     
nginx/primary_db                                         |  34 kB     00:00     
updates                                                  | 3.4 kB     00:00     
Resolving Dependencies
--> Running transaction check
---> Package nginx.x86_64 0:1.6.2-1.el6.ngx will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package        Arch            Version                    Repository      Size
================================================================================
Installing:
 nginx          x86_64          1.6.2-1.el6.ngx            nginx          336 k

Transaction Summary
================================================================================
Install       1 Package(s)

Total download size: 336 k
Installed size: 828 k
Is this ok [y/N]: y
Downloading Packages:
nginx-1.6.2-1.el6.ngx.x86_64.rpm                         | 336 kB     00:06     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : nginx-1.6.2-1.el6.ngx.x86_64                                 1/1 
----------------------------------------------------------------------

Thanks for using nginx!

Please find the official documentation for nginx here:
* http://nginx.org/en/docs/

Commercial subscriptions for nginx are available on:
* http://nginx.com/products/

----------------------------------------------------------------------
  Verifying  : nginx-1.6.2-1.el6.ngx.x86_64                                 1/1 

Installed:
  nginx.x86_64 0:1.6.2-1.el6.ngx                                                

Complete!
[root@localhost ~]# 

14 Ocak 2015 Çarşamba

Redmine, Git, GitLab ve OTRS entegrasyonunu CentOS üstüne kurarken

YUM komutları

Ref: http://yum.baseurl.org/wiki/YumCommands
Ben yum install ruby dediğimde kurulacak ruby versiyonunu önceden görmek istedim.Bunun için yum info ruby demem gerekiyormuş.
Centos'a MYSQL kurulumunda:
www.rackspace.com/knowledge_center/article/installing-mysql-server-on-centos

Mysql içinde işlemler yapabilmek için:
http://www.cyberciti.biz/faq/mysql-command-to-show-list-of-databases-on-server/

charlock_holmes kurulumunda gcc++ hatasını gidermek için aşağıdaki komutu kullanın(http://superuser.com/a/590810):
yum install gcc-c++

Gitlab ile ilişkili bundle kurulumlarında mysql.h hatasını gidermek için(http://stackoverflow.com/a/10968675/104085):
yum install mysql-devel


Apache kurarken:
https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-centos-6

BASH, SH, KSH gibi shell'lerin tablosu
http://www.unix.com/answers-to-frequently-asked-questions/12274-difference-between-ksh-bash-different-shells.html
/bin/bash
       The bash executable
/etc/profile
       The systemwide initialization file, executed for login shells
~/.bash_profile
       The personal initialization file, executed for login shells
~/.bashrc
       The individual per-interactive-shell startup file
~/.bash_logout
       The individual login shell cleanup file, executed when a login shell exits
~/.inputrc
       Individual readline initialization file


MYSQL kurulumu

sudo yum install mysql-server
sudo /sbin/service mysqld start


Ruby yükleme zamanı. bash: gem: command not found

Ref: http://sharadchhetri.com/2014/01/12/how-to-easily-install-ruby-2-1-0-in-centos-and-rhel/
Önce /etc/profile.d/ dizinine gidelim ve ls ile rvm.sh var mı bakalım.
Yoksa:
[root@localhost profile.d]# curl -L get.rvm.io | bash -s stable
Tekrar ls ile baktığımızda ruby kurmayı kolaylaştıran rvm.sh script dosyasını göreceğiz. Eğer ssl keyi yüklemede sorun varsa
[root@localhost profile.d]# curl -sSL https://rvm.io/mpapis.asc | gpg2 --import
kullanarak ssl sertifikasını centos içine yükleyebilirsiniz. Yabancılık çekmeyin diye sertifika aşağıdaki gibidir.
[root@localhost Downloads]# curl -sSL https://rvm.io/mpapis.asc 
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2

mQINBFRQA8EBEADrLHxW4807EJMzDjhrR5+FRy5/3616nyLlbWFTLnS1/i514L7Z
LVzbho4eZWjErRWqT1mr+E7dr/c8Ei5J8kUMqm5MoSkCoc5Y7Gp0jKhfDF4Megpd
X2ZKw7VG+4GZU9gxbm+6ymHeDAFRfQjUoHzCZsdsgnhi1C58kMoY39dFidlk24AG
E7y8WEg42yzSyJFjK5+qdGuKTBK4UmYM3uxHbxZgBLZ1PQ9DhsToauTqQSJEFzC+
r4qQeO6CeZAUEhgCt3HnmKE8hdARQelNRICrQc/Gpd3c3Wcpi3zj61cRqTCDBtNJ
h66bN+b6MilfT1S+9YMqLACXIWRcXPPUUWanmleguzGfngRjr/qf2PF6g2HYsp40
4M3CE0JX5O5iD4A81b5duuhIzZhJu1LFyn0uPX/zHlEwo36cQF3ElbsKyX6woXpx
hbHf67y6oQdSivhJvshJamRHxgi+bU6kkiiY0E8L5/8h309TVpd0wXfYfMPeE+V6
GsLjbxlU2bYrVxocREZpjCzqKBCmbZZxAd9eQPl8dYAs7kpxh8v3N9PEs0TRH2rh
KYjhKE++G/XuFOc6lm2gE5SnmwcDdJlIQm8YhW2LF/tTmQjAnxu4ILeWHwufhubv
BWn2UkdkGitrKEUmk9z24BMRKdPy0aALblvLCtri+2mf7ZaP9Stkdr/7yQARAQAB
tC1NaWNoYWwgUGFwaXMgKFJWTSBzaWduaW5nKSA8bXBhcGlzQGdtYWlsLmNvbT6J
AjkEEwECACMFAlRQA8ECGwMHCwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRA4
BLuC053A43HpD/9jf4DoYEu4adwJXJFSlUZMLZc7yNKwa2zsgBLZAzHuXc1lDDaJ
H+1hp7huxlq65EwmBJ5I8NgndBf42C0AYDXVVTQp6EW4tfnaW7zZgOcKZYp8Gu2G
HFIUPX28hm6VFJZCTo66yMVq+2a8GHhN/KgPbCd+eKIAzMWK859IYQgpXXqPgB3V
ERTGO34pBbz5GZ3BuYZvHo6Dp7Nb1RTaRdqCWXGabWz23+Gdni3K6ohNF87io7EK
SNcyzn81qG5oiYNwDMXt8T8nIIagUk7accQ6fw75FpFbZaR+nbOD7v88us40f6K9
WYV6qsOKAXygeTT63jLLLcLqe/uKRmKCO8fitIav8MHEtNOeQeQkG0O9YUCRpZvh
PlUbOhFO6iShs/AqPxIel33A65LjRpcxYNzbdgfnmdf5KEd3Uc8yafDIdSYrsSsS
...
pUSXUPl2O7qTbPAstIPT0+PstzNxcsgEzmroB7M7tTgKug==
=czPa
-----END PGP PUBLIC KEY BLOCK-----
Bu sertifikayı içeri alma işine bakalım:
[root@localhost Downloads]# curl -sSL https://rvm.io/mpapis.asc | gpg2 --import
gpg: keyring `/root/.gnupg/secring.gpg' created
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key D39DC0E3: public key "Michal Papis (RVM signing) " imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
[root@localhost Downloads]# 
rvm Yüklememiz tamamlanmış mı diye kontrol etmek için which rvm diyelim ve eğer aşağıdaki gibiyse bu iş tamamdır demek:
[root@localhost ~]# which rvm
/usr/local/rvm/bin/rvm
[root@localhost ~]# 
Şimdi rvm'nin gerekliliklerini yüklemesi için şunu çalıştıralım:
[root@localhost ~]# rvm requirements

Bende yüklü olmadığını tespit ettiklerini yükledi ve şu sonuç çıktı:
Checking requirements for centos.
Installing requirements for centos.
Installing required packages: libyaml-devel, readline-devel, zlib-devel, libffi-devel, openssl-devel, sqlite-devel............
Requirements installation successful.

Şimdi ruby 2.1.0 sürümünü yüklemek için şunu çalıştıralım:
[root@localhost ~]# rvm install 2.1.0

Bendeki sonucu:
[root@localhost ~]# rvm install 2.1.0
Searching for binary rubies, this might take some time.
Found remote file https://rvm_io.global.ssl.fastly.net/binaries/centos/6/x86_64/ruby-2.1.0.tar.bz2
Checking requirements for centos.
Requirements installation successful.
ruby-2.1.0 - #configure
ruby-2.1.0 - #download
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 20.1M  100 20.1M    0     0   805k      0  0:00:25  0:00:25 --:--:-- 1129k
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.1.0 - #validate archive
ruby-2.1.0 - #extract
ruby-2.1.0 - #validate binary
ruby-2.1.0 - #setup
ruby-2.1.0 - #gemset created /usr/local/rvm/gems/ruby-2.1.0@global
ruby-2.1.0 - #importing gemset /usr/local/rvm/gemsets/global.gems................................................
ruby-2.1.0 - #generating global wrappers........
ruby-2.1.0 - #gemset created /usr/local/rvm/gems/ruby-2.1.0
ruby-2.1.0 - #importing gemsetfile /usr/local/rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.1.0 - #generating default wrappers........
[root@localhost ~]# 

Tüm sistemde varsayılan olarak kullanılsın diye:
[root@localhost ~]#  rvm use 2.1.0 --default
Using /usr/local/rvm/gems/ruby-2.1.0
[root@localhost ~]# 

Ve son kontrolümüz, ruby'nin hangi versiyonu kuruldu olacak ve bize 2.1.0 diye dönecek:
[root@localhost ~]# ruby -v
ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux]
[root@localhost ~]# 

Rubygem ne durumda peki. Bende 2.2 çıktı ama bu adrestekileri yapınca 2.4 oldu.

Bundler kurulması gerekecek. Neden mi? Çünkü bundler sayesinde projemizdeki Gemfile içeriğine göre ilgili paketlerin kurulmasını sağlamış oluruz. Detay için: http://bundler.io/
gem kurulumundan sonra çok kolay sadecegem install bundler çalıştırın:
[root@localhost redmine-2.6]# gem install bundler
Fetching: bundler-1.7.12.gem (100%)
Successfully installed bundler-1.7.12
Parsing documentation for bundler-1.7.12
Installing ri documentation for bundler-1.7.12
Done installing documentation for bundler after 7 seconds
1 gem installed
[root@localhost redmine-2.6]# 


Geany kurulumu

Bir çok ide var linux'te. 9 Tanesi için buraya bakabilirsiniz. Ben GENAY idesini seviyorum ama yum install geany işe yaramadı diye üzülmeyin bu adreste arkadaşın teki rpm paketini halletmiş. İndirin, çalıştırın ve gerisi paket yönetim sisteminize bırakın. Nasıl yapılacağını buradaki pdf dosyasından görebilirsiniz.


Redmine Kurulumu

Redmini indiriniz ve bir klasöre açınız. İçinde Gemfile bulacaksınız. Bu dosyanın içeriğinde kurulacak paketleri göreceksiniz. Bu paketler de sisteminizde neler yüklü, test, geliştirme, canlı sistem ihtiyaçlarına göre değişiyor.
Artık Gemfile içinde ne varsa bundler sayesinde test ve geliştirme olmayan kısımların kurulmalarını isteyelim:
bundle install --without development test

Sonuçta üretilen çıktıya bakarak neyin kurulup kurulamadığını ve hata mesajına göre ne yapamız gerektiğini inceleyelim. İşte çıktımız:
[root@localhost redmine-2.6]# bundle install --without development test
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Please configure your config/database.yml first
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Installing rake 10.4.2
Installing i18n 0.6.11
Installing multi_json 1.10.1
Installing activesupport 3.2.21
Installing builder 3.0.4
Installing activemodel 3.2.21
Installing erubis 2.7.0
Installing journey 1.0.4
Installing rack 1.4.5
Installing rack-cache 1.2
Installing rack-test 0.6.3
Installing hike 1.2.3
Installing tilt 1.4.1
Installing sprockets 2.2.3
Installing actionpack 3.2.21
Installing mime-types 1.25.1
Installing polyglot 0.3.5
Installing treetop 1.4.15
Installing mail 2.5.4
Installing actionmailer 3.2.21
Installing arel 3.0.3
Installing tzinfo 0.3.42
Installing activerecord 3.2.21
Installing activeresource 3.2.21
Using bundler 1.7.12
Installing coderay 1.1.0
Installing rack-ssl 1.3.4
Installing json 1.8.2
Installing rdoc 3.12.2
Installing thor 0.19.1
Installing railties 3.2.21
Installing jquery-rails 3.1.2
Installing net-ldap 0.3.1
Installing ruby-openid 2.3.0
Installing rack-openid 1.4.2
Installing rails 3.2.21
Installing rbpdf 1.18.4
Installing redcarpet 2.3.0
Installing request_store 1.0.5

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /usr/local/rvm/rubies/ruby-2.1.0/bin/ruby extconf.rb 
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... no
checking for pkg-config... yes
checking for ImageMagick version >= 6.4.9... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
 --with-opt-dir
 --without-opt-dir
 --with-opt-include
 --without-opt-include=${opt-dir}/include
 --with-opt-lib
 --without-opt-lib=${opt-dir}/lib
 --with-make-prog
 --without-make-prog
 --srcdir=.
 --curdir
 --ruby=/usr/local/rvm/rubies/ruby-2.1.0/bin/ruby
extconf.rb:154:in ``': No such file or directory - convert (Errno::ENOENT)
 from extconf.rb:154:in `block in 
' from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/mkmf.rb:918:in `block in checking_for' from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/mkmf.rb:351:in `block (2 levels) in postpone' from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/mkmf.rb:321:in `open' from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/mkmf.rb:351:in `block in postpone' from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/mkmf.rb:321:in `open' from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/mkmf.rb:347:in `postpone' from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/mkmf.rb:917:in `checking_for' from extconf.rb:151:in `
' extconf failed, exit code 1 Gem files will remain installed in /usr/local/rvm/gems/ruby-2.1.0/gems/rmagick-2.13.4 for inspection. Results logged to /usr/local/rvm/gems/ruby-2.1.0/extensions/x86_64-linux/2.1.0/rmagick-2.13.4/gem_make.out An error occurred while installing rmagick (2.13.4), and Bundler cannot continue. Make sure that `gem install rmagick -v '2.13.4'` succeeds before bundling. [root@localhost redmine-2.6]#

Hatanın olduğu yer rmagick yüklemesiydi. gem install rmagick -v '2.13.4' komutuyla hatayı bir kez daha görebiliriz. Biraz internet aramasıyla development sürümünün yüklenmesiyle bu sorun ortadan kalkıyormuş, yapalım. yum install ImageMagick-devel ile 6.5.4.7 sürümüyle sorunu giderebildiğimizi bundle install --without development test ile göreceğiz.
Bu kez komutumuzun çıktısı şöyle oldu:
[root@localhost redmine-2.6]# bundle install --without development test
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on
this machine.
Please configure your config/database.yml first
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Using rake 10.4.2
Using i18n 0.6.11
Using multi_json 1.10.1
Using activesupport 3.2.21
Using builder 3.0.4
Using activemodel 3.2.21
Using erubis 2.7.0
Using journey 1.0.4
Using rack 1.4.5
Using rack-cache 1.2
Using rack-test 0.6.3
Using hike 1.2.3
Using tilt 1.4.1
Using sprockets 2.2.3
Using actionpack 3.2.21
Using mime-types 1.25.1
Using polyglot 0.3.5
Using treetop 1.4.15
Using mail 2.5.4
Using actionmailer 3.2.21
Using arel 3.0.3
Using tzinfo 0.3.42
Using activerecord 3.2.21
Using activeresource 3.2.21
Using bundler 1.7.12
Using coderay 1.1.0
Using rack-ssl 1.3.4
Using json 1.8.2
Using rdoc 3.12.2
Using thor 0.19.1
Using railties 3.2.21
Using jquery-rails 3.1.2
Using net-ldap 0.3.1
Using ruby-openid 2.3.0
Using rack-openid 1.4.2
Using rails 3.2.21
Using rbpdf 1.18.4
Using redcarpet 2.3.0
Using request_store 1.0.5
Installing rmagick 2.13.4
Your bundle is complete!
Gems in the groups development and test were not installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
Post-install message from rmagick:
Please report any bugs. See https://github.com/gemhome/rmagick/compare/RMagick_2-13-2...master and https://github.com/rmagick/rmagick/issues/18
[root@localhost redmine-2.6]# 


Redmine Mysql ayarları

Mysql server çalışıyorsa mysql komut satırına terminal windowdan erişebiliriz ya da erişemeyiz:
[root@localhost redmine-2.6]# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[root@localhost redmine-2.6]# 
Yapacağımız şey centos servislerinde mysql sunucuyu başlatmak:
[root@localhost redmine-2.6]# service mysqld start
Starting mysqld:                                           [  OK  ]
[root@localhost redmine-2.6]# 

Ve tekrar:
[root@localhost redmine-2.6]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.73 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 

Şimdi önce database yaratıyoruz "utf8" karakter encodingiyle:
CREATE DATABASE redmine CHARACTER SET utf8;

DB işlemleri için `redmine` kullanıcısı oluşturalım ve yetkilendirelim:
CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'şifre_ne_istiyorsanız';
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';


REDMINE Database AYARLARI

Sırada redmine uygulaması ayarlarından yarattığımız mysql kullanıcısı redmine'in bilgilerini database.yml içinde güncellemek. Önce redmine klasörüne (indirip extract ettiğimiz sıkıştırılmış dosyanın ardından oluşan klasöre) gidip config alt klasörü altındaki database.yml.example dosyasından bir kopya oluşturup(ben ilk örnek dosyaları tutmayı severim) adını database.yml olarak değiştirelim ve içindeki production ayarlarını:
production:
  adapter: mysql2
  database: redmine
  host: localhost
  username: redmine
  password: "redmine"
  encoding: uth8
olarak değiştirelim.


REDMINE session anahtarları için SECRET

rake generate_secret_tokenİle keyfe keder bir anahtar yaratalımki session id tahmin etme işini imkansıza taşıyalım. Rake nedir diye sorarsanız, kısaca otomatize işler yapabilmesi için Ruby'nin aracıdır.
[root@localhost redmine-2.6]# rake generate_secret_token
Could not find gem 'mysql2 (~> 0.3.11) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.
[root@localhost redmine-2.6]# 
O da ne! mysql2 yokmuş

O da ne! mysql2 yüklü değilmiş. Gem install ile yüklemeyi deneyelim:
[root@localhost redmine-2.6]# gem install mysql2
Fetching: mysql2-0.3.17.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing mysql2:
 ERROR: Failed to build gem native extension.

    /usr/local/rvm/rubies/ruby-2.1.0/bin/ruby extconf.rb
checking for ruby/thread.h... yes
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_hash_dup()... yes
checking for rb_intern3()... yes
-----
Using mysql_config at /usr/bin/mysql_config
-----
checking for mysql.h... no
checking for mysql/mysql.h... no
-----
mysql.h is missing.  please check your installation of mysql and try again.
-----
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
 --with-opt-dir
 --without-opt-dir
 --with-opt-include
 --without-opt-include=${opt-dir}/include
 --with-opt-lib
 --without-opt-lib=${opt-dir}/lib
 --with-make-prog
 --without-make-prog
 --srcdir=.
 --curdir
 --ruby=/usr/local/rvm/rubies/ruby-2.1.0/bin/ruby
 --with-mysql-dir
 --without-mysql-dir
 --with-mysql-include
 --without-mysql-include=${mysql-dir}/include
 --with-mysql-lib
 --without-mysql-lib=${mysql-dir}/lib
 --with-mysql-config
 --without-mysql-config

extconf failed, exit code 1

Gem files will remain installed in /usr/local/rvm/gems/ruby-2.1.0/gems/mysql2-0.3.17 for inspection.
Results logged to /usr/local/rvm/gems/ruby-2.1.0/extensions/x86_64-linux/2.1.0/mysql2-0.3.17/gem_make.out
[root@localhost redmine-2.6]# 

Hata korkutmasın sebebi `mysql.h is missing` cümlesinde yatıyor. Sanırım bunu da mysql-devel ile çözebiliriz.Nitekim aradık ve stackoverflow imdadımıza yetişti.
[root@localhost redmine-2.6]# yum install mysql-devel
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirror.dgn.net.tr
 * extras: mirror.dgn.net.tr
 * updates: mirror.dgn.net.tr
Resolving Dependencies
--> Running transaction check
---> Package mysql-devel.x86_64 0:5.1.73-3.el6_5 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================
 Package                                Arch                              Version                                      Repository                       Size
===================================================================================================
Installing:
 mysql-devel                            x86_64                            5.1.73-3.el6_5                               base                            129 k

Transaction Summary
===================================================================================================
Install       1 Package(s)

Total download size: 129 k
Installed size: 388 k
Is this ok [y/N]: y
Downloading Packages:
mysql-devel-5.1.73-3.el6_5.x86_64.rpm                                                                                                 | 129 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : mysql-devel-5.1.73-3.el6_5.x86_64                                                                                                         1/1 
  Verifying  : mysql-devel-5.1.73-3.el6_5.x86_64                                                                                                         1/1 

Installed:
  mysql-devel.x86_64 0:5.1.73-3.el6_5                                                                                                                        

Complete!
[root@localhost redmine-2.6]# 

Tekrar gem'den mysql2 yüklemeyi deneyelim:
[root@localhost redmine-2.6]# gem install mysql2
Building native extensions.  This could take a while...
Successfully installed mysql2-0.3.17
Parsing documentation for mysql2-0.3.17
Installing ri documentation for mysql2-0.3.17
Done installing documentation for mysql2 after 1 seconds
1 gem installed
[root@localhost redmine-2.6]#

Şimdi tekrar deneyelim Rakefile çalıştıralım ama generate_session_token anahtarıyla ve olduğunu görelim:
[root@localhost redmine-2.6]# rake generate_secret_token
[root@localhost redmine-2.6]# 

Tabloları ve ilişkileri oluşturmak için tekrar rake'e başvuralım.
[root@localhost redmine-2.6]# RAILS_ENV=production rake db:migrate
..... TONLA ÇIKTI ve
==  ChangeChangesetsCommentsLimit: migrating ==================================
-- change_column(:changesets, :comments, :text, {:limit=>16777216})
   -> 0.0649s
==  ChangeChangesetsCommentsLimit: migrated (0.0654s) =========================

==  AddPasswordChangedAtToUser: migrating =====================================
-- add_column(:users, :passwd_changed_on, :datetime)
   -> 0.0450s
==  AddPasswordChangedAtToUser: migrated (0.0452s) ============================

==  InsertBuiltinGroups: migrating ============================================
==  InsertBuiltinGroups: migrated (0.2701s) ===================================

[root@localhost redmine-2.6]# 


Başlangıç verilerini oluşturmak ve dilimizi(tr) seçmek için

[root@localhost redmine-2.6]# RAILS_ENV=production rake redmine:load_default_data

Select language: ar, az, bg, bs, ca, cs, da, de, el, en, en-GB, es, et, eu, fa, fi, fr, gl, he, hr, hu, id, it, ja, ko, lt, lv, mk, mn, nl, no, pl, pt, pt-BR, ro, ru, sk, sl, sq, sr, sr-YU, sv, th, tr, uk, vi, zh, zh-TW [en] tr
====================================
Default configuration data loaded.
[root@localhost redmine-2.6]# 


Ve çalıştıralım:

Başlayacak ve http taleplerini bekliyor olacak. Nerede mi? http://localhost:3000 adresinde.
[root@localhost redmine-2.6]# ruby script/rails server webrick -e production
=> Booting WEBrick
=> Rails 3.2.21 application starting in production on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2015-01-19 15:59:39] INFO  WEBrick 1.3.1
[2015-01-19 15:59:39] INFO  ruby 2.1.0 (2013-12-25) [x86_64-linux]
[2015-01-19 15:59:39] INFO  WEBrick::HTTPServer#start: pid=3547 port=3000


Sonuca birlikte bakalım:







REDMINE Yüklerken yaşadıklarımı ilk toparladığım başlık

http://www.redmine.org/projects/redmine/wiki/RedmineInstall

gem install json -v '1.8.2'
-- hata:
 mkmf.rb can't find header files for ruby at /usr/lib/ruby/ruby.h
-- çözüm:
 http://stackoverflow.com/questions/4304438/gem-install-failed-to-build-gem-native-extension-cant-find-header-files
 For those who may be confused by the accepted answer, as I was, you also need to have the ruby headers installed [ruby-devel].
-- çalışmadığı için:
 yum -y install gcc mysql-devel ruby-devel rubygems
-- sonra
 gem install json -v '1.8.2'

 gem install rmagick -v '2.13.3'
-- hata
 Can't install RMagick 0.0.0. Can't find Magick-config in /root/.rbenv/shims:
-- çözüm:
 yum install ImageMagick-devel

-- redmine yükle:
 bundle install --without development test

-- with Redmine 2.x:
 rake generate_secret_token

-- db için tablo v.s. oluşturma:
 RAILS_ENV=production rake db:migrate

-- Database default data set
 RAILS_ENV=production rake redmine:load_default_data

GITLAB'ın PORTUNU DEĞİŞTİRMEK

/var/opt/gitlab/nginx/conf klasöründe `gitlab-http.conf` dosyasını düzenleyerek aşağıdaki şekilde sunucu ayarını değiştirebilirsiniz:
server {
  listen *:82;
  server_name localhost;

18 Aralık 2014 Perşembe

17 Aralık 2014 Çarşamba

NODE_ENV nasıl bir şey?

Aşağıdaki yazıyı kavrayışınızı derinleştirmeniz için derinlemesine yazıyorum. Umarım yüksek anlayış seviyesine varmanızda faydası olur ;)

Node uygulamanızın test mi production mı, development mu olduğunu ve ona göre çalıştırılmasına karar verdiğiniz noktada sizin de benim gibi process.env.NODE_ENV değerine atama yapmanız gerekecek.
Ama önce process.env ne getiriyor ve anlamı ne?
C:\temp\nodeapp>node app.js
process.env = {"ALLUSERSPROFILE":"C:\\ProgramData","APPDATA":"C:\\Users\\cem\\AppData\\Roaming","CommonProgramFiles":"C:\\Program Files\\Common Files","CommonProgramFiles(x86)":"C:\\Program Files (x86)\\Common Files","CommonProgramW6432":"C:\\Program Files\\Common Files","COMPUTERNAME":"G6YE305003NG","ComSpec":"C:\\Windows\\system32\\cmd.exe","ConEmuANSI":"ON","ConEmuAnsiLog":"","ConEmuArgs":"","ConEmuBackHWND":"0x000A098A","ConEmuBaseDir":"C:\\_Portables\\ConEmu\\ConEmu","ConEmuBuild":"141208","ConEmuConfig":"","ConEmuDir":"C:\\_Portables\\ConEmu","ConEmuDrawHWND":"0x00040A1E","ConEmuDrive":"C:","ConEmuHooks":"Enabled","ConEmuHWND":"0x00080978","ConEmuPID":"4228","ConEmuServerPID":"4600","ConEmuWorkDir":"C:\\Users\\cem","ConEmuWorkDrive":"C:","FP_NO_HOST_CHECK":"NO","HOMEDRIVE":"C:","HOMEPATH":"\\Users\\cem","LOCALAPPDATA":"C:\\Users\\cem\\AppData\\Local","LOGONSERVER":"\\\\G6YE305003NG","NUMBER_OF_PROCESSORS":"4","OS":"Windows_NT","Path":"C:\\_Portables\\ConEmu\\ConEmu;C:\\Program Files\\Common Files\\Microsoft Shared\\Windows Live;C:\\Program Files (x86)\\Common Files\\Microsoft Shared\\Windows Live;C:\\Program Files (x86)\\Intel\\iCLS Client\\;C:\\Program Files\\Intel\\iCLS Client\\;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\Intel\\OpenCL SDK\\3.0\\bin\\x86;C:\\Program Files (x86)\\Intel\\OpenCL SDK\\3.0\\bin\\x64;C:\\Program Files (x86)\\Windows Kits\\8.1\\Windows Performance Toolkit\\;C:\\Program Files\\Microsoft SQL Server\\110\\Tools\\Binn\\;C:\\Program Files\\Microsoft\\Web Platform Installer\\;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\IPT;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\IPT;c:\\_Portables\\mysql-5.6.15-winx64\\bin;C:\\Program Files (x86)\\MySQL\\MySQL Utilities 1.3.6\\;C:\\Program Files\\MySQL\\MySQL Server 5.1\\bin;C:\\Program Files\\TortoiseSVN\\bin;C:\\Program Files (x86)\\Microsoft SDKs\\TypeScript\\1.0\\;C:\\xampp\\php;C:\\ProgramData\\ComposerSetup\\bin;C:\\Program Files (x86)\\Windows Live\\Shared;C:\\Program Files (x86)\\Git\\cmd;C:\\_Portables\\ConEmu;C:\\Program Files\\nodejs\\;C:\\Users\\cem\\AppData\\Roaming\\npm","PATHEXT":".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC","PROCESSOR_ARCHITECTURE":"AMD64","PROCESSOR_IDENTIFIER":"Intel64 Family 6 Model 58 Stepping 9, GenuineIntel","PROCESSOR_LEVEL":"6","PROCESSOR_REVISION":"3a09","ProgramData":"C:\\ProgramData","ProgramFiles":"C:\\Program Files","ProgramFiles(x86)":"C:\\Program Files (x86)","ProgramW6432":"C:\\Program Files","PROMPT":"$P$G","PSModulePath":"C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules\\","PUBLIC":"C:\\Users\\Public","SESSIONNAME":"Console","SystemDrive":"C:","SystemRoot":"C:\\Windows","TEMP":"C:\\Users\\cem\\AppData\\Local\\Temp","TMP":"C:\\Users\\cem\\AppData\\Local\\Temp","USERDOMAIN":"G6YE305003NG","USERNAME":"cem","USERPROFILE":"C:\\Users\\cem","VS110COMNTOOLS":"C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\Common7\\Tools\\","VS120COMNTOOLS":"C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\Common7\\Tools\\","windir":"C:\\Windows","windows_tracing_flags":"3","windows_tracing_logfile":"C:\\BVTBin\\Tests\\installpackage\\csilogfile.log"}

Hangi işletim sistemini kullanırsanız kullanın, sistem üzerinde kaynaklara erişim için ortam değişkenleri kullanılır. Bu değişkenler hem kullnıcıya hem sisteme göre iki türde olur. Sisteme dahil olan değikenlere tüm kullanıcılar ve uygulamaları erişebilirken kullanıcıya ait olanlara ise sadece değişkeni kendisinde tanımlı kullanıcı erişebilir.
Sistem değişkenleri registry içinde burada tanımlıdır: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\


Yerel değişkenler(kullanıcı değişkenleri) ise burada: HKEY_CURRENT_USER\Environment\


Ayrıca bu değişkenlere bilgisayarım ikonuna sağ tuş ve sistem değişkenleri kısmından erişebilirsiniz:


Tüm ortam değişkenlerini bulmamızı sağlayan node scriptini bir dosyaya yazın ve c:\>node dosyaAdi.js diyerek çalıştırın:
console.log('process.env = ' + JSON.stringify(process.env));

Sonucu json formattırladığımızda değerleri açık seçik göreceksiniz:
{
  "ALLUSERSPROFILE": "C:\\ProgramData",
  "APPDATA": "C:\\Users\\cem\\AppData\\Roaming",
  "CommonProgramFiles": "C:\\Program Files\\Common Files",
  "CommonProgramFiles(x86)": "C:\\Program Files (x86)\\Common Files",
  "CommonProgramW6432": "C:\\Program Files\\Common Files",
  "COMPUTERNAME": "G6YE305003NG",
  "ComSpec": "C:\\Windows\\system32\\cmd.exe",
  "ConEmuANSI": "ON",
  "ConEmuAnsiLog": "",
  "ConEmuArgs": "",
  "ConEmuBackHWND": "0x000A098A",
  "ConEmuBaseDir": "C:\\_Portables\\ConEmu\\ConEmu",
  "ConEmuBuild": "141208",
  "ConEmuConfig": "",
  "ConEmuDir": "C:\\_Portables\\ConEmu",
  "ConEmuDrawHWND": "0x00040A1E",
  "ConEmuDrive": "C:",
  "ConEmuHooks": "Enabled",
  "ConEmuHWND": "0x00080978",
  "ConEmuPID": "4228",
  "ConEmuServerPID": "4600",
  "ConEmuWorkDir": "C:\\Users\\cem",
  "ConEmuWorkDrive": "C:",
  "FP_NO_HOST_CHECK": "NO",
  "HOMEDRIVE": "C:",
  "HOMEPATH": "\\Users\\cem",
  "LOCALAPPDATA": "C:\\Users\\cem\\AppData\\Local",
  "LOGONSERVER": "\\\\G6YE305003NG",
  "NUMBER_OF_PROCESSORS": "4",
  "OS": "Windows_NT",
  "Path": "C:\\_Portables\\ConEmu\\ConEmu;C:\\Program Files\\Common Files\\Microsoft Shared\\Windows Live;C:\\Program Files (x86)\\Common Files\\Microsoft Shared\\Windows Live;C:\\Program Files (x86)\\Intel\\iCLS Client\\;C:\\Program Files\\Intel\\iCLS Client\\;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\Intel\\OpenCL SDK\\3.0\\bin\\x86;C:\\Program Files (x86)\\Intel\\OpenCL SDK\\3.0\\bin\\x64;C:\\Program Files (x86)\\Windows Kits\\8.1\\Windows Performance Toolkit\\;C:\\Program Files\\Microsoft SQL Server\\110\\Tools\\Binn\\;C:\\Program Files\\Microsoft\\Web Platform Installer\\;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\IPT;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\IPT;c:\\_Portables\\mysql-5.6.15-winx64\\bin;C:\\Program Files (x86)\\MySQL\\MySQL Utilities 1.3.6\\;C:\\Program Files\\MySQL\\MySQL Server 5.1\\bin;C:\\Program Files\\TortoiseSVN\\bin;C:\\Program Files (x86)\\Microsoft SDKs\\TypeScript\\1.0\\;C:\\xampp\\php;C:\\ProgramData\\ComposerSetup\\bin;C:\\Program Files (x86)\\Windows Live\\Shared;C:\\Program Files (x86)\\Git\\cmd;C:\\_Portables\\ConEmu;C:\\Program Files\\nodejs\\;C:\\Users\\cem\\AppData\\Roaming\\npm",
  "PATHEXT": ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC",
  "PROCESSOR_ARCHITECTURE": "AMD64",
  "PROCESSOR_IDENTIFIER": "Intel64 Family 6 Model 58 Stepping 9, GenuineIntel",
  "PROCESSOR_LEVEL": "6",
  "PROCESSOR_REVISION": "3a09",
  "ProgramData": "C:\\ProgramData",
  "ProgramFiles": "C:\\Program Files",
  "ProgramFiles(x86)": "C:\\Program Files (x86)",
  "ProgramW6432": "C:\\Program Files",
  "PROMPT": "$P$G",
  "PSModulePath": "C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules\\",
  "PUBLIC": "C:\\Users\\Public",
  "SESSIONNAME": "Console",
  "SystemDrive": "C:",
  "SystemRoot": "C:\\Windows",
  "TEMP": "C:\\Users\\cem\\AppData\\Local\\Temp",
  "TMP": "C:\\Users\\cem\\AppData\\Local\\Temp",
  "USERDOMAIN": "G6YE305003NG",
  "USERNAME": "cem",
  "USERPROFILE": "C:\\Users\\cem",
  "VS110COMNTOOLS": "C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\Common7\\Tools\\",
  "VS120COMNTOOLS": "C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\Common7\\Tools\\",
  "windir": "C:\\Windows",
  "windows_tracing_flags": "3",
  "windows_tracing_logfile": "C:\\BVTBin\\Tests\\installpackage\\csilogfile.log"
}



Bu environment variables uzun klasör adları yazmayı önlediği gibi hızlıca çalıştırmak istediğiniz uygulamalara da klasör adları eklemeden gidebilmenizi sağlar. Klasörlere ise %YOL_ADI% ile erişebilirsiniz.

Referanslar:
  1. environmentvariables.org
  2. www.computerhope.com

16 Aralık 2014 Salı

node js debug paketi ile debug etmek

Debug ile ilgili node-inspector çok iş görüyor ve hele webstorm'unuz varsa başka bir araca ihtiyacınız yok demektir ama öğrenmenin sonu yok. Bir videoda debug modülünü gördüm ve merak ettim nasıl çalışıyor diye. Aslında webstorm içinde çıktıları filitreleyebilmek isterdim ama buna debug modülü bir nebze hizmet ettiği için bilmekte fayda var.

Şöyle çalışıyormuş:
  1. Önce paketi ekleyin, var Debug = require('debug');
  2. Ekran çıktıları görünsün diye: Debug.enable('süzmek_icin_fonksiyon_icindeki_isimler_ya_da_hepsi_icin_*');
  3. sonra çıktı görmek istediğini fonksiyonların içine bir değişken tanımlayın Debug'dan var debug = Debug('fonksiyonu_filitrelemek_icin_bir_isim_yazin');
  4. çıktılarınızı görmek için için, debug('main fonksiyonu içinden!', degisken, degisken1);
var Debug = require('debug');

/* ekranda sadece app:main 
   fonksiyonuna ait çıktıları görebilmek için */
Debug.enable('app:main');

/* ekranda hem app:main hem de app:main1
   fonksiyonlarına ait çıktıları görebilmek için */
Debug.enable('app:main,app:main1');

/* ekranda tüm debug değişkeni içeren fonskiyonları 
   fonksiyonlara ait çıktıları görebilmek için      */
Debug.enable('*');

var main = function() {  
    var degisken = [
        { adi:'Cenk', soyadi:'Topkaya' },
        { adi:'Cem', soyadi:'Topkaya' }
    ];
    var degisken1 = { adi:'Cem', soyadi:'Topkaya' }
    /* debug değikeni yaratılırken 
       fonksiyonun eşsiz adını tanımlayalım ki
       tüm çalışanların içinde filitre edebilelim */
    var debug = Debug('app:main');
    debug('main fonksiyonu içinden!');
    debug('Tek bir değişken: ', degisken);
    debug('Birden fazla değişken: ', degisken, degisken1);
}

var main1 = function() {    
    var debug = Debug('app:main1');
    debug('main1 fonksiyonu içinden!');
}


main();
main1();

28 Kasım 2014 Cuma

jQuery requires a window with a document

jQuery ile dom parse etmek içinde gezerek manipüle etmek istediğimde aldığım hataydı: jQuery requires a window with a document

jsdom, cheerio kullanımı tavsiye edilse de jQuery ile çalışmak için bir yol daha var. Şimdilik çok eski diyemeyeceğim 1.8.3 NodeJs tarafında çok fazlaca işlerimi gördüğünden
C:\Projeler\Test>npm install jquery@1.8.3
ile tam sürümünü kurabilirsiniz.

$ ile şöyle çalışabilirsiniz:
var fnCalisAbi = function () {
    var options = {
        method: 'GET',
        host: '127.0.0.1', // Fiddler içinde görünsün deyyu
        port: 8888,        // Fiddlerin dinlediği porta yönlendiriyoruz
        path: 'http://bidibidi.com/tata.aspx',
        headers: {
            Host: 'bidibidi.com',
            'Content-Type': 'application/x-www-form-urlencoded',
            'Cookie': "ASP.NET_SessionId=4etkmibuyjbg1qi3x04eouuz"
        }
    };
    var $ = require('jquery'),
        sayfa='';
    var req = http.request(options, function (res) {
        console.log('STATUS: ' + res.statusCode);
        console.log('HEADERS: ' + JSON.stringify(res.headers));

        res.setEncoding('utf8');  // sayfa cevap olarak utf8 gelecek

        res.on('data', function (chunk) {  // Tek bir pakette gelmezse ki gelmez, her parça geldiğinde
            sayfa+= chunk;                 // sayfa değişkenine ekleyelimki tüm html elimizde olsun
        });

        res.on('end', function (chunk) {   // Aktarım(response, cevap) tamamlandığında jQuery ile işleyelim
            $sayfa = $(sayfa);
            var tbl = $sayfa.find(".cssAdi").parents("table:first").find("tr").map(function() {
                return $(this).attr("style")
                    ? {
                        Cinsi:$(this).find("td:nth(1)").text(),
                        Miktari:$(this).find("td:nth(2)").text(),
                        Birim:$(this).find("td:nth(3)").text(),
                        Aciklama:$(this).find("td:nth(4)").text()
                      }
                    : null;
            }).get();
            console.log("Sonuçta oluşan dizi:");
            console.log(tbl);
        });
    });

    req.on('error', function (e) {
        console.log('problem with request: ' + e.message);
    });

    req.on('end', function (e) {

    });

    req.end();
};

30 Ekim 2014 Perşembe

Deferred nesneler

JSFiddle.net


console.clear()
var deferred = $.Deferred();
var t1= deferred.promise().
then(function(){
    console.log("1. çalıştı");
    return "ahmet";
}).
fail(function(){
    // Sadece aynı dizide hata olduğunda çalışacaklar dizisine eklenen fonksiyon
    console.log("1. fail çalıştı");
}).
then(function(){
    // üst then içinden return edilen değişkenleri aldığımız fonksyion
    console.log(arguments);
    console.log("2. çalıştı");
    var t = $.Deferred();
    setTimeout(function() {
        console.log('rejecting...');
        t.reject();
    }, 1000);

    return t.promise();
}).
then(function(){
    console.log("3. çalıştı");
    console.log(arguments);
}).
fail(function(){
    console.log("2. fail çalıştı");
});

t1.then(function(){
    console.log("t1. then çalıştı");
}).
fail(function(){
    console.log("t1 1. fail çalıştı");
});

deferred.resolve();
console.log("en son satır çalıştı bile");
/*return;
promise1 = deferred.promise();

promise2 = promise1.then(function(){
    var t = $.Deferred();
    setTimeout(function() {
        console.log('rejecting...');
        t.reject();
    }, 1000);

    return t.promise();
});

promise2.then(function() {
    console.log('i should never be called');
})

promise2.fail(function() {
    console.log('i should be called');
});

deferred.resolve();
*/

11 Ekim 2014 Cumartesi

Yeoman ile proje üretmek

Yeoman için öncelikle node package manager kullanarak yo paketini yüklemelisiniz:
C:\Users\cem.topkaya>npm install -g yo
C:\Users\cem.topkaya\AppData\Roaming\npm\yo -> C:\Users\cem.topkaya\AppData\Roaming\npm\node_modules\yo\cli.js

> yo@1.3.2 postinstall C:\Users\cem.topkaya\AppData\Roaming\npm\node_modules\yo
> yodoctor

[Yeoman Doctor] Everything looks all right!

yo@1.3.2 C:\Users\cem.topkaya\AppData\Roaming\npm\node_modules\yo
├── is-root@1.0.0
├── sudo-block@1.0.0
├── yeoman-doctor@1.0.0
├── fullname@1.0.0
├── opn@1.0.0
├── async@0.9.0
├── shelljs@0.3.0
├── underscore.string@2.3.3
├── lodash@2.4.1
├── string-length@1.0.0 (strip-ansi@2.0.0)
├── chalk@0.5.1 (escape-string-regexp@1.0.2, ansi-styles@1.1.0, supports-color@0.2.0, strip-ansi@0.3.0, has-ansi@0.1.0)
├── yeoman-character@1.0.0 (supports-color@1.1.0)
├── nopt@3.0.1 (abbrev@1.0.5)
├── findup@0.1.5 (commander@2.1.0, colors@0.6.2)
├── multiline@1.0.1 (strip-indent@1.0.0)
├── yosay@1.0.0 (ansi-regex@1.1.0, ansi-styles@1.1.0, strip-ansi@2.0.0, pad-component@0.0.1, minimist@1.1.0, taketalk@0.1.1, word-wrap@0.1.3)
├── update-notifier@0.2.2 (is-npm@1.0.0, semver-diff@2.0.0, latest-version@1.0.0)
├── configstore@0.3.1 (object-assign@0.3.1, osenv@0.1.0, graceful-fs@3.0.3, uuid@1.4.2, mkdirp@0.5.0, js-yaml@3.0.2)
├── insight@0.4.3 (object-assign@1.0.0, tough-cookie@0.12.1, os-name@1.0.1, lodash.debounce@2.4.1, request@2.45.0, inquirer@0.6.0)
├── yeoman-generator@0.17.7 (dargs@2.0.3, diff@1.0.8, class-extend@0.1.1, rimraf@2.2.8, github-username@1.0.0, text-table@0.2.0, mime@1.2.11, isbinaryfile
p@0.5.0, cross-spawn@0.2.3, grouped-queue@0.3.0, run-async@0.1.0, iconv-lite@0.4.4, findup-sync@0.1.3, file-utils@0.2.1, cheerio@0.17.0, request@2.45.0, g
b@4.0.6, download@1.0.7, inquirer@0.7.3)
└── yeoman-environment@1.0.2 (log-symbols@1.0.1, diff@1.0.8, text-table@0.2.0, untildify@1.0.0, debug@2.0.0, grouped-queue@0.3.0, glob@4.0.6, inquirer@0.8

C:\Users\cem.topkaya>
Bu çıktılara en azından göz gezdirin ki, arkada neler döndüğünden azda olsa haberiniz olsun. Bakalım neler olmuş:

  • is-root paketi yüklenmiş(Check if the process is running as root user, eg. started with `sudo`)
  • sudo-block (Block users from running your app with root permissions)
  • shelljs(Portable Unix shell commands for Node.js)
  • chalk (Terminal string styling done right. Created because the `colors` module does some really horrible things.)
  • multiline(Multiline strings in JavaScript) çok iyi oldu bunu öğrendiğim
  • configstore (Easily load and save config without having to think about where and how)
  • insight (Understand how your tool is being used by anonymously reporting usage metrics to an analtyics vendor, e.g. Google Analytics.)
  • ve diğerleri...
Yo global olarak yüklendi:

Çalıştırabilmek için Evironment Variables içinde de tanımlanması gerekli:

İçerisinde HTML5 Boilerplate, jQuery, Modernizr, Bootstrap barındıran web uygulamalarını hızlıca oluşturmak için generator-webapp paketini yüklemeliyiz:
C:\Users\cem.topkaya\WebstormProjects\yodemo>npm install -g generator-webapp
generator-mocha@0.1.6 C:\Users\cem.topkaya\AppData\Roaming\npm\node_modules\generator-mocha
└── yeoman-generator@0.17.7 (dargs@2.0.3, diff@1.0.8, class-extend@0.1.1, rimraf@2.2.8, text-table@0.2.0, mime@1.2.11, async@0.9.0, isbinaryfile@2.0.1, shelljs@0.3.0, github-userna
me@1.0.0, debug@1.0.4, grouped-queue@0.3.0, nopt@3.0.1, cross-spawn@0.2.3, iconv-lite@0.4.4, mkdirp@0.5.0, chalk@0.5.1, run-async@0.1.0, underscore.string@2.3.3, findup-sync@0.1.3,
 glob@4.0.6, lodash@2.4.1, file-utils@0.2.1, request@2.45.0, cheerio@0.17.0, gruntfile-editor@0.2.0, download@1.0.7, inquirer@0.7.3)

generator-webapp@0.5.1 C:\Users\cem.topkaya\AppData\Roaming\npm\node_modules\generator-webapp
├── chalk@0.5.1 (escape-string-regexp@1.0.2, supports-color@0.2.0, ansi-styles@1.1.0, has-ansi@0.1.0, strip-ansi@0.3.0)
├── yosay@1.0.0 (ansi-regex@1.1.0, string-length@1.0.0, ansi-styles@1.1.0, strip-ansi@2.0.0, pad-component@0.0.1, word-wrap@0.1.3, minimist@1.1.0, taketalk@0.1.1)
├── cheerio@0.17.0 (entities@1.1.1, lodash@2.4.1, dom-serializer@0.0.1, CSSselect@0.4.1, htmlparser2@3.7.3)
└── yeoman-generator@0.17.7 (dargs@2.0.3, diff@1.0.8, class-extend@0.1.1, rimraf@2.2.8, text-table@0.2.0, github-username@1.0.0, mime@1.2.11, async@0.9.0, isbinaryfile@2.0.1, shell
js@0.3.0, mkdirp@0.5.0, iconv-lite@0.4.4, cross-spawn@0.2.3, underscore.string@2.3.3, lodash@2.4.1, debug@1.0.4, nopt@3.0.1, grouped-queue@0.3.0, run-async@0.1.0, findup-sync@0.1.3
, glob@4.0.6, file-utils@0.2.1, request@2.45.0, gruntfile-editor@0.2.0, download@1.0.7, inquirer@0.7.3)

C:\Users\cem.topkaya\WebstormProjects\yodemo>

Şimdi bir web app yaratalım:
C:\Users\cem.topkaya\WebstormProjects\yodemo>yo webapp
[?] ==========================================================================
We're constantly looking for ways to make yo better!
May we anonymously report usage statistics to improve the tool over time?
More info: https://github.com/yeoman/insight & http://yeoman.io
==========================================================================: Yes

     _-----_
    |       |    .--------------------------.
    |--(o)--|    |    Welcome to Yeoman,    |
   `---------´   |   ladies and gentlemen!  |
    ( _´U`_ )    '--------------------------'
    /___A___\
     |  ~  |
   __'.___.'__
 ´   `  |° ´ Y `

Out of the box I include HTML5 Boilerplate, jQuery, and a Gruntfile.js to build your app.
? What more would you like? Bootstrap, Sass, Modernizr
? Would you like to use libsass? Read up more at
https://github.com/andrew/node-sass#node-sass: Yes
   create Gruntfile.js
   create package.json
   create .gitignore
   create .gitattributes
   create .bowerrc
   create bower.json
   create .jshintrc
   create .editorconfig
   create app\styles\main.scss
   create app\favicon.ico
   create app\robots.txt
   create app\index.html
   create app\scripts\main.js
   invoke   mocha


I'm all done. Running bower install & npm install for you to install the required dependencies. If this fails, try running the command yourself.


'bower' is not recognized as an internal or external command,
operable program or batch file.
   create     test\bower.json
   create     test\.bowerrc
   create     test\spec\test.js
   create     test\index.html
'bower' is not recognized as an internal or external command,
operable program or batch file.
npm WARN package.json yodemo@ No description
npm WARN package.json yodemo@ No repository field.
npm WARN package.json yodemo@ No README data
|


> phantomjs@1.9.10 install C:\Users\cem.topkaya\WebstormProjects\yodemo\node_modules\grunt-mocha\node_modules\grunt-lib-phantomjs\node_modules\phantomjs
> node install.js

Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-windows.zip
Saving to C:\Users\CEM~1.TOP\AppData\Local\Temp\phantomjs\phantomjs-1.9.7-windows.zip
Receiving...
  [========================================] 99% 0.0s/
Received 6823K total.
Extracting zip contents
Copying extracted folder C:\Users\CEM~1.TOP\AppData\Local\Temp\phantomjs\phantomjs-1.9.7-windows.zip-extract-1413038201009\phantomjs-1.9.7-windows -> C:\Users\cem.topkaya\WebstormP
rojects\yodemo\node_modules\grunt-mocha\node_modules\grunt-lib-phantomjs\node_modules\phantomjs\lib\phantom
Writing location.js file
Done. Phantomjs binary available at C:\Users\cem.topkaya\WebstormProjects\yodemo\node_modules\grunt-mocha\node_modules\grunt-lib-phantomjs\node_modules\phantomjs\lib\phantom\phanto
mjs.exe
\


> pngquant-bin@1.0.1 postinstall C:\Users\cem.topkaya\WebstormProjects\yodemo\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\imagemin-pngquant\node_modules\
pngquant-bin
> node lib/install.js

  downloading : https://raw.github.com/imagemin/pngquant-bin/v1.0.1/vendor/win/pngquant.exe
     progress : [====================] 100% 0.0s
? pre-build test passed successfully!

> optipng-bin@1.0.1 postinstall C:\Users\cem.topkaya\WebstormProjects\yodemo\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\imagemin-optipng\node_modules\op
tipng-bin
> node lib/install.js

  downloading : https://raw.github.com/imagemin/optipng-bin/v1.0.1/vendor/win/optipng.exe
     progress : [====================] 100% 0.0s
? pre-build test passed successfully!

> jpegtran-bin@1.0.2 postinstall C:\Users\cem.topkaya\WebstormProjects\yodemo\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\imagemin-jpegtran\node_modules\
jpegtran-bin
> node lib/install.js

  downloading : https://raw.github.com/imagemin/jpegtran-bin/v1.0.2/vendor/win/x86/jpegtran.exe
     progress : [==                  ] 10% 0.0s  downloading : https://raw.github.com/imagemin/jpegtran-bin/v1.0.2/vendor/win/x86/libjpeg-62.dll
     progress : [====================] 100% 0.0s
     progress : [====================] 100% 0.0s
? pre-build test passed successfully!

> gifsicle@1.0.3 postinstall C:\Users\cem.topkaya\WebstormProjects\yodemo\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\imagemin-gifsicle\node_modules\gifs
icle
> node lib/install.js

  downloading : https://raw.github.com/imagemin/gifsicle-bin/v1.0.3/vendor/win/x86/gifsicle.exe
     progress : [====================] 100% 0.0s
? pre-build test passed successfully!

> node-sass@0.9.3 install C:\Users\cem.topkaya\WebstormProjects\yodemo\node_modules\grunt-sass\node_modules\node-sass
> node build.js

`win32-ia32-v8-3.14` exists; testing

  ........................

  24 passing (44ms)

Binary is fine; exiting
grunt-contrib-copy@0.5.0 node_modules\grunt-contrib-copy

apache-server-configs@2.8.0 node_modules\apache-server-configs

grunt-rev@0.1.0 node_modules\grunt-rev

grunt-contrib-clean@0.6.0 node_modules\grunt-contrib-clean
└── rimraf@2.2.8

grunt-newer@0.7.0 node_modules\grunt-newer
├── async@0.2.10
└── rimraf@2.2.6

grunt-usemin@2.4.0 node_modules\grunt-usemin
├── lodash@2.4.1
└── debug@1.0.4 (ms@0.6.2)

jshint-stylish@0.4.0 node_modules\jshint-stylish
├── log-symbols@1.0.1
├── text-table@0.2.0
└── chalk@0.5.1 (escape-string-regexp@1.0.2, ansi-styles@1.1.0, supports-color@0.2.0, has-ansi@0.1.0, strip-ansi@0.3.0)

grunt-concurrent@0.5.0 node_modules\grunt-concurrent
├── async@0.2.10
└── pad-stdio@0.1.1 (lpad@0.2.1)

load-grunt-tasks@0.4.0 node_modules\load-grunt-tasks
├── multimatch@0.1.0 (lodash@2.4.1, minimatch@0.2.14)
└── findup-sync@0.1.3 (lodash@2.4.1, glob@3.2.11)

grunt-contrib-concat@0.5.0 node_modules\grunt-contrib-concat
├── source-map@0.1.40 (amdefine@0.1.0)
└── chalk@0.5.1 (ansi-styles@1.1.0, supports-color@0.2.0, escape-string-regexp@1.0.2, strip-ansi@0.3.0, has-ansi@0.1.0)

time-grunt@0.4.0 node_modules\time-grunt
├── date-time@0.1.1
├── figures@1.3.3
├── text-table@0.2.0
├── hooker@0.2.3
├── pretty-ms@0.2.2 (parse-ms@0.1.2)
└── chalk@0.5.1 (escape-string-regexp@1.0.2, ansi-styles@1.1.0, supports-color@0.2.0, strip-ansi@0.3.0, has-ansi@0.1.0)

grunt-contrib-watch@0.6.1 node_modules\grunt-contrib-watch
├── async@0.2.10
├── lodash@2.4.1
├── tiny-lr-fork@0.0.5 (debug@0.7.4, faye-websocket@0.4.4, noptify@0.0.3, qs@0.5.6)
└── gaze@0.5.1 (globule@0.1.0)

grunt-contrib-htmlmin@0.3.0 node_modules\grunt-contrib-htmlmin
├── pretty-bytes@0.1.2
├── chalk@0.4.0 (ansi-styles@1.0.0, has-color@0.1.7, strip-ansi@0.1.1)
└── html-minifier@0.6.8 (relateurl@0.2.5, clean-css@2.2.16, change-case@2.1.5, cli@0.6.4, uglify-js@2.4.15)

grunt-contrib-connect@0.8.0 node_modules\grunt-contrib-connect
├── connect-livereload@0.4.0
├── open@0.0.5
├── async@0.9.0
├── portscanner@0.2.3 (async@0.1.15)
└── connect@2.19.6 (parseurl@1.0.1, escape-html@1.0.1, cookie@0.1.2, response-time@2.0.0, pause@0.0.1, cookie-signature@1.0.3, qs@0.6.6, vhost@1.0.0, bytes@1.0.0, fresh@0.2.2, basi
c-auth-connect@1.0.0, on-headers@0.0.0, serve-favicon@2.0.1, morgan@1.1.1, errorhandler@1.0.2, cookie-parser@1.1.0, debug@1.0.2, connect-timeout@1.1.0, body-parser@1.3.1, express-s
ession@1.2.1, method-override@2.0.2, type-is@1.2.1, compression@1.0.7, multiparty@3.2.8, csurf@1.2.1, serve-static@1.2.3, serve-index@1.1.1)

grunt-modernizr@0.5.2 node_modules\grunt-modernizr
├── colors@0.6.2
├── promised-io@0.3.4
├── uglify-js@1.3.3
└── request@2.27.0 (json-stringify-safe@5.0.0, aws-sign@0.3.0, qs@0.6.6, forever-agent@0.5.2, tunnel-agent@0.3.0, oauth-sign@0.3.0, cookie-jar@0.3.0, node-uuid@1.4.1, mime@1.2.11,
form-data@0.1.4, http-signature@0.10.0, hawk@1.0.0)

grunt-contrib-jshint@0.10.0 node_modules\grunt-contrib-jshint
├── hooker@0.2.3
└── jshint@2.5.6 (strip-json-comments@1.0.1, underscore@1.6.0, exit@0.1.2, minimatch@1.0.0, shelljs@0.3.0, console-browserify@1.1.0, cli@0.6.4, htmlparser2@3.7.3)

grunt-svgmin@0.4.0 node_modules\grunt-svgmin
├── each-async@0.1.3
├── pretty-bytes@0.1.2
├── chalk@0.4.0 (has-color@0.1.7, ansi-styles@1.0.0, strip-ansi@0.1.1)
└── svgo@0.4.5 (colors@0.6.2, whet.extend@0.9.9, coa@0.4.1, sax@0.6.0, js-yaml@2.1.3)

grunt-wiredep@1.9.0 node_modules\grunt-wiredep
└── wiredep@1.8.5 (propprop@0.3.0, minimist@1.1.0, chalk@0.5.1, through2@0.6.3, glob@4.0.6, lodash@2.4.1, bower-config@0.5.2)

grunt-mocha@0.4.11 node_modules\grunt-mocha
├── lodash@2.3.0
├── mocha@1.18.2 (diff@1.0.7, growl@1.7.0, commander@2.0.0, mkdirp@0.3.5, debug@2.0.0, glob@3.2.3, jade@0.26.3)
└── grunt-lib-phantomjs@0.4.0 (eventemitter2@0.4.14, semver@1.0.14, temporary@0.0.8, phantomjs@1.9.10)

grunt-contrib-uglify@0.5.1 node_modules\grunt-contrib-uglify
├── lodash@2.4.1
├── chalk@0.5.1 (escape-string-regexp@1.0.2, ansi-styles@1.1.0, supports-color@0.2.0, strip-ansi@0.3.0, has-ansi@0.1.0)
├── uglify-js@2.4.15 (uglify-to-browserify@1.0.2, async@0.2.10, source-map@0.1.34, optimist@0.3.7)
└── maxmin@0.2.2 (figures@1.3.3, pretty-bytes@0.1.2, gzip-size@0.2.0)

grunt-autoprefixer@1.0.1 node_modules\grunt-autoprefixer
├── diff@1.0.8
├── chalk@0.5.1 (escape-string-regexp@1.0.2, ansi-styles@1.1.0, supports-color@0.2.0, strip-ansi@0.3.0, has-ansi@0.1.0)
└── autoprefixer-core@3.1.1 (postcss@2.2.5, caniuse-db@1.0.20141008)

grunt-contrib-cssmin@0.10.0 node_modules\grunt-contrib-cssmin
├── chalk@0.4.0 (strip-ansi@0.1.1, has-color@0.1.7, ansi-styles@1.0.0)
├── clean-css@2.2.16 (commander@2.2.0)
└── maxmin@0.2.2 (pretty-bytes@0.1.2, figures@1.3.3, chalk@0.5.1, gzip-size@0.2.0)

grunt@0.4.5 node_modules\grunt
├── dateformat@1.0.2-1.2.3
├── which@1.0.5
├── eventemitter2@0.4.14
├── getobject@0.1.0
├── rimraf@2.2.8
├── colors@0.6.2
├── async@0.1.22
├── hooker@0.2.3
├── grunt-legacy-util@0.2.0
├── exit@0.1.2
├── lodash@0.9.2
├── minimatch@0.2.14 (sigmund@1.0.0, lru-cache@2.5.0)
├── coffee-script@1.3.3
├── underscore.string@2.2.1
├── nopt@1.0.10 (abbrev@1.0.5)
├── glob@3.1.21 (inherits@1.0.0, graceful-fs@1.2.3)
├── iconv-lite@0.2.11
├── findup-sync@0.1.3 (glob@3.2.11, lodash@2.4.1)
├── js-yaml@2.0.5 (esprima@1.0.4, argparse@0.1.15)
└── grunt-legacy-log@0.1.1 (underscore.string@2.3.3, lodash@2.4.1)

grunt-contrib-imagemin@0.8.1 node_modules\grunt-contrib-imagemin
├── async@0.9.0
├── pretty-bytes@1.0.1 (get-stdin@1.0.0)
├── chalk@0.5.1 (ansi-styles@1.1.0, supports-color@0.2.0, escape-string-regexp@1.0.2, strip-ansi@0.3.0, has-ansi@0.1.0)
└── imagemin@1.0.5 (get-stdin@3.0.0, stat-mode@0.2.0, ware@0.3.0, nopt@3.0.1, tempfile@1.1.0, fs-extra@0.11.1, imagemin-svgo@1.0.2, imagemin-pngquant@1.0.2, imagemin-optipng@1.0.0,
 imagemin-jpegtran@1.0.0, imagemin-gifsicle@1.0.0)

grunt-sass@0.14.2 node_modules\grunt-sass
├── object-assign@1.0.0
├── chalk@0.5.1 (escape-string-regexp@1.0.2, ansi-styles@1.1.0, supports-color@0.2.0, strip-ansi@0.3.0, has-ansi@0.1.0)
├── each-async@1.1.0 (onetime@1.0.0, setimmediate@1.0.2)
└── node-sass@0.9.3 (object-assign@0.3.1, node-watch@0.3.4, nan@1.0.0, mkdirp@0.3.5, chalk@0.4.0, shelljs@0.2.6, node-sass-middleware@0.2.0, optimist@0.6.1, mocha@1.18.2, sinon@1.9
.1)

C:\Users\cem.topkaya\WebstormProjects\yodemo>

Klasörde yapısı şöyle değişti:

Şimdi Angular yüklemek için önce yo muzu `npm install -g generator-angular` ile güncelleyelim:
C:\Users\cem.topkaya\WebstormProjects\yodemo>npm install -g generator-angular
generator-karma@0.8.3 C:\Users\cem.topkaya\AppData\Roaming\npm\node_modules\generator-karma
├── underscore@1.7.0
└── yeoman-generator@0.17.7 (dargs@2.0.3, diff@1.0.8, class-extend@0.1.1, rimraf@2.2.8, text-table@0.2.0, mime@1.2.11, async@0.9.0, isbinaryfile@2.0.1, shelljs@0.3.0, github-userna
me@1.0.0, iconv-lite@0.4.4, underscore.string@2.3.3, cross-spawn@0.2.3, lodash@2.4.1, debug@1.0.4, nopt@3.0.1, grouped-queue@0.3.0, mkdirp@0.5.0, run-async@0.1.0, chalk@0.5.1, find
up-sync@0.1.3, glob@4.0.6, file-utils@0.2.1, cheerio@0.17.0, request@2.45.0, gruntfile-editor@0.2.0, download@1.0.7, inquirer@0.7.3)

generator-angular@0.9.8 C:\Users\cem.topkaya\AppData\Roaming\npm\node_modules\generator-angular
├── chalk@0.4.0 (has-color@0.1.7, ansi-styles@1.0.0, strip-ansi@0.1.1)
├── yosay@0.2.1 (pad-component@0.0.1, word-wrap@0.1.3, minimist@0.0.9)
├── wiredep@1.8.5 (propprop@0.3.0, minimist@1.1.0, lodash@2.4.1, chalk@0.5.1, through2@0.6.3, glob@4.0.6, bower-config@0.5.2)
└── yeoman-generator@0.16.0 (dargs@0.1.0, diff@1.0.8, debug@0.7.4, class-extend@0.1.1, rimraf@2.2.8, findup-sync@0.1.3, text-table@0.2.0, async@0.2.10, mime@1.2.11, mkdirp@0.3.5, i
sbinaryfile@2.0.1, shelljs@0.2.6, glob@3.2.11, underscore.string@2.3.3, iconv-lite@0.2.11, lodash@2.4.1, file-utils@0.1.5, request@2.30.0, cheerio@0.13.1, inquirer@0.4.1, download@
0.1.19)

C:\Users\cem.topkaya\WebstormProjects\yodemo>

Şimdi angular projesi oluşturalım:
C:\Users\cem.topkaya\WebstormProjects\yoAngular>yo angular

     _-----_
    |       |    .--------------------------.
    |--(o)--|    |    Welcome to Yeoman,    |
   `---------´   |   ladies and gentlemen!  |
    ( _´U`_ )    '--------------------------'
    /___A___\
     |  ~  |
   __'.___.'__
 ´   `  |° ´ Y `

Out of the box I include Bootstrap and some AngularJS recommended modules.

? Would you like to use Sass (with Compass)? Yes
? Would you like to include Bootstrap? Yes
? Would you like to use the Sass version of Bootstrap? Yes
? Which modules would you like to include? angular-animate.js, angular-cookies.js, angular-resource.js, angular-route.js, angular-sanitize.js, angular-touch.js
   create app\styles\main.scss
   create app\index.html
   create bower.json
   create .bowerrc
   create package.json
   create Gruntfile.js
   invoke   angular:common:C:\Users\cem.topkaya\AppData\Roaming\npm\node_modules\generator-angular\app\index.js
   create     .editorconfig
   create     .gitattributes
   create     .jshintrc
   create     .gitignore
   create     test\.jshintrc
   create     app\.buildignore
   create     app\.htaccess
   create     app\404.html
   create     app\favicon.ico
   create     app\robots.txt
   create     app\views\main.html
   create     app\images\yeoman.png
   invoke   angular:main:C:\Users\cem.topkaya\AppData\Roaming\npm\node_modules\generator-angular\app\index.js
   create     app\scripts\app.js
   invoke   angular:controller:C:\Users\cem.topkaya\AppData\Roaming\npm\node_modules\generator-angular\app\index.js
   create     app\scripts\controllers\main.js
   create     test\spec\controllers\main.js
   invoke   karma:app


I'm all done. Running bower install & npm install for you to install the required dependencies. If this fails, try running the command yourself.


'bower' is not recognized as an internal or external command,
operable program or batch file.
   invoke       angular:route
   invoke           angular:controller:C:\Users\cem.topkaya\AppData\Roaming\npm\node_modules\generator-angular\route\index.js
   create             app\scripts\controllers\about.js

C:\Users\cem.topkaya\AppData\Roaming\npm\node_modules\generator-angular\node_modules\wiredep\lib\detect-dependencies.js:89
  if ($._.isString(componentConfigFile.main)) {
                                      ^
TypeError: Cannot read property 'main' of undefined
    at findMainFiles (C:\Users\cem.topkaya\AppData\Roaming\npm\node_modules\generator-angular\node_modules\wiredep\lib\detect-dependencies.js:89:39)
    at C:\Users\cem.topkaya\AppData\Roaming\npm\node_modules\generator-angular\node_modules\wiredep\lib\detect-dependencies.js:151:17
    at forOwn (C:\Users\cem.topkaya\AppData\Roaming\npm\node_modules\generator-angular\node_modules\wiredep\node_modules\lodash\dist\lodash.js:2105:15)
    at Function.forEach (C:\Users\cem.topkaya\AppData\Roaming\npm\node_modules\generator-angular\node_modules\wiredep\node_modules\lodash\dist\lodash.js:3302:9)
    at detectDependencies (C:\Users\cem.topkaya\AppData\Roaming\npm\node_modules\generator-angular\node_modules\wiredep\lib\detect-dependencies.js:33:7)
    at wiredep (C:\Users\cem.topkaya\AppData\Roaming\npm\node_modules\generator-angular\node_modules\wiredep\wiredep.js:65:39)
    at Generator._injectDependencies (C:\Users\cem.topkaya\AppData\Roaming\npm\node_modules\generator-angular\app\index.js:326:5)
    at C:\Users\cem.topkaya\AppData\Roaming\npm\node_modules\generator-angular\node_modules\yeoman-generator\node_modules\async\lib\async.js:232:13
    at C:\Users\cem.topkaya\AppData\Roaming\npm\node_modules\generator-angular\node_modules\yeoman-generator\node_modules\async\lib\async.js:113:21
    at C:\Users\cem.topkaya\AppData\Roaming\npm\node_modules\generator-angular\node_modules\yeoman-generator\node_modules\async\lib\async.js:24:16

C:\Users\cem.topkaya\WebstormProjects\yoAngular>npm WARN package.json yoangular@0.0.0 No description
npm WARN package.json yoangular@0.0.0 No repository field.
npm WARN package.json yoangular@0.0.0 No README data
|
> gifsicle@1.0.3 postinstall C:\Users\cem.topkaya\WebstormProjects\yoAngular\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\imagemin-gifsicle\node_modules\g
ifsicle
> node lib/install.js

  downloading : https://raw.github.com/imagemin/gifsicle-bin/v1.0.3/vendor/win/x86/gifsicle.exe
     progress : [====================] 100% 0.0s
? pre-build test passed successfully!

> optipng-bin@1.0.1 postinstall C:\Users\cem.topkaya\WebstormProjects\yoAngular\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\imagemin-optipng\node_modules
\optipng-bin
> node lib/install.js

  downloading : https://raw.github.com/imagemin/optipng-bin/v1.0.1/vendor/win/optipng.exe
     progress : [====================] 100% 0.0s
? pre-build test passed successfully!

> jpegtran-bin@1.0.2 postinstall C:\Users\cem.topkaya\WebstormProjects\yoAngular\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\imagemin-jpegtran\node_modul
es\jpegtran-bin
> node lib/install.js

  downloading : https://raw.github.com/imagemin/jpegtran-bin/v1.0.2/vendor/win/x86/jpegtran.exe
     progress : [============        ] 58% 0.2s  downloading : https://raw.github.com/imagemin/jpegtran-bin/v1.0.2/vendor/win/x86/libjpeg-62.dll
     progress : [====================] 100% 0.0s
     progress : [====================] 100% 0.0s
? pre-build test passed successfully!

> pngquant-bin@1.0.1 postinstall C:\Users\cem.topkaya\WebstormProjects\yoAngular\node_modules\grunt-contrib-imagemin\node_modules\imagemin\node_modules\imagemin-pngquant\node_modul
es\pngquant-bin
> node lib/install.js

  downloading : https://raw.github.com/imagemin/pngquant-bin/v1.0.1/vendor/win/pngquant.exe
     progress : [====================] 100% 0.0s
? pre-build test passed successfully!
grunt-contrib-copy@0.5.0 node_modules\grunt-contrib-copy

grunt-contrib-clean@0.5.0 node_modules\grunt-contrib-clean
└── rimraf@2.2.8

grunt-contrib-concat@0.4.0 node_modules\grunt-contrib-concat
└── chalk@0.4.0 (has-color@0.1.7, ansi-styles@1.0.0, strip-ansi@0.1.1)

grunt-filerev@0.2.1 node_modules\grunt-filerev
├── each-async@0.1.3
└── chalk@0.4.0 (has-color@0.1.7, ansi-styles@1.0.0, strip-ansi@0.1.1)

grunt-newer@0.7.0 node_modules\grunt-newer
├── rimraf@2.2.6
└── async@0.2.10

jshint-stylish@0.2.0 node_modules\jshint-stylish
├── text-table@0.2.0
└── chalk@0.4.0 (has-color@0.1.7, strip-ansi@0.1.1, ansi-styles@1.0.0)

time-grunt@0.3.2 node_modules\time-grunt
├── date-time@0.1.1
├── pretty-ms@0.1.0
├── text-table@0.2.0
├── hooker@0.2.3
└── chalk@0.4.0 (ansi-styles@1.0.0, strip-ansi@0.1.1, has-color@0.1.7)

grunt-usemin@2.4.0 node_modules\grunt-usemin
├── debug@1.0.4 (ms@0.6.2)
└── lodash@2.4.1

grunt-concurrent@0.5.0 node_modules\grunt-concurrent
├── pad-stdio@0.1.1 (lpad@0.2.1)
└── async@0.2.10

grunt-contrib-compass@0.7.2 node_modules\grunt-contrib-compass
├── dargs@0.1.0
├── tmp@0.0.23
└── async@0.2.10

grunt-contrib-uglify@0.4.1 node_modules\grunt-contrib-uglify
├── chalk@0.4.0 (has-color@0.1.7, ansi-styles@1.0.0, strip-ansi@0.1.1)
├── uglify-js@2.4.15 (uglify-to-browserify@1.0.2, async@0.2.10, optimist@0.3.7, source-map@0.1.34)
└── maxmin@0.1.0 (pretty-bytes@0.1.2, gzip-size@0.1.1)

grunt-contrib-cssmin@0.9.0 node_modules\grunt-contrib-cssmin
├── clean-css@2.1.8 (commander@2.1.0)
├── chalk@0.4.0 (has-color@0.1.7, ansi-styles@1.0.0, strip-ansi@0.1.1)
└── maxmin@0.1.0 (pretty-bytes@0.1.2, gzip-size@0.1.1)

grunt-contrib-htmlmin@0.3.0 node_modules\grunt-contrib-htmlmin
├── pretty-bytes@0.1.2
├── chalk@0.4.0 (strip-ansi@0.1.1, has-color@0.1.7, ansi-styles@1.0.0)
└── html-minifier@0.6.8 (change-case@2.1.5, relateurl@0.2.5, clean-css@2.2.16, cli@0.6.4, uglify-js@2.4.15)

grunt-ng-annotate@0.3.2 node_modules\grunt-ng-annotate
└── ng-annotate@0.9.11 (tryor@0.1.2, alter@0.2.0, simple-fmt@0.1.0, simple-is@0.2.0, stringset@0.2.1, stringmap@0.2.2, stable@0.1.5, convert-source-map@0.4.1, ordered-ast-traverse@
0.1.1, optimist@0.6.1, source-map@0.1.40, esprima@1.2.2)

grunt-contrib-jshint@0.10.0 node_modules\grunt-contrib-jshint
├── hooker@0.2.3
└── jshint@2.5.6 (strip-json-comments@1.0.1, underscore@1.6.0, exit@0.1.2, console-browserify@1.1.0, shelljs@0.3.0, minimatch@1.0.0, cli@0.6.4, htmlparser2@3.7.3)

grunt-svgmin@0.4.0 node_modules\grunt-svgmin
├── each-async@0.1.3
├── pretty-bytes@0.1.2
├── chalk@0.4.0 (ansi-styles@1.0.0, has-color@0.1.7, strip-ansi@0.1.1)
└── svgo@0.4.5 (colors@0.6.2, whet.extend@0.9.9, coa@0.4.1, sax@0.6.0, js-yaml@2.1.3)

grunt-wiredep@1.9.0 node_modules\grunt-wiredep
└── wiredep@1.8.5 (propprop@0.3.0, minimist@1.1.0, chalk@0.5.1, through2@0.6.3, glob@4.0.6, lodash@2.4.1, bower-config@0.5.2)

grunt-contrib-connect@0.7.1 node_modules\grunt-contrib-connect
├── connect-livereload@0.3.2
├── open@0.0.4
├── portscanner@0.2.2 (async@0.1.15)
├── async@0.2.10
└── connect@2.13.1 (uid2@0.0.3, methods@0.1.0, pause@0.0.1, debug@0.8.1, cookie-signature@1.0.1, qs@0.6.6, fresh@0.2.0, bytes@0.2.1, buffer-crc32@0.2.1, batch@0.5.0, raw-body@1.1.3
, cookie@0.1.0, compressible@1.0.0, negotiator@0.3.0, send@0.1.4, multiparty@2.2.0)

grunt-autoprefixer@0.7.6 node_modules\grunt-autoprefixer
├── diff@1.0.8
├── chalk@0.4.0 (ansi-styles@1.0.0, strip-ansi@0.1.1, has-color@0.1.7)
└── autoprefixer@1.3.1 (fs-extra@0.9.1, postcss@0.3.5, caniuse-db@1.0.20141008)

grunt-contrib-watch@0.6.1 node_modules\grunt-contrib-watch
├── async@0.2.10
├── tiny-lr-fork@0.0.5 (debug@0.7.4, faye-websocket@0.4.4, noptify@0.0.3, qs@0.5.6)
├── gaze@0.5.1 (globule@0.1.0)
└── lodash@2.4.1

load-grunt-tasks@0.4.0 node_modules\load-grunt-tasks
├── findup-sync@0.1.3 (glob@3.2.11, lodash@2.4.1)
└── multimatch@0.1.0 (minimatch@0.2.14, lodash@2.4.1)

grunt-google-cdn@0.4.3 node_modules\grunt-google-cdn
├── chalk@0.5.1 (escape-string-regexp@1.0.2, ansi-styles@1.1.0, supports-color@0.2.0, has-ansi@0.1.0, strip-ansi@0.3.0)
├── google-cdn@0.7.0 (regexp-quote@0.0.0, google-cdn-data@0.1.11, debug@1.0.4, async@0.9.0, semver@2.3.2, cdnjs-cdn-data@0.1.1)
└── bower@1.3.12 (is-root@1.0.0, junk@1.0.0, stringify-object@1.0.0, abbrev@1.0.5, chmodr@0.1.0, which@1.0.5, osenv@0.1.0, archy@0.0.2, opn@1.0.0, bower-logger@0.2.2, bower-endpoin
t-parser@0.2.2, lockfile@1.0.0, nopt@3.0.1, retry@0.6.0, rimraf@2.2.8, lru-cache@2.5.0, tmp@0.0.23, request-progress@0.3.0, q@1.0.1, shell-quote@1.4.2, chalk@0.5.0, semver@2.3.2, b
ower-json@0.4.0, promptly@0.2.0, p-throttler@0.1.0, fstream@1.0.2, mkdirp@0.5.0, fstream-ignore@1.0.1, bower-config@0.5.2, graceful-fs@3.0.3, decompress-zip@0.0.8, request@2.42.0,
bower-registry-client@0.2.1, tar-fs@0.5.2, cardinal@0.4.0, glob@4.0.6, mout@0.9.1, update-notifier@0.2.0, handlebars@2.0.0, inquirer@0.7.1, insight@0.4.3)

grunt@0.4.5 node_modules\grunt
├── dateformat@1.0.2-1.2.3
├── which@1.0.5
├── eventemitter2@0.4.14
├── getobject@0.1.0
├── colors@0.6.2
├── rimraf@2.2.8
├── async@0.1.22
├── grunt-legacy-util@0.2.0
├── hooker@0.2.3
├── exit@0.1.2
├── nopt@1.0.10 (abbrev@1.0.5)
├── lodash@0.9.2
├── minimatch@0.2.14 (sigmund@1.0.0, lru-cache@2.5.0)
├── glob@3.1.21 (inherits@1.0.0, graceful-fs@1.2.3)
├── coffee-script@1.3.3
├── underscore.string@2.2.1
├── iconv-lite@0.2.11
├── grunt-legacy-log@0.1.1 (underscore.string@2.3.3, lodash@2.4.1)
├── js-yaml@2.0.5 (esprima@1.0.4, argparse@0.1.15)
└── findup-sync@0.1.3 (glob@3.2.11, lodash@2.4.1)

grunt-contrib-imagemin@0.8.1 node_modules\grunt-contrib-imagemin
├── async@0.9.0
├── pretty-bytes@1.0.1 (get-stdin@1.0.0)
├── chalk@0.5.1 (escape-string-regexp@1.0.2, ansi-styles@1.1.0, supports-color@0.2.0, has-ansi@0.1.0, strip-ansi@0.3.0)
└── imagemin@1.0.5 (get-stdin@3.0.0, stat-mode@0.2.0, ware@0.3.0, nopt@3.0.1, tempfile@1.1.0, fs-extra@0.11.1, imagemin-svgo@1.0.2, imagemin-gifsicle@1.0.0, imagemin-optipng@1.0.0,
 imagemin-jpegtran@1.0.0, imagemin-pngquant@1.0.2)

C:\Users\cem.topkaya\WebstormProjects\yoAngular>

Grunt içeriği:
Plugin Description
contrib-jshint Validate files using jshint
contrib-uglify Minify JS files using UglifyJS
contrib-watch Run tasks whenever watched files are changed
contrib-clean Clean up files and folders
contrib-copy Copy files and folders
contrib-concat Combine files into a single file
contrib-cssmin Compress CSS files
contrib-less Compile LESS files to CSS
contrib-imagemin Minify PNG, JPG, and GIFs
contrib-compass Compile SASS to CSS using Compass
contrib-htmlmin Minify HTML files

9 Eylül 2014 Salı

Powershell ile dosya kopyalama

Niyetim SAP nin xml olarak attığı uzak sunucu dosyalarını iis sunucusuna almak
Powershell dosyası şöyle:

$source =  "C:\Temp\"
$dest = "C:\Temp\Dest\"
$kopyalanacakDosyalar = "*.xml"

Write-Host  "Kaynak Dizin => " $source
Write-Host  "Hedef Dizin => " $dest
Write-Host  "Kopyalanacak Dosyalar => " $kopyalanacakDosyalar

$TestPath = Test-Path $dest
IF (!$TestPath) {
 
 Write-Host "Hedef dizin mevcut degil"
 Copy-Item $source $dest -Verbose
 PC1 - no file found. Copying

} ELSE {

 Write-Host "Hedef mevcut dosyalar taranarak hedefte olmayan kopyalanacak"
 
 $files = (Get-ChildItem $source -recurse -filter $kopyalanacakDosyalar | where-object {-not ($_.PSIsContainer) -AND $_.lastwritetime -gt (get-date).addminutes(-10)});
 
 $files|foreach($_){
  if (!([system.io.file]::Exists($dest+$_.name))){
            cp $_.Fullname ($dest+$_.name)
  };
 }
}

25 Haziran 2014 Çarşamba

NodeJs Çalışmalarım

Önce Visual Studio ile debug yapabileceğimiz Node Tools for Visual Studio 1.0 Alpha videosunu izleyip ilgili eklentiyi indirip kuralım. Hızlıca nasıl kullanıdığına dair bilgiyi edinmek için burasını biraz okuyalım.

Geliştiriciler için doğru Chrome sürümünü de buradan indirelim.


my_module.js
// Sadece içeride kullanılır. Dışarıdan erişilemez!
function private_Hello() {
    return "World";
}

// İhraç edilecek func, içeride private metodu çağırır
function public_Hello() {
    return private_Hello();
}

// public_Hello func dışarıdan Hello ile çağrılabilir
module.exports.Hello = public_Hello;

server.js
var mymodule = require("./my_module.js");
console.log("Hello: " + mymodule.Hello());

REQUEST


GetIp_req.js
// http://nodejs.org/api/http.html#http_http_request_options_callback
var http = require('http');

function getIp(prm1, prm2, doneCallback) {
    var funcParams = [prm1, prm2];

    var options = {
        host: 'ip.jsontest.com',
        //host: 'www.google.com',
        path: '/',
        //path: '/',
        method: 'GET'
    };

    var req = http.request(options, function (res) {
        // Response içindeki STATUS ve HEADER bilgilerini görelim
        console.log('STATUS: ' + res.statusCode);
        console.log('HEADERS: ' + JSON.stringify(res.headers));

        // Tüm cevabı tutacağımız değişken
        var body = '';
        // Gelen veri akışı UTF8 türünden olacağı için başta sabitleyelim
        res.setEncoding('utf8');

        // Her parça veri geldiğinde
        res.on('data', function (chunk) {
            console.log('\n*** YENİ CHUNK veri geldi ****');
            console.log(chunk.toString());
            body += chunk.toString();
        });

        res.on('end', function () {
            console.log('\n*** Tüm veri akışı tamamlandı ****');
            console.log('GELEN VERİ: ' + body);

            // Bilgiyi isteyenin fonksiyonuna geçirelim
            doneCallback(JSON.parse(body));
        });
    });

    req.on('error', function (e) {
        console.log('problem oluştu: ' + e.message);
    });

    req.end();
}

module.exports.GetIp = getIp;

server.js
var getIp = require("./GetIp_req.js");
getIp.GetIp('parametre1', 'param2', function (ip) {
    console.log('Çıkış IP Adresim: ' + ip.ip);
});


Express içinde 4 versiyonuyla birlikte çıkartılanlar:
  1. app.configure()
  2. app.router
  3. express.createServer()
  4. res.charset

Node.Js ile API

Ben yazmaya başladım ama bir baktım pırlanta gibi anlatmış bu arkadaş.
Burada gördüğüm POSTMAN için chrome uzantısını bulunca sizinle paylaşayım dedim.


18 Haziran 2014 Çarşamba

USB Klavye çalışmadı gitti

Özetle Windows/inf klasöründe usb.inf ve usb.PNF dosyaları yerindemi diye bakın ve yoksa bir yerlerden bulup yapıştırın.

Sorunumu aşağıdaki cevap çözdü:
Had the same issue with my keyboard. Keyboards worked fine in BIOS and boot menu, until the windows logon screen appeared.
Windows didn't load a driver, and yellow marks in in device manager no matter what keyboard I connected.
The usb.inf and usb.PNF files were somehow missing from my Windows/inf folder. I restored these from the installation media, and TADA... - it now works again.