Connection error (Xiaomi Mi Phone to PC via USB) (Solution)

If you have issues (empty folder, cannot connect, etc.) when connecting your Xiaomi phone to your PC via USB cable, you should try the following before you try anything else. This is how I solved it after I installed Mi Suite and enabled developer options and USB debugging; these were not necessary.

  1. Connect your device to your PC.
  2. Unlock your device (phone) if it is locked.
  3. On your device, swipe down from the top of the screen.
  4. Scroll down if necessary until you see the notification of “Android System”. It should be saying something like “This device is charging from USB”. Click on for other options. Choose file transfer or photo transfer.

How to change wallpaper settings in Gnome 3

There is surprisingly not any GUI option in Gnome 3 by default to change wallpaper settings. I use “dconf-editor” for this purpose. It is possible to center, scale, tile or stretch a wallpaper by using it.

“dconf-editor” can be found in the main repositories of Debian. Once you installed it, open dconf-editor, and navigate to: org -> gnome -> desktop -> background. There you will see the pop-up menu which let you make arrangements on your wallpaper.

Source: https://ask.fedoraproject.org/en/question/24825/on-gnome3-how-can-i-center-an-image-as-my-wallpaper-or-maybe-stretch-or-tile-it/

How to install debian alongside Windows (dual boot) with full disk encryption

In this post I will shortly list the steps to install debian using LVM and LUKS alongside a working Windows installation, as a dual boot system.

When you follow the following steps, you will have separate /home, root and swap partitions and all of them will be fully encrypted.

This is tested with debian 9 and Windows 10, 64 bit system with GPT partitioning structure.

  1. Create a free NTFS partition on your disk for Windows and a free disk space following the Windows partition for your Linux installation. I suggest at least 20G of disk size for Linux root partition. You may use debian live USB/CD and gparted for this purpose.
  2. Install Windows to the first partition.
  3. Plug in the ethernet cable and unplug all unnecessary USB disks except the installation one to prevent any mistake during installation and partitioning.
  4. Boot with a debian USB or compact disk and run the installer.
  5. Select a language: English
  6. Select your location: Choose yours.
  7. Configure locales: Choose yours or choose US.
  8. Configure the keyboard: Choose yours.
  9. Detect network hardware: “Some of your hardware needs non-free firmware files to operate. The firmware can be loaded from removable media, such as a USB stick or floppy. The missing firmware files are: iwlwifi-7260-17.ucode”. If you have such media available now, insert it, and continue. Load missing firmware from removable media: No.
  10. Detect network hardware: “Some of your hardware needs non-free firmware files to operate. The firmware can be loaded from removable media, such as a USB stick or floppy. The missing firmware files are: rtl_nic/rtl8411-2.fw”. If you have such media available now, insert it, and continue. Load missing firmware from removable media: No.
  11. Please enter the hostname for this system: Choose yours. This will be the name of your computer and it may be visible on the local area network.
  12. Please enter the domain name. Choose yours or hit enter.
  13. Choose a mirror of the Debian archive: Choose yours. Hit enter when it asks you for a proxy if you don’t need one.
  14. Set up users and passwords: Just hit enter to disable root account.
  15. A user account will be created for you to use instead of the root account for non-administrative activities. Full name: Choose something or enter yours. Choose a password.
  16. Partition disks: Manual.
  17. Create a 500M partition at the beginning of the free disk space. Set its mount point as “/boot”, format it and use it as ext4 journaling file system (In this guide boot partition will be unencrypted. If you want to make it encrypted as well, it is possible. Check duckduckgo).
  18. “Configure encrypted volumes”. Write changes to the disk: Yes.
  19. “Please select the devices to be encrypted”: Select the free space. Write changes to the disk: Yes. The data will be overwritten: Yes. Erasing data… (This can take a little while)
  20. Choose a secure encryption passphrase.
  21. Configure the logical volume manager. Write current partitioning scheme: Yes.
  22. Create volume group. Enter a name for volume group, such as “vg”.
  23. Select encrypted disk (/dev/mapper/sdx_crypt).
  24. Create a logical volume. Select vg. Give a logical volume name: root. Set its size. My suggestion: At least 20G.
  25. Create a logical volume. Select vg. Give a logical volume name: home. Set its size… Spare a few gigs for swap, if possible. Typically twice as your RAM size, but nowadays I think 4-8 gigs would be sufficient for most people.
  26. Create a logical volume. Select vg. Give a logical volume name: swap. Set its size. Give all the remaining space.
  27. Finish LVM configuration.
  28. Select LV root and configure it: Use as ext4, mount point /.
  29. Select LV home and configure it: Use as ext4, mount point /home.
  30. Select LV swap and configure it: Use as swap area.
  31. Finish partitioning and write changes to the disk.
  32. Installing system… (This can take a while).

Well, that was it… Stay free and stay safe.

How to install and use MAME on Linux (debian)

I published a post titled “How to install and use sdlmame on Linux (debian/ubuntu)” in 2008. Realized that it needs an update, I would like to quickly share my experience of using MAME on Linux (debian) in 2017.

Keep reading if you would like to easily play “Outrunners” like you do in the good old days, but this time with your child, friend or spouse with infinite coins, thanks to your GNU/Linux computer. 🙂

How to install MAME Arcade Emulator on Linux (debian)?

To install MAME Arcade Emulator on debian Linux, simply install “mame” package from the main repositories.

A simple “mame” keyword search in Synaptic:

 

 

Configuring your ROM directory:

You should properly configure your preferred rom directory in the MAME user interface before attempting to find/run your games.

Select “Configure Options” in the main menu.

Select “Configure Directories”…

Select “ROMs”…

Add path of the directory of your rom files here.

Place your rom files in your rom directory as .zip files.

Also remember that your rom files must be compatible with the MAME version you use. Old rom files may not work with newer MAME versions. You may find recent MAME roms here.

To run MAME Arcade Emulator:

Just click on its icon in your Applications list or just hit SUPER key and type mame and press ENTER. I prefer the latter.

Here is the MAME Arcade Emulator user interface:

Gnome Video Arcade

Another option is using “Gnome Arcade Emulator (a.k.a. Gnome Video Arcade)”, which is a  simple MAME frontend for the GNOME desktop. Just search its name in Synaptic and install it.

Here is its simple interface:

Just don’t get confused if you see lots of old “machine” names such as “Atari 2600 (NTSC)” or “Amstrad GX4000” in the “available games” list. QMC2 is also likewise confusing.

Have fun!

How to verify Clonezilla ISO files

My notes titled “How to verify Clonezilla ISO files?” based on my experience on my debian 9 system.

1. Download Clonezilla ISO file from http://clonezilla.org/downloads.php

2. Download CHECKSUMS.TXT.gpg and CHECKSUMS.TXT

3. Place all these files into the same directory.

If you see the following output, install “dirmngr” and try again.

Output:

Output:

 

How to prevent leaks from VPN

I used following commands to prevent -almost- any outgoing internet connection from my Linux computer when VPN connection is not active. It is simple and it works.

Reset ufw rules to default
# ufw --force reset 

Drop all incoming traffic
# ufw default deny incoming 

Drop all outgoing traffic
# ufw default deny outgoing 

Let firewall allow outbound VPN traffic
# ufw allow out on tun0 

Let firewall allow VPN connection to be established
Change IP, port and protocol values as per your VPN server config
Example: ufw allow out to 255.255.255.255 port 9999 proto udp
# ufw allow out to $serverIP port $port proto $proto 

Run firewall and make it start automatically during startup
# ufw enable

 

New opportunity: Turkish citizenship for foreign investors

turkish citizenshipThere has been a recent change in Turkish regulations allowing foreign investors to apply for Turkish citizenship if they meet certain investment conditions. I will try to give you here a short summary about such conditions and information regarding application process.

Basically there are 2 conditions for foreign investors who seek to obtain Turkish citizenship via investment.

Condition 1: Residence Permit

Foreign investor, who wants to be granted with Turkish citizenship as per the new regulation, must have either a residence permit in Turkey, as per Law No: 6458 Article 31/j, or a turquoise card which is a new opportunity but its subordinate regulations are not published yet therefore this card is currently not available.

In conclusion, first of all, the applicant must obtain a short term residence permit for investors, as per Law No: 6458 Article 31/j.

You may visit official website of Directorate General of Migration Management for residence permit applications: https://e-ikamet.goc.gov.tr/

Condition 2: Investment

In his/her citizenship application, the applicant must document that he/she has fulfilled ANY of the conditions below:

  1. It is ascertained by the Ministry of Economy that the applicant has invested at least USD 2M as a fixed capital.
  2. It is ascertained by the Ministry of Environment and Urban Development that the applicant has purchased a real estate with the price at least USD 1M with a “unsalable for 3 years” condition in land registry.
  3. It is ascertained by the Ministry of Labor and Social Security that the applicant created a business with at least 100 employees.
  4. It is ascertained by the Banking Regulation and Supervision Agency that the applicant has deposited at least USD 3M with banks in Turkey with the condition that the money will stay there for at least 3 years.
  5. It is ascertained by the Undersecretariat of Treasury that the applicant has purchased debt instruments of the State at least in the amount of USD 3M and with the condition that the instruments will be kept for at least 3 years.

Application:

Once both conditions are satisfied and documented, foreign investor may apply to the Ministry of Internal Affairs for Turkish citizenship.

Applicant’s foreign spouse and underage children should also be able to apply for citizenship in the same application file as per the law mentioned above.

Legal assistance:

I would be happy to provide legal assistance about residence permit and Turkish citizenship to foreign investors. Please do not hesitate to contact me.