IHS Telekom Parolanızı Görüyor

Her şey, tek kullanımlık şifrenin (TKŞ) çalışmaması ile başladı. Telefonum fabrika ayarlarına sıfırlandığında uygulamanın kullanıcı kimliği de değişmişti, bu yüzden ürettiği şifreler geçersizdi. Gayet doğal bir durum. Tek kullanımlık şifre sistemi bunun dışında da pek çok farklı sebepten de başarısız olabilirdi. Ancak IHS Telekom böyle bir senaryo için herhangi bir çözüm düşünmemiş gibi görünüyor. Ben de destek talebi oluşturarak beklemeye başladım.

Çok kısa bir süre içinde telefonla geri dönüş sağlandı ve kimlik doğrulama için benden bir takım bilgiler istendi. TC kimlik numaramı ciddi bir rahatsızlık hissederek söyledikten sonra (ki bu bilgi sistemlerinde kayıtlı değil), ilk ismim sistemlerinde kayıtlı olmadığı için kimliğimi başka yöntemlerle de doğrulamak zorunda olduklarını söylediler. Sistemde kayıtlı olan telefon hattı üzerinden görüşürken bu uygulama kulağa epey saçma gelse de, işleme devam ettim.

Sistemde kayıtlı olan e-posta adresimi de söyledikten sonra benden parolam da istendi, hem de çok doğal bir şeymiş gibi bir ses tonuyla. Bu talebi elbette reddettim. Bunun üzerine e-posta adresine erişimim olup olmadığı soruldu ve gönderilen iletinin içeriği ile doğrulama yapıldı. Tek kullanımlık şifre ile ilgili problemim çözüldü.

Fakat gelen ileti ile işler daha da ilginç bir boyut kazandı. Continue reading

Start VLC GUI on Remote Host Using SSH

When you connect a remote computer using SSH, and start a media file with VLC, audio plays at remote host and video (if exists, converted to ASCII) is transferred over SSH to local client, which is kinda cool, I think. If you want to start VLC with GUI on remote, the DISPLAY environment variable should be set correctly.

export DISPLAY=:0

Now when you run vlc command, it starts with GUI mode on remote computer. Moreover, if you want to launch it in full-screen mode, you may set -f flag.

vlc -f mediafile

A Month in High Performance Computing Center

It has been a month since I started working at National Center for High Performance Computing of Turkey. This center provides computing resources for scientific researches and R&D department of industrial companies.

I am a part time employer here, and truth to be told, I have no specific job description. I am obligated to run routine tasks, such as checking host and network status several times a day. I also answer emails and phone calls for technical support.

Fortunately that is only the partial of my job. Continue reading

Google Play Port Number for Android Devices

An Android device contacts Google Play servers for several reasons, such as checking internet connectivity, push notifications and application installations triggered from web. These services will fail to operate if the Google Play ports are blocked in your network (mobile data, wireless, vpn).

If you are using a firewall and would like to allow (or block) these services, Google Play uses TCP and UDP 5228 port. You can refer to connectivity requirements page on Google Play Help for more information.

Buying A Nexus 4: The Adventure

Previous summer, I decided to buy a new smartphone. I set a price range for myself, and started searching the ultimate smartphone that suits my needs. I really loved what Sony did with their Xperia products. I made a pro/con list for several phones, and some of the features I considered was: USB on-the-go support, HDMI/MHL, NFC and size (it does matter). My final decision was Xperia Sola, and ordered one in July. The next day, I friend of mine from MIT asked me a favor, and offered to bring me something from US when she returns. I canceled my order for Xperia Sola, because I could buy Xperia P for the same price at Amazon.

On 29th of October, Google announced Nexus 4, in the same price range with Xperia P. All my thoughts had changed… Continue reading

Managing Gunicorn Processes With Supervisor

Last week, I have written a post about gunicorn applications. We started gunicorn manually, and our application worked. Yay!

However, everything is not so great. When (If) the server reboots, gunicorn must be started manually, again. We should find a way to automate this. Actually, there are few ways to accomplish this, such as: init scripts, and supervisord.

Init scripts are more than enough. But they have some drawbacks. They are not so easy to write or maintain. If you have several projects, things get even harder. Supervisord is a relatively easier way for managing multiple gunicorn processes.

Let’s start with installing supervisor:

sudo apt-get install supervisor

Supervisor uses configuration files for applications located in /etc/supervisor/conf.d/ directory. The configuration for our application is below:

[program:hello]
command = gunicorn hello:app
directory = /home/username/
user = username

This is a very basic configuration required to run gunicorn. Since we are using virtualenv, we need to change “command” parameter to use python and gunicorn from our environment instead of global ones.

command = /home/username/hello/bin/python /home/username/hello/bin/gunicorn hello:app

Now we can test, whether our configuration works or does not. Reload supervisor with following commands and start our application. Stop gunicorn if it is running, and start it again with supervisor.

supervisorctl reread
supervisorctl update
supervisorctl start hello

Now gunicorn must be running, you can make sure by visiting page. If server reboots, supervisor starts it. If gunicorn fails, supervisor restarts it. Finally, everything is great!

You can find more information about supervisor configuration parameters in the documentation. You can also read my blog post about restarting and reloading supervisor.

Supervisord: Restarting and Reloading

Supervisord is a great daemon for managing application processes. However it does not have a reload option, and restart works different than we get used to. These command makes the following effects.

service supervisor restart

Restart supervisor service without making configuration changes available. It stops, and re-starts all managed applications.

supervisorctl restart <name>

Restart application without making configuration changes available. It stops, and re-starts the application.

If you create a new configuration. None of the commands above will make it available. If you want to apply your configuration changes in both existing and new configurations, start applications in new configurations, and re-start all managed applications, you should run:

service supervisor stop
service supervisor start

If you do not want to re-start all managed applications, but make your configuration changes available, use this command:

supervisorctl reread

This command only updates the changes. It does not restart any of the managed applications, even if their configuration has changed. New application configurations cannot be started, neither. (See the “update” command below)

supervisorctl update

Restarts the applications whose configuration has changed.
Note: After the update command, new application configurations becomes available to start, but do not start automatically until the supervisor service restarts or system reboots (even if autostart option is not disabled). In order to start new application, e.g app2, simply use the following command:

supervisorctl start app2

How to Run Flask Applications with Nginx Using Gunicorn

We have recently bought a VPS for İTÜ24, the online newsletter of Istanbul Technical University. The server is running on Ubuntu Server 12.04 operating system. Due to limited memory resources and performance concerns, we preferred to setup nginx as web server.

Our server will serve several web pages and applications developed in various programming languages, such as PHP, Python, Ruby (on Rails). Currently, we have one Python application, which is using Flask framework.

How we run Flask application with nginx, step by step…
Continue reading

Resetting Your Linux Password

If you cannot remember your password on a Linux operating system, you can simply reset it within minutes. Here is how to do:

  1. The only thing you need is a bootable Linux Live CD or USB thumb drive. You will also need “sudo” command to achieve this, make sure you have root privileges on your bootable Linux media.
  2. Once you boot into your Live CD/USB, mount the disk partition which Linux is installed on.
  3. There is a (magical) Linux command: chroot. This will allow you to change your root directory to mounted partition. Open terminal and run this command.: (Change “/media/disk” to your mount location.)
    sudo chroot /media/disk
  4. When the prompt changes, run this command, and enter new password: (Change “user” to username whose password to be reset.)
    passwd user

After setting the password, you can now restart the computer (do not forget to remove Live CD/USB), and login using new password.

IMPORTANT NOTICE: PLEASE RESPECT PRIVACY OF OTHERS