Blog | Emin Mastizadahttps://mastizada.com/blog/2024-03-29T07:53:20.001435+00:00BlogDisable Touchscreen in Gnu/Linux2018-10-19T09:49:31+00:002024-03-29T05:28:47.397757+00:00Emin Mastizadahttps://mastizada.com/blog/author/mastizada/https://mastizada.com/blog/disable-touchscreen-in-gnulinux/<p>Some of new laptops have touchscreen functionality. It is fancy, but practically it is useless. Mostly, you touch it by mistake and it uses some battery.</p>
<p>Recently I cracked my laptop's screen, it is a small crack that doesn't distract me but somehow it is making some random touches. I was searching for ways to disable touchscreen and most of them wasn't working and touchscreen was enabled again after reboot or sleep.</p>
<p>You can temporarily disable your touchscreen (or any other input device) using <code>xinput</code> tool. Use <code>xinput --list</code> to get the list of your input devices and use their id to disable any of them: <code>xinput disable <id number></code>.</p>
<p>I added this command to the autostart to disable at boot:</p>
<p><code>xinput --list | awk '/Atmel Atmel maXTouch Digitizer/ {print $7}' | awk '{split($0,a,"="); print a[2]}' | xargs xinput disable</code></p>
<p>It works fine, it finds the id number of the touchscreen device (it can change at boot) using its name (Atmel Atmel maXTouch Digitizer - from xinput list) and disables it. The only problem is that, touchscreen becomes enabled again after sleep. Also, for some unknown reason, it is not working at every reboot.</p>
<p>There is also another way, disable the module for the touchscreen device, but I hate that way as missing modules are annoying.</p>
<h2>X11:</h2>
<p>My final solution that worked well was to create a configuration file in X11 and add a general touchscreen disabling setting to it. For example, I have created <code>/etc/X11/xorg.conf.d/94-no-touchscreen.conf</code> file and added this content to it:</p>
<p><code>Section "InputClass"</code><br/><code> Identifier "Touchscreen catchall"</code><br/><code> MatchIsTouchscreen "on"</code><br/><code> Option "Ignore" "on"</code><br/><code>EndSection</code></p>
<p>That works both on reboots and on waking from the sleep mode.</p>
<h2>Wayland:</h2>
<p>Find vendor and product id of the device using <code>cat /proc/bus/input/devices</code> - In the output try to find your touchscreen device and use its <code>Vendor=<VendorID> Product=<ProductID></code> value to create an <code>udev</code> rule. Create a file <code>/etc/udev/rules.d/94-no-touchscreen.conf</code> with the following content (replace <code>VendorID</code> and <code>ProductID</code> with according values):</p>
<p><code>SUBSYSTEM=="usb", ATTRS{idVendor}=="VendorID", ATTRS{idProduct}=="ProductID", ATTR{authorized}="0"</code></p>
<p><em>Note: To find more about your touchscreen device, you can use <code>udevadm</code> tool. Sysfs flag of input devices (after vendor & product id and name lines) will give a hint about the path of the device, use <code>udevadm info /<path under the /dev</code> to get detailed information for that device.</em></p>
<p>You can restart after that or reload rules: <code>udevadm control --reload-rules && udevadm trigger</code></p>
<p></p>
<h3>Sources:</h3>
<p>1. <a href="http://web.archive.org/web/20200930025850/https://askubuntu.com/questions/927022/how-can-i-disable-touchscreen-while-using-wayland/1011125#1011125" target="_blank">Answer by Dmitry in stackoverflow.</a></p>#movingtogitlab2018-06-05T11:39:51+00:002024-03-29T07:14:55.879931+00:00Emin Mastizadahttps://mastizada.com/blog/author/mastizada/https://mastizada.com/blog/movingtogitlab/<p>When you talk about open source, first thing that comes to mind is probably Github. It is an awesome "social network" for developers and hosts lots of projects. Also it makes working on team or open source projects a lot easier and have awesome integrations (Travis, Coveralls and so on). Github also provides service for open source for free and it is a rare case nowadays that a free service doesn't make you it's product.</p>
<p>But Github also a closed source by itself and making open source projects to <strong>depend</strong> on closed source platform isn't a good idea and never was. Free software supporters used it anyway as it was independent and had user's trust.</p>
<p>Github was losing money and needed to find a way to increase it's profit. After all, it is a for-profit company and it's investors needs money. Giving too much power to such platforms always ends badly as needs for profit puts community needs behind. More on that is stated in this article: <a href="https://www.wired.com/2015/06/problem-putting-worlds-code-github/" target="_blank" title="Wired: The Problem With Putting All the World's Code in GitHub">Wired article</a></p>
<p>Another alternate to Github is <a href="https://bitbucket.org/" target="_blank" title="Bitbucket website">Bitbucket</a>, <span style="text-decoration: underline;">owned</span> by Atlassian. It provides free private repositories with limited number of members for personal use. It is more like cheaper version of Github for enterprise use and has better integration with Atlassian products like Jira.</p>
<p>Gogs, Gitea, Gitlab CE and other self-hosted solutions - For private usage, you can just use git itself without fancy UI. These solutions are good for projects developed by multiple groups and community. However, to make contribution to your project others will need to register on your system, configure their profiles and get used to you UI and issue management. It is much better than using maillists or FTP but not great. The main point behind Github is the social part. You use it for your personal projects, for work related projects and at the same time you can contribute to other projects using the same network. That attracts a lot of people to the project and that is the main reason for many free and open source projects to choose Github, Bitbucket or Gitlab.</p>
<p>Gitlab uses open source business model and offers Community Edition (MIT License) which you can host by yourself and has most of the key features of Gitlab. So even if it makes mistakes in future, community can easily fork it and continue development - making it future-proof. It is also a social coding platform like Github and more projects are starting to use it. It also offers unlimited private repositories both for personal and for enterprise use, it has own Continuous Integration & Deployment (CI) free to use. Another great news, they are going to implement federated merge requests (pull requests) such that, you can use both private hosted version and centrialized ones and send merge requests (Github's Pull Requests) to projects using both versions - Gnome uses gitlab.gnome.org and this feature will allow you to make contribution to Gnome projects directly from Gitlab.com or other networks using Gitlab. You can check some awesome features at <a href="https://about.gitlab.com/pricing/self-hosted/feature-comparison/" title="this page">this page</a>.</p>
<p></p>
<h2>Why moving now?</h2>
<p>As you already know, Microsoft bought (agreed?) to buy Github for $7.5 billion. Well, that is good for Github as they will pay their investors and they will have resources for the future. Also Microsoft makes a lot of contributions to open source projects since Satya Nadella became CEO and they are supporting free software events. More contributors, more free and open source projects are better for the community and we like it. But recovering trust takes more time specially for a company that was so evil agains open source in the past, it's <a href="https://en.wikipedia.org/wiki/Embrace,_extend,_and_extinguish" target="_blank" title="Wikipedia article Embrace, extend, and extinguish">Embrace, extend, and extinguish</a> and even has problems nowadays: <a href="https://www.infoworld.com/article/3137496/open-source-tools/no-microsoft-does-not-love-open-source.html" target="_blank" title="No, Microsoft does not love open source article">No, Microsoft does not love open source</a>. May be one day they will gain trust but it is too soon.</p>
<p>Will Microsoft improve Github and leave it independent after spending so much money and more later (Github's infrastructure requires a lot of money and paid users do not cover it yet) or will it end like Skype, Nokia and many other projects? Maybe more limitations for free users, requiring MS Live account, exclusive functionalities for their Azure platform and their Visual Studio Code and so on. We will see later, but that is not point and it shouldn't be reason to leave the platform. Microsoft buying Github reminds us base problem with Github - being closed source, for-profit and hosting most of the major free and open source projects. That gives huge powers to Microsoft over free software projects and it is completely wrong - They can use it to eliminate alternates by providing locking features that only can be used in Github, which is stated well in "<a href="https://en.wikipedia.org/wiki/Embrace,_extend,_and_extinguish" target="_blank" title="Wikipedia article Embrace, extend, and extinguish">Embrace, extend, and extinguish</a>" article. A major corporation like Microsoft, Google, Facebook or Apple should not have such power. Using Github for such projects already was a mistake and continuing to use is worse.</p>
<p>For that reason I already started to move our Free Software Community in university to Gitlab (community exposes a sample behaviour for new members) and other open source projects that I'm maintaining. Also moved private repositories from Github and Bitbucket to avoid usage of multiple networks. Of course it is not the end for Github and most will continue to use it for some other projects (just like #DeleteFacebook, it is a social network and won't die unless most of it's users related to you leaves to the same platform as you) if Microsoft will not ruin it. Gitlab seems the safest "social" solution for now.</p>
<p>Additional reading: <a href="https://devrant.com/rants/1459012/ok-now-there-is-quite-big-movement-from-github-to-gitlab-https-bit-ly-2xjwgds-it" target="_blank" title="article about moving from Github to Gitlab by amatrelan">Ok, now there is quite big movement from GitHub to GitLab</a></p>Flask on Apache with mod_wsgi2018-05-23T20:46:48+00:002024-03-28T11:10:55.391729+00:00Emin Mastizadahttps://mastizada.com/blog/author/mastizada/https://mastizada.com/blog/flask-on-apache-with-mod_wsgi/<p>Nowadays making a proxy from an nginx to a gunicorn socket running on supervisor or systemd makes things so easier that most of us even forgot how deployment was before. Recently I was asked to deploy a flask application on already working Apache2 instance. In this blog post I will describe steps and problems using mod_wsgi on Apache.</p>
<p>First of all, install python, pip and mod_wsgi: <code>apt install python3-dev python3-pip libapache2-mod-wsgi</code></p>
<p>Restart <code>apache2</code> service and verify that wsgi module is loaded: <code>sudo apache2ctl -M|grep -i wsgi</code></p>
<p>Create a <code>projectname.wsgi</code> file in your project:</p>
<pre>import sys<br/>sys.path.insert(0, '/path/to/project')<br/><br/>from app import app as application<br/>application.root_path = '/path/to/project'</pre>
<p>The first thing will add your python files to the python path, that is needed to find the app.py file (where your flask app is located). The second part will tell the application where the root is, it is required for loading templates.</p>
<p>Create a configuration file (<code>projectname.conf</code> - .conf extension is required for the new version of Apache) for your project under <code>/etc/apache2/sites-available</code>:</p>
<pre><VirtualHost *:<PORT>><br/> ServerName <DOMAIN.NAME><br/> WSGIDaemonProcess <projectname> user=<user> group=www-data threads=2<br/> WSGIScriptAlias / /path/to/project/projectname.wsgi<br/> <Directory /path/to/project><br/> WSGIProcessGroup <projectname><br/> WSGIApplicationGroup %{GLOBAL}<br/> Order deny,allow<br/> Allow from all<br/> </Directory><br/> Alias "/static/" "/path/to/project/static/"<br/> <Directory /path/to/project/static/><br/> Order allow,deny<br/> Allow from all<br/> </Directory><br/> ErrorLog /path/to/logs/error.log<br/> CustomLog /path/to/logs/access.log combined<br/></VirtualHost></pre>
<p>Link the configuration file to the enabled folder:</p>
<p><code>cd ../sites-enabled</code> & <code>ln -s ../sites-available/projectname.conf projectname.conf</code>.</p>
<p>Reload apache2 service and check if the website is online.</p>
<p>Most notable difference between gunicorn is that you will not be able to open files from the relative path. You can use <code>current_app.root_path</code> to access path and it is true for all plugins too (in my case, one of the plugins was storing a session file in the project root). Also defining <code>PROJECT_ROOT</code> can be helpful: <code>PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))</code></p>Date/Time Localization in Django (python-side)2017-03-12T06:40:15+00:002024-03-29T07:53:20.001435+00:00Emin Mastizadahttps://mastizada.com/blog/author/mastizada/https://mastizada.com/blog/datetime-localization-in-django-python-side/<p>There are two sides in localization in Django framework: Templates and Python-side.</p>
<p>There are a lot of good stuff about template side in <a href="https://docs.djangoproject.com/en/1.10/topics/i18n/" target="_blank" title="Internationalization and localization">Django</a> <a href="https://docs.djangoproject.com/en/1.10/topics/i18n/formatting/" target="_blank" title="Format localization">Documentation</a>, how ever what if you need to get time using <strong>datetime</strong> module?</p>
<p>Lets go over <code>date.today</code> using "%B %Y" <a href="https://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior" target="_blank" title="Python datetime formats">format</a>:</p>
<pre>>>> from datetime import date<br/>>>> today = date.today()<br/>>>> print(today.strftime("%B %Y"))<br/>March 2017</pre>
<p>What if I need this for subject of an e-mail or sms message that will be sent from django app?</p>
<p>Let's assume that we have <code>user</code> object, and it has <code>CharField</code> language with value 'ru'. First of all, we will need to activate language:</p>
<pre>>>> from django.utils.translation import activate<br/>>>> activate(user.language)</pre>
<p>Our e-mail subject will be "Topics for March 2017" and in Russian "Темы для Март 2017":</p>
<pre>>>> from django.utils.translation import ugettext_lazy as _<br/>>>> subject = _("Topics for {date}").format(date=today.strftime("%B %Y"))<br/>>>> print(subject)<br/>Темы для March 2017</pre>
<p>As you can see, month stays in English. In that case one possible solution can be to parse month name ("March"), use it's translation and add only year from <code>today.year</code>:</p>
<pre>>>> month_name = _(today.strftime("%B"))<br/>>>> subject = _("Topics for {month}, {year}").format(month=month_name, year=today.year)<br/>>>> print(subject)<br/>Темы для Март, 2017</pre>
<p>Another way is to use django.utils.formats function:</p>
<pre>>>> from django.utils import formats<br/>>>> date = formats.date_format(today, format="YEAR_MONTH_FORMAT", use_l10n=True)<br/>>>> subject = _("Topics for {date}").format(date=date)<br/>>>> print(subject)<br/>Темы для Март 2017 г.</pre>
<p>If you have <code>USE_L10N = True</code> in settings, no need for <code>use_l10n</code> attribute.</p>
<p>Second way is more practical and first gives you better control for localization (like adding extra words for different locales).</p>
<p>You can <a href="https://docs.djangoproject.com/en/1.10/ref/templates/builtins/#std:templatefilter-date" target="_blank" title="all allowed date format strings">find here all allowed date format strings</a>.</p>
<p></p>
<p>Hope it helped you and if you have a better idea to solve that problem, please, write them in comments.</p>Software Freedom and Linux Days 2016 Turkey2016-04-07T22:41:36+00:002024-03-28T14:16:10.297959+00:00Emin Mastizadahttps://mastizada.com/blog/author/mastizada/https://mastizada.com/blog/software-freedom-and-linux-days-2016-turkey/<p>Software Freedom and Linux Days is one of biggest events in Turkey on Software Freedom and is Organised by Linux User Group Turkey (LUG) and Bilgi University every year starting from 2003. Its place where local users can gain knowledge about Free Software solutions from programming languages to applications, companies giving technical support for them and of course what is Free Software Philosophy and why its crucial to support this movement.</p>
<p>Today, when we know how big goverment surveillance is, the need in software freedom increases. As free softwares are mostly driven by community, there is mostly no chance of backdoors or any other dainger. Its the only way to save our privacy.</p>
<p>There were a lot of interesting talks during the event and awesome stands where people could learn new things and ask their questions to people who work on this field for a long time - "professionals". Here are few of them:</p>
<p> </p>
<p><strong>Barış Büyükakyol</strong>: Team member of Hackerspace Istanbul told about Software Freedom Philosophy. Also he told about wrong usage of some words like open source instead of free software, PC instead of WC (Windows Computer) and etc.</p>
<p><strong>Ege Orhan</strong>: What is CopyLeft and can it be used in Turkey.</p>
<p><strong>Aydan Taşdemir</strong>: How to make PostgreSQL backups using Pgbarman.</p>
<p><strong>Sadık Faruk Çetin</strong>: Git - version control system.</p>
<p><strong>Doruk Fişek</strong>: Big Data and NoSQL</p>
<p><strong>Güray Yıldırım</strong>: ITU Software Freedom community member told about How to make desktop, mobile and IoT applications using Python/Kivy Framework.</p>
<p><strong>Uğurcan Ergün</strong>: Self-Hosting for lazy people - YunoHost</p>
<p><strong>Serdar Doğruyol</strong>: Crystal Programming Language</p>
<p><strong>Halil Kaya</strong>, <strong>Fatih Kadır Akın</strong>: Hackathons in Turkey and Free (as in Freedom) Hackathons. The number of hackathons in Turkey is increasing very fast, but most of them are actually marathons inside of company where they try to get new ideas and applications from public for their own usage. But instead hackathons should gain something for public community. They demonstrated Packathon as an example for that where people could develop free packages without having to use some companies ideas and providing business plan for their hack (in some of Hackathons, jury members asks you about your business plan, which is not a purpose of a hackathon).</p>
<p> </p>
<p>And of course, awesome stands where people meet each other and discuss their ideas and problems. LKD (Linux User Group Turkey) with awesome stickers, "Özgür Yazılım A.Ş." and Kartaca - companies in Turkey which give corporate support for Free Software Projects, and our stand, Mozilla.</p>
<p><a data-lightbox="roadtrip" href="https://mastizada.com/media/uploads/blog/sfld2016/mozilla-stand-by-aybuke_ozdemir.jpeg"><img alt="Mozilla SFLD2016 Stand, Photo by @aybuke_ozdemir" height="277" src="https://mastizada.com/media/uploads/blog/sfld2016/.thumbnails/mozilla-stand-by-aybuke_ozdemir.jpeg/mozilla-stand-by-aybuke_ozdemir-400x277.jpeg" style="float: right;" width="400"/></a></p>
<p>Last time, 3 years ago in 2013 Mozilla had stand in SFLD with Selim Sumlu and Brian King. This year we demonstrated Mozilla projects like <a href="https://thimble.mozilla.org/" target="_blank" title="Thimble - Write the Web On the Web">Thimble</a> for HTML education, Memory optimized <a href="https://www.rust-lang.org/" target="_blank" title="A systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety">Rust Language</a>, In-place localization tool <a href="http://pontoon.mozilla.org/" target="_blank" title="In-place localization tool">Pontoon</a> and Turkish Localized products of Mozilla (<a href="https://www.mozilla.org/" target="_blank" title="Mozilla Homepage">homepage</a>, mdn, sumo, firefox, hello and etc.). Also we talked about importance of using SSL to save users' private details like passwords and how to get free SSL Certificate for Personal Sites using <a href="https://letsencrypt.org/" target="_blank" title="Let's Encrypt - Certificate for everyone">Let's Encrypt</a>.</p>
<p>We had interesting discussions with users about different Mozilla products and actions (<a href="https://www.mozilla.org/en-US/teach/smarton/tracking/" target="_blank" title="Get Smart On the Web">SmartOn</a> and similar projects). Also some of attenders voluntered for localizing thimble project and we enabled it after the event.</p>
<p>Thanks for everyone who attended our stand and special thanks to Selim Sumlu, Baris Buyukakyol and Adil Oztaser for their help in stand.</p>
<p>As always Firefox mentioned mostly in all talks where privacy involved. And our new contributor <a href="https://mozillians.org/en-US/u/aybukeozdemir/" target="_blank" title="Aybuke Ozdemir - Mozillians Profile">Aybuke Ozdemir</a> told about her contributions at Mozilla and how anyone can start contributing to Mozilla projects. There team, Kripton had significant impact in <a href="https://www.libreoffice.org/" target="_blank" title="LibreOffice - A powerful office suite">LibreOffice</a> project.</p>
<p>For more information:</p>
<p><a href="http://ozguryazilimgunleri.org.tr/2016/">http://ozguryazilimgunleri.org.tr/2016/</a></p>
<p><a href="http://www.lkd.org.tr/en/">http://www.lkd.org.tr/en/</a></p>
<p><a data-lightbox="roadtrip" data-title="Aybuke Ozdemir about her Mozilla contributions" href="https://mastizada.com/media/uploads/blog/sfld2016/aybuke-ozdemir-by-em94mu.jpeg"><img alt="Aybuke Ozdemir about her Mozilla contributions" height="150" src="https://mastizada.com/media/uploads/blog/sfld2016/.thumbnails/aybuke-ozdemir-by-em94mu.jpeg/aybuke-ozdemir-by-em94mu-265x150.jpeg" width="265"/></a><a data-lightbox="roadtrip" data-title="Mozilla Stand by D8 News" href="https://mastizada.com/media/uploads/blog/sfld2016/mozilla-stand-by-d8news.jpeg"><img alt="Mozilla Stand by D8 News" height="150" src="https://mastizada.com/media/uploads/blog/sfld2016/.thumbnails/mozilla-stand-by-d8news.jpeg/mozilla-stand-by-d8news-200x150.jpeg" width="200"/></a><a data-lightbox="roadtrip" data-title="Baris Buyukakyol - Free Software Culture (@aybuke_ozdemir)" href="https://mastizada.com/media/uploads/blog/sfld2016/baris-buyukakyor.jpeg"><img alt="Baris Buyukakyol - Free Software Culture (@aybuke_ozdemir)" height="150" src="https://mastizada.com/media/uploads/blog/sfld2016/.thumbnails/baris-buyukakyor.jpeg/baris-buyukakyor-265x150.jpeg" width="265"/></a><a data-lightbox="roadtrip" data-title="Aydan Tasdemir - PGBarman (@emre_yilmaz)" href="https://mastizada.com/media/uploads/blog/sfld2016/aydan-tasdemir-by-emre_yilmaz.jpeg"><img alt="Aydan Tasdemir - PGBarman (@emre_yilmaz)" height="150" src="https://mastizada.com/media/uploads/blog/sfld2016/.thumbnails/aydan-tasdemir-by-emre_yilmaz.jpeg/aydan-tasdemir-by-emre_yilmaz-218x150.jpeg" width="218"/></a><a data-lightbox="roadtrip" data-title="LKD (LUG) Stickers (@olmezsena)" href="https://mastizada.com/media/uploads/blog/sfld2016/lkd-sticker-by-olmezsena.jpeg"><img alt="LKD (LUG) Stickers (@olmezsena)" height="150" src="https://mastizada.com/media/uploads/blog/sfld2016/.thumbnails/lkd-sticker-by-olmezsena.jpeg/lkd-sticker-by-olmezsena-200x150.jpeg" width="200"/></a><a data-lightbox="roadtrip" data-title="Me as Mozilla Rep at stand (@adiloztaser)" href="https://mastizada.com/media/uploads/blog/sfld2016/mozilla-stand-with-rep-by-adiloztaser.jpeg"><img alt="Me as Mozilla Rep at stand (@adiloztaser)" height="150" src="https://mastizada.com/media/uploads/blog/sfld2016/.thumbnails/mozilla-stand-with-rep-by-adiloztaser.jpeg/mozilla-stand-with-rep-by-adiloztaser-267x150.jpeg" width="267"/></a></p>Wireless mouse and keyboard freeze problem in laptops2015-10-21T11:44:29+00:002024-03-28T11:09:58.009992+00:00Emin Mastizadahttps://mastizada.com/blog/author/mastizada/https://mastizada.com/blog/wireless-mouse-and-keyboard-freeze-problem-in-laptops/<p>This is very annoying when you use wireless keyboard or mouse and when you don't use it for few seconds it freezes.</p>
<p>The actual reason for that is laptop-mode or different power management tools which is suspending most wireless devices to save power. To solve that you need to turn off Autosuspend for USB device USB Receiver option in your power management system.</p>
<p>Easiest way:</p>
<p>Install <strong>powertop</strong> if you don't have this program:</p>
<p><code>sudo apt-get install powertop</code></p>
<p>Then open (<code>sudo powertop</code> command in console), select <strong>Tunables</strong> in menu (using tab button) and find <strong>Autosuspend for USB device USB Receiver</strong> option (it will also include your device name) and turn it off just by pressing <em>Enter</em> key.</p>
<p>Close app using <em>ESC</em> button. Now you wireless device is working fine, bad news, it will be same after reboot or logout. To prevent this we need to edit <strong><em>rc.local</em></strong> file to execute this script everytime. When you change something in powertop it just executes a command.</p>
<p>You can export that command to html file:</p>
<p><code>sudo powertop --html</code></p>
<p>Then get commands from that file (name of html file can be different in different releases) :</p>
<p><code>grep 'echo ' powertop.html | sed 's/.*\(echo.*\);.*/\1/g'</code></p>
<p>To be sure which one is for wireless device open powertop again and change that Autosuspend setting, on the top you will see command, now copy that command from the list we got from powertop.html file. Mine was:</p>
<p><code>echo 'on' > '/sys/bus/usb/devices/1-2/power/control'</code></p>
<p>Open rc.local file and add this command <strong>before</strong> exit 0:</p>
<p><code>sudo nano /etc/rc.local</code></p>
<p>Save the file (using Ctrl+X if you use nano).</p>
<p>Thats all, now you can use your wireless devices when you need them without such an annoying terrible problem.</p>Mozilla Localization Hackathon in Istanbul2015-10-14T18:07:27+00:002024-03-29T01:54:26.753908+00:00Emin Mastizadahttps://mastizada.com/blog/author/mastizada/https://mastizada.com/blog/mozilla-localization-hackathon-in-istanbul/<p>One of Localization Hackathons of Mozilla in 2015 was in Istanbul for Turkish, Azerbaijani, Russian, Kazakh and Uzbek L10n teams. Francesco Lodolo (:flod) and Axel Hecht (:Pike) from Mozilla L10n attended event and told about Mozilla Projects, Release Schedule, Tools, Virtual Participation Circle and Instructed teams in hackathon.</p>
<p>While in hackathon svn users for web files switched to github, Axel and Francesco helped with that switch. For now there are few localization tools in Mozilla: Pootle, Verbatim (old Pootle version), Pontoon, HG and Github. Software Projects like Firefox, Thunderbird, Firefox for Android, FirefoxOS and etc. are translated in Pootle. For web files teams can use Github, Verbatim or Pontoon. Turkish and Azerbaijani team switched to Pontoon for web files in Hackathon and will continue from there.</p>
<p><img alt="Virtual Participation Circle" height="200" src="https://mastizada.com/media/uploads/blog/mozilla/.thumbnails/virtual-participation-circle.jpg/virtual-participation-circle-200x200.jpg" style="float: right;" width="200"/></p>
<p> </p>
<p><strong>Virtual Participation Circle</strong> - What you do for Mozilla and what Mozilla does for you. Participants told about their story in Mozilla and what Mozilla did for them. Axel told about value of contributions by l10n teams to Mozilla, importance of localization in Mozilla products and how people use them.</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p><img alt="Mozilla Release Circle" height="200" src="https://mastizada.com/media/uploads/blog/mozilla/.thumbnails/firefox-release-circle.jpg/firefox-release-circle-200x200.jpg" style="float: right;" width="200"/></p>
<p>Then Francesco told about <strong>release circle</strong>. New releases are coming every 6 week. Every l10n team have 6 weeks to finish translations, fix bugs, make tests and sign off. Its also recommended to sign off at least 1 week before release (in 5th week) so possible problems with locale can be solved in 1 week. We also had idea to make video conference every 3 weeks, first one to discuss where some string are used, as verb or as noun, so we can make a better translation, and second conference to discuss problems and bugs, check if everybody is ready for release.</p>
<p> </p>
<p> </p>
<p>All teams finished their work to be ready for Firefox 42 launch and also Francesco and Axel had one-to-one talk with each team about their team structure, how they manage localization team, about new localizers in team and which problems they have. After talk everybody filled survey form and we finished Hackathon. As always, last photo from event:</p>
<p><img alt="Mozilla L10n Hackathon Istanbul" height="400" src="https://mastizada.com/media/uploads/blog/mozilla/.thumbnails/mozhackist.jpg/mozhackist-707x400.jpg" width="707"/></p>
<p style="padding-left: 60px;">More Photos: <a href="https://www.flickr.com/photos/flod/sets/72157657392351213" target="_blank" title="Mozilla L10n Hackathon Istanbul Pictures">in Flickr</a></p>
<p style="padding-left: 60px;">Mozilla L10n blog post (by :flod): <a href="https://blog.mozilla.org/l10n/2015/11/09/mozilla-turkic-l10n-meet-up-istanbul/" target="_blank" title="Mozilla Turkic l10n Meet-up – Istanbul">Mozilla Turkic l10n Meet-up – Istanbul</a></p>Chunked-Encoded data error in php cURL requests2015-05-29T13:12:20+00:002016-12-25T04:05:29.204165+00:00Emin Mastizadahttps://mastizada.com/blog/author/mastizada/https://mastizada.com/blog/chunked-encoded-data-error-in-php-curl-requests/<p>Few days ago we got a new problem, one part of our website stopped working, we used guzzle with Symfony2 to make requests to our RESTful API. After checking logs the only thing I could find was something like that:</p>
<p><code>[curl] 56: Problem (2) in the Chunked-Encoded data [url]</code></p>
<p>We changed guzzle to guzzlehttp as it was outdated, tried few other things (creating request and adding data, json request, making request header and body and sending all at once (client->put) but nothing helped. Then focused on main problem, cURL.</p>
<p>Actually it was problem of cURL itself (yep, that is very strange) and after updating it to 7.36 version problem solved by itself.</p>
<p>Steps:</p>
<ol>
<li><code>sudo add-apt-repository ppa:costamagnagianfranco/ettercap-stable-backports</code></li>
<li><code>sudo apt-get update && sudo apt-get install curl</code></li>
</ol>
<p></p>
<p><em>Happy Coding...</em></p>How to disable some hotkeys in Ubuntu2015-02-27T13:15:52+00:002023-07-13T17:16:23.470191+00:00Emin Mastizadahttps://mastizada.com/blog/author/mastizada/https://mastizada.com/blog/how-to-disable-some-hotkeys-in-ubuntu/<p>I mostly don't use mouse, and doing everything from keyboard while working. But the most annoying thing is that while making something awesome in code editor or reading something good in firefox you can suddenly press Ctrl+Q (which exits from browser immidiatly without warnings) or Alt+F4 when you want to press Alt+F3. Everytime I loose time because of that hotkeys.</p>
<p>So, today finally I changed my keyboard layout after closing code editor with unsaved code and important sorted data.</p>
<p>In Ubuntu just open System Settings and then Keyboard:</p>
<p><img alt="Ubuntu System Settings" height="300" src="https://mastizada.com/media/uploads/blog/linux-hotkeys/.thumbnails/settings.png/settings-377x300.png" title="Ubuntu Settings" width="377"/></p>
<p>Then edit current key combination to make it hard and unique (click once on it to change):</p>
<p><img alt="Ubuntu Close Window Hotkey" height="300" src="https://mastizada.com/media/uploads/blog/linux-hotkeys/.thumbnails/closekey.png/closekey-534x300.png" title="close window hotkey change" width="534"/></p>
<p>Now go to Custom Shortcuts and add new keys with /bin/false command which will do nothing:</p>
<p><img height="300" src="https://mastizada.com/media/uploads/blog/linux-hotkeys/.thumbnails/falsekeys.png/falsekeys-535x300.png" width="535"/></p>
<p>After adding combinations here these keys will do nothing and you will never have such problem again. Just remember changed hotkey to not search later why they are not working :D<br/><br/>Happy coding...</p>How to solve locale problem in Gnu/Linux (and Docker images)2014-11-01T17:56:08+00:002024-03-04T19:08:23.430709+00:00Emin Mastizadahttps://mastizada.com/blog/author/mastizada/https://mastizada.com/blog/how-to-solve-locale-problem-in-linux-powered-servers/<p>After setting up a Gnu/Linux Server, Computer or a Docker image, you can get a locale error.</p>
<p>It is because your OS have no default locale and the error output can be like this one:</p>
<pre><code>perl: warning: Setting locale failed.<br/>perl: warning: Please check that your locale settings:<br/> LANGUAGE = (unset),<br/> LC_ALL = (unset),<br/> LC_PAPER = "az_AZ.UTF-8",<br/> LC_ADDRESS = "az_AZ.UTF-8",<br/> LC_MONETARY = "az_AZ.UTF-8",<br/> LC_NUMERIC = "az_AZ.UTF-8",<br/> LC_TELEPHONE = "az_AZ.UTF-8",<br/> LC_IDENTIFICATION = "az_AZ.UTF-8",<br/> LC_MEASUREMENT = "az_AZ.UTF-8",<br/> LC_TIME = "az_AZ.UTF-8",<br/> LC_NAME = "az_AZ.UTF-8",<br/> LANG = "en_US.UTF-8"<br/> are supported and installed on your system.<br/>perl: warning: Falling back to the standard locale ("C").<br/>locale: Cannot set LC_ALL to default locale: No such file or directory</code>perl: warning: Setting locale failed.</pre>
<p>To solve this issue you can add a default locale to the <code>/etc/default/locale</code> file:</p>
<pre><code>LC_ALL=en_US.UTF-8<br/>LANG=en_US.UTF-8</code></pre>
<p>Some times you also need to add this lines to the <code>/etc/environment</code> file.</p>
<p>Or, better way to solve the issue, connect to your server, in colsole run the following command to get the list of locales on your server:</p>
<pre><code>locale</code></pre>
<p>And generate the missing locale:</p>
<pre><code>sudo locale-gen</code> az_AZ.UTF-8</pre>
<p>Then reconfigure locales:</p>
<pre><code>sudo dpkg-reconfigure locales</code></pre>
<p></p>
<p>For Docker images, add these lines to your <code>Dockerfile</code>:</p>
<pre>RUN export LC_ALL=en_US.UTF-8<br/>RUN export LANG=en_US.UTF-8<br/>RUN locale-gen en_US.UTF-8</pre>First Post2014-05-25T12:02:40+00:002023-06-10T18:43:54.179780+00:00Emin Mastizadahttps://mastizada.com/blog/author/mastizada/https://mastizada.com/blog/first-post/<p>Nearly 6 month ago I bought my domain for making my personal blog.</p>
<p><img alt="Me in ITUGNU club" height="323" src="https://mastizada.com/media/uploads/personal/.thumbnails/me-itugnu.png/me-itugnu-301x323.png" style="float: right;" title="Me in ITUGNU club" width="301"/>After buying domain I just redirected it to <a class="external" href="http://web.itu.edu.tr/~mastizada/" target="_blank">my university web page</a> written in static html and had no time for making something useful as I have a lot of works in my job and lectures in my university.</p>
<p>Finally after 6 month, when semester in university enden I decided to make something little and start using it.</p>
<p>As hosting I'm using <a class="external" href="https://www.digitalocean.com/?refcode=73b0da0b38be" target="_blank" title="DigitalOcean">DigitalOcean</a> as its easy to make droplets and configure it as you want. Just installed Django and Mezzanine framework, made some customizations and started blogging.</p>
<p>Best thing with Mezzanine, it is on Django/Python and works with Python 3.</p>
<p>So, what my readers can expect in my blog:</p>
<ul>
<li>News about Mozilla and specially about Mozilla Azerbaijan Community</li>
<li>News about Ubuntu and specially about Ubuntu Community</li>
<li>News about Open Source projects</li>
<li>HowTo posts where I will explain interesting thing in programming and system administration</li>
<li>And may be something different - Its Personal Blog :D</li>
</ul>
<p>As programming I love using Python, so I think post mostly will be about Python. I will use categories and tags, so you can easily find what you are interested in.</p>
<p>And I wish finally I will create my personal page like CV, but I'm not going to waste time for that now.</p>
<p>I wish my users will find something interesting and useful in my blog and I will be happy if it will really help someone, so waiting for your feedbacks.</p>
<p>Have a good time...</p>
<p>Emin Mastizada</p>