Saturday, September 12, 2015

debian jessie php problem

after I install php apache and stuff I start controlling. and one php page was not working but wordpress was working after a small search I found in jessie short_open_tag is actually off. so what you should need to do is find php.ini related and change it to short_open_tag = On if you are using fpm dont forget to restart your php fpm with this command /etc/init.d/php5-fpm restart or service php5-fpm restart

Thursday, September 10, 2015

wifi hack

I dont hack normally but since I moved to abroad and I needed internet connection. and I finish my data in my sim line. anyway it took around 4 hours.

step 1
airmon-ng start wlan0
step2
airodump-ng mon0

wait a while around 5 or 10 minutes is enough then you will see a lot of adresses on screen. then choose the strong one and give that to this command

reaver -i mon0 -b 7C:D1:C3:CA:47:1A

thean this reaver starts brute forcing and found a password. since then I am using it. dont worry I will buy my adsl line soon :)

Saturday, September 05, 2015

weblogic 12 to 11 ejb connection problem

if you have wl11 ejb server and in that environment generated ejb client and deploy to wl12 it will give you this exception

java.lang.NoSuchMethodError: weblogic.rmi.internal.MethodDescriptor.(Ljava/lang/reflect/Method;Ljava/lang/Class;ZZZZII)V

so there are some solutions like this. but what I did was different. I deleted *******_WLStub.class from client jar and deployed the ear that way so at the end wl12 generates it on the fly just like jsp first compilation. and it works.

Saturday, August 22, 2015

xubuntu eclipse mars 4.5 look fix

I just download and start using eclipse under latest xubuntu. but look was awfull especially tabs and toolbars. and it was effecting some windows not to show textboxes.

looks like this



after a small research I fould the solution. its very easy just put this line into your bashrc file

export SWT_GTK3=0

or before starting eclipse give this command. here is the result




Sunday, June 28, 2015

bootstrap mobile horizontal overflow problem

I have been using bootstrap for a while now. its really nice to have this kind of a tool for mobile ready and have responsive design. it means you can write your html one time and it will work on all platforms. you dont need to write for mobile and desktop different. anyway after I write some site in bootstrap I had a small overflow problem. the site has horizontal scroll when its loaded in my smartphone.

it is a normal bootstrap html site having simple div rows and some links in it. having the row oversizing the container was frustrating. because I did not have any special html tricks or etc.

after some research I found the answer is about css.

this site explains a little https://css-tricks.com/findingfixing-unintended-body-overflow/

solution is the use offcanvas.css. just adding css solved my problem. you can find it here

http://getbootstrap.com/examples/offcanvas/offcanvas.css



Tuesday, May 26, 2015

google universal analytics kodu ile subdomain takibi

google analytics sitenizin trafiğini takip etmenizi sağlayan bir araçtır. GA ya üye olup js kodunu sitenize eklemeniz yeterlidir sonrasında günlük sayfa gösterim veya tekil ziyaretçileri izlemeye başlayabilirsiniz.

benim bu işlemi bir subdomain de yapmam gerekti. en son google mobil siteleriniz olması lazım diye bir duyuruda bulundu ve geçen ay konuyla ilgili arama algoritmasını yayına aldı. o sebeple eldeki sitelerin mobil versiyonlarını yazıp GA ile takip etmeye devam etmek istedim.

GA ya login olduktan sonra yukardan Admin linkine tıklanır View bölümünde imajda göründüğü gibi "create new view" a tıklanır ve mobil kodumuzu yerleştirdiğimiz site için yeni bir view oluşturulur.

google analytics create view

ben daha evel oluşturduğum için yukarda mobili görüyorsunuz. daha sonra bir isim verip yeni view ı oluşturursunuz. sonraki adımda filters. yine yukardaki arayüzde view ın altında görünen filters a tıklanır.



çıkan sayfada new filter a tıklanır. sonra filtera bir isim verilir. özellikler kısmındada hostname in geçtiği seçilir ve mobil siteniz için uygun hostname yazılır ve kaydet e basılır.

eski trafikleri burada göremezsiniz. yani bu filtreyi oluşturmadan önceki trafiği bu view da göremeyeceksiniz. o sebeple mobil trafiği izlemek için bu filter ı hemen oluşturmanızda fayda var.


Thursday, April 09, 2015

xrebel ve jrebel kullanılmalı

yaklaşık 10 senedir profosyonel java geliştiriyorum. ve evet java ortamları insanı sıkacak kadar yavaş olabiliyor. kodu yazıp denemesi en az 30 saniye. hadi profile edim dersen en az 5dk harcanıyor. bunları hızlandırmak mümkün. uzun süredir jrebel social kullanıyorum. kendisi şuradan edinilebilir

