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!

14 Aralık 2016 Çarşamba

Ubuntu server prevent serving .git directory

Add the followings into /etc/apache2/apache2.conf file

<Directorymatch "^/.*/\.git/"> 
Order deny,allow 
Deny from all
</Directorymatch>