26 Ekim 2017 Perşembe

Linux üzerinde postgresql 9.5 -> 9.6 güncellemesi

Adım 1
Postgresql uzak reposunu list dosyamıza ekliyoruz. 
sudo echo 'deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main' > /etc/apt/sources.list.d/pgdg.list

Eğer /etc/apt/sources.list.d/ dizini altında pgdg.list yok ise touch komutu ile oluşturup içine  deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main ekleyip de işlemimize devam edebiliriz.

Adım 2 
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
ile keyi alıyoruz.

Adım 3
sudo apt update ile güncelleme yapıp 
sudo aptitude install postgresql-9.6 postgresql-client-9.6 postgresql-contrib-9.6
komutu ile postgresql 9.6 versiyonunu kuruyoruz.

Adım 4
pg_lsclusters komutu ile sunucuya gelen clusterları listeliyoruz. Burda 9.6 main cluster gelmiş olmalı. Eğer gelmemiş ise kurulumda bir hata almış ya da eksik bir işlem yapmış olabilirsiniz. 

Adım 5
Sırasıyla aşağıdaki komutları uygulayarak güncelleme işlemini tamamlayabilirsiniz.

sudo pg_dropcluster 9.6 main --stop
sudo pg_upgradecluster 9.5 main
sudo pg_dropcluster 9.5 main

Bu işlem sırasında 9.5 cluster upgrade edilemez ise postgresql 9.6 yı tekrar kurup deneyebilirsiniz.

25 Ekim 2017 Çarşamba

Pardus 17 wine32 sorunu ve çözümü

Pardus 17 üzerinde wine paketini kurduğunuzda otomatik olarak wine64 kurulmakta. Bazı programları çalıştırırken wine32 istemekte. Bunun için aşağıdaki komutlar sorunu çözecektir.

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install wine wine32:i386

19 Ekim 2017 Perşembe

How to flush / clean DNS in ubuntu?

DNS servers convert a domain name (such as example.com) into an IP address (in this case 123.123.123.123). The mapping of names to numbers can change from time to time. Your computer holds a record of DNS entries to save looking them up every time. This is your DNS cache. You can delete those records (flush the cache) any time you like. If a website has recently moved servers, you might see the old website for a while. Flushing your DNS cache might help.

Run these commands to flush your dns cache:

  • sudo /etc/init.d/dns-clean restart
  • sudo /etc/init.d/networking force-reload
  • sudo /etc/init.d/nscd restart
  • sudo service network-manager restart

10 Mart 2017 Cuma

php file_get_contents türkçe karakter çözümü

Aşağıdaki fonksiyon php ile herhangi bir sayfanın verilerini çekerken ya da mevcut text üzerinde çalışırken aldğınız türkçe karakter hatalarını gidererek yeni bir çıktı verir.

function file_get_contents_utf8($fn) {
 $content = file_get_contents($fn);
 return mb_convert_encoding($content, 'UTF-8', mb_detect_encoding($content, 'UTF-8, ISO-8859-9', true));
}

11 Ocak 2017 Çarşamba

How to convert djvu files to pdf on Ubuntu ?

We need "ddjvu" command to convert the files. The following command converts your djvu files into pdf quickly:
ddjvu -format=pdf -quality=80 file.djvu output.pdf
 If you want to see the flow, you can add "-verbose" to end of the above code.

Enjoy!