https://my.jrebel.com/

gelelim xrebel e. xrebel bir profiling ürünü ve önyüzde  sonuç veriyor. kısa tanıtım filmi şöyle



türkçe anlatmak gerekirse jar ı indirip javaagent parametresiyle jvm e vermeniz yeterli sonra önyüzde kaç saniye nerede geçirdiğini ekrandan görebiliyorsunuz. umarım bunuda social falan yaparlar çok sevdim tool u blog yazdırdı bana :)

Thursday, April 02, 2015

how to export twitters following list

well at some point you may need to have all following list which you have in your twitter account. I tried some websites and twitter api but coult not find a way. at the end I take it with javascript :)

go to this adres and go to end of the page.

https://twitter.com/following

it looks like this in my account


after that open the chrome javascript console. I do it with F12. then I needed to have all twitter account names. here is the javascript I used for it.

var arr = [];
$(".u-linkComplex-target").each(function(index, elem){
    arr.push($(this).text());
});
arr.join(',');

you just need to paste this in the console and hit enter. then in the console you will have very long string like this

akkiocal,superonlinetr,odersky,javanetbuzz,dayioglu,corpuscallosum,

and my screen look like this


you can select very long string from there and save it anywahere you like enjoy :)

by the way in the future if script does not work feel free to ask me via comments. because they can change the class of that html tag.

Friday, February 20, 2015

başarılı compile dan sonra deploy

bir süredir jenkins ile prod ortama deploylar yapıyorum. manual olarak çalıştırdığımda sorunsuz çalışan bash scriptlerim. jenkins tarafından başlatılınca bir yerde kesiliyordu. bunu önlemek için jenkinse e şu parametre veriliyor

-Dhudson.util.ProcessTree.disable=true

debianda /etc/default/jenkins altında bunu set edebilirsiniz veya manual çalıştırıyorsanız çalıştırılan satıra bu değişkeni eklemeniz yeterli. bu yöntem biraz eski versiyonlar için geçerli.

son versiyonlarda yapılması gereken. start.sh dosyanız a BUILD_ID=dontKillMe eklemeniz gerek. örnek dosya

#!/bin/bash
set -x
processname=PROSES
BUILD_ID=dontKillMe
set +e
cd /projectpath/
ps -ef | grep $processname | grep -v grep | awk '{print $2}'|xargs kill -9
nohup mvn -Dsite=$processname clean jetty:run  > site.log &
exit 0



konunun detayı şu adresde mevcut
https://wiki.jenkins-ci.org/display/JENKINS/ProcessTreeKiller

Sunday, February 08, 2015

apache rewrite testi

apache htaccess veya httpd confa yazdığımız rewrite ları test etmek zordur. browser ın cache indemi kaldı. loadbalancer danmı döndü anlamak için ctrl f5 lere basılı tutulur incognito ile denenir. ama curl varken bunlara gerek yok.

ben user agent a göre bir rewrite yazmıştım. mobile redirect işlemi için. curl ilede şöyle test ettim

curl -A "curl" --head --header "Host: domain.com" http://127.0.0.1/

bu komutta A parametresinin arkasından user agent geliyor. ve apache de 127.0.0.1 de çalıştığı için oraya domain.com u istiyorum. gördüğüm sonuç şöyle

HTTP/1.1 200 OK
Date: Sun, 08 Feb 2015 09:45:21 GMT
Server: mascix
Cache-Control: max-age=0, no-cache, proxy-revalidate
Vary: Accept-Encoding
Content-Type: text/html; charset=utf-8

buda zaten istediğim gibi curl user agent ı zaten ilgi alanıma girmediği için redirect etmiyor. ama mobil bir user agent ile istek yapılırsa nolur.

curl -A "MOBILE" --head --header "Host: ipmap.info" http://127.0.0.1/

dönen cevap şöyle:

HTTP/1.1 301 Moved Permanently
Date: Sun, 08 Feb 2015 09:49:06 GMT
Server: mascix
Location: http://m.domain.com/
Cache-Control: max-age=900
Expires: Sun, 08 Feb 2015 10:04:06 GMT
Vary: Accept-Encoding
Content-Type: text/html; charset=iso-8859-1

yani server 301 redirect verdi ve m.domain.com a gitmem gerektiğini söyledi. bu sayede redirectin düzgün çalıştığını test etmiş oldum.

odd string diff

 https://leetcode.com/problems/odd-string-difference/ Beats 19.92% of users with Java   class Solution { public String oddString ( S...