Friday, December 25, 2015

How to save custom shortcuts or keybindings on debian GNOME

According to ubuntu reference dconf is the most appropriate tool to manage shortcuts. Custom keybindings are stored in /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/, so we do

dconf dump /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/ > bkp

and bkp contains something like this:
[custom1]
binding='<Primary><Alt>t'
command='gnome-terminal &'
name='console'

[custom2]
binding='<Shift>Print'
command='gnome-screenshot -a'
name='screenshot-to-/home/asalle/Pictures'

[custom3]
binding='<Primary><Alt>i'
command='iceweasel'
name='iceweasel'

After this, put the bkp file into the cloud or elsewhere, where it can be safe and restore keybindings, if necessary, with:

 dconf load /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/ < bkp

Sorry, guys, I haven't tried the last one, so I am not sure if it works.

Wednesday, October 28, 2015

Sunday, September 6, 2015

if the "compress" context menu of nautilus is missing

I had a freshly installed latest stable Debian (Jessie) and some files to archive. Those were photos, ant it was very convenient to pick some of them in visual mode and choose compress from the context menu of nautilus, but it was not there.

After some digging I found that file-roller package is missing, after installing it everything was okay, so

sudo apt-get install file-roller
killall nautilus
nautilus &

Thursday, July 23, 2015

Touchpad not working after suspend on Debian Jessie

You can try some tricks, like adding

quiet splash i8042.notimeout atkbd.reset

to /etc/default/grub (line GRUB_CMDLINE_LINUX_DEFAULT=)

and then run
sudo update-grup and reboot

Or run
gconftool-2 --set --type boolean /desktop/gnome/peripherals/touchpad/touchpad_enabled true
if your touchpad is simply hardware-disabled.

As for me, nothing mentioned above worked. I use a workaround, that unplugs and plugs in the touchpad again, here what it looks like

#!/bin/bash
rmmod psmouse
modprobe psmouse

I was forced to call this after every awakening, and this was very annoying. I thought about automating all this. Most articles I read tried to use pm-suspend and some custom hooks for it:

sudo vim /etc/pm/sleep.d/0000trackpad
  1 cat /etc/pm/sleep.d/0000trackpad
  2 #!/bin/sh
  3 case "$1" in
  4     suspend|hibernate)
  5          modprobe -r psmouse ;;
  6     resume|thaw)
  7         modprobe psmouse ;;
  8 esac



This worked, but... It turned out that debian does not use pm-suspend when it suspends =(
To suspend and awake with touchpad working I had to sudo pm-suspend manually, so annoying. And again, when debian suspends from low battery or lid closed, it suspends without pm-suspend, so I had to run my annoying script.

Arghh!..

Debian uses systemd to manage power, so should I. By the way, when duckduckgoing word "systemd" a lot of controversial and critical posts come up about it being too complex and handling too much responsibility, try it!

systemd provides it's own environment to create hooks, so I created one that finally worked!

sudo vim /etc/systemd/system/touchpad_awakening.service 

[Unit]
Description=Reload mouse after suspend
After=suspend.target
After=hibernate.target
After=hybrid-sleep.target

[Service]
ExecStart=/home/asalle/bin/mouse

[Install]
WantedBy=suspend.target
WantedBy=hibernate.target
WantedBy=hybrid-sleep.target

(mouse is the script that modprobes the psmouse)

then, enable the service by
sudo systemctl enable touchpad_awakening.service 
and start manually to check it by
sudo systemctl start touchpad_awakening.service
check the result
sudo systemctl status touchpad_awakening.service

it reads:
● touchpad_awakening.service - Reload mouse after suspend
   Loaded: loaded (/etc/systemd/system/touchpad_awakening.service; enabled)
   Active: inactive (dead) since Thu 2015-07-23 16:08:20 EEST; 5s ago
  Process: 4285 ExecStart=/home/asalle/bin/mouse (code=exited, status=0/SUCCESS)
 Main PID: 4285 (code=exited, status=0/SUCCESS)

After suspend it worked okay. 
At last!

Monday, July 20, 2015

Debian Jessie on Fujitsu UH 552

So I had my Fujitsu UH 552 for a while now.
First, I had pre-installed Windows 8 there. First day I got it, I partitioned the hard disk for several parts:

Here is fdisk -l
Device         Start       End   Sectors   Size Type
/dev/sda1       2048    194559    192512    94M EFI System
/dev/sda2     194560  30914559  30720000  14.7G Linux filesystem
/dev/sda3  968669184 976771071   8101888   3.9G Linux swap
/dev/sda4   30914560  92354559  61440000  29.3G Microsoft basic data
/dev/sda5   92354560 153794013  61439454  29.3G Microsoft basic data
/dev/sda6  153794560 866269183 712474624 339.8G Microsoft basic data
/dev/sda7  866269184 968667135 102397952  48.8G Linux filesystem


sda1 is the boot partition, since I have UEFI, it is marked as EFI System. The grub and bootloader stuff is stored there.

sda2 is the /opt/ on his own partition (I have almost 5 GB of additional software, most of it are IDEs).

sda3 is a swap partition

sda4 is the C:/ drive of Windows 8

sda5 is the root directory (/). I'm wondering, why it is marked as Microsoft basic data by the fdisk.

sda6 is a ntfs data partition, where all the big data is stored, as archives of my university files and so on.

sda7 is /home on his own partition.

So, with this crazy-crazy situation I made up my mind to move from Ubuntu to Debian.
First, I made a live-usb. Just jigdo-ed the latest (Jessie) livecd distribution and tried to

dd if=debian-8.1-livecd.iso of=/dev/sdb1

and... nothing happened.
I guess there was some problem with bootloader, but I didn't want to dig deep this time, I wanted my Jessie to be right away! So I used the UNetBootin app. Great stuff, saved me a lot of times! So I flashed the liveusb with the jigdo-ed iso and UNetBootin and booted from the usb.

Installation process is rather ordinary, the only thing I changed is used sda7 as /home and didn't format it.

The several problems of fresh-installed Debian Jessie:
  1. no touchpad
  2. no wlan
  3. =(
 During the installation I missed that no Ethernet card was found on my laptop, so there was no driver installed for it. What a pity.
 Also, a classical problem of debian-like OS: Synaptic touchpad is not working. I must add, that even if you  fix it by adding

i8042.nomux

to /etc/default/grub, you will still face the problem after every single suspend. This is also fixable (but I'm telling it not now).

For wifi you need to install iwlwifi driver (I have Inter 3022 Ethernet card). You need to install firmware-iwlwifi_versionhere.deb or something like that. After installing the package, just do

modprobe iwlwifi

and reboot. Voila, after that I immediately had my wifi working, hooray.

Result: safe moving with several partitions and Windows8  from Ubuntu to Debian, no skill required. Thank you, great developers!

Wednesday, June 3, 2015

if you cannot view phpmyadmin's web interface


  1. check if you have Apache server running
  2. do the magic:
Open Apache config file:
Code:
sudo gedit /etc/apache2/apache2.conf
Add this line:
Code:
Include /etc/phpmyadmin/apache.conf
Restart Apache:
Code:
sudo /etc/init.d/apache2 restart
Type in your browser:
Code:
http://localhost/phpmyadmin


Tuesday, January 6, 2015

Happy New Year!

I got a few hours before work and I decided to codefore a bit.
Hope this was not a server failure :D

Monday, January 5, 2015

How does your internship go with these Christmas holidays?

I can't tell that it was a hard month. I was OK month. The only notable this was the Christmas holidays. We have a mailing list among just the OP-participants and many of them has written about day-offs, holidays, travelling and so on, but, as for me, I met the New Year with my bf, very quietly, just for us two. I am also looking forward for Xmas (which we celebrate the 7th of January), but I doubt that we will party all night :)
The good thing is that I can work more.
I've made a good deal during this month, at least, I feel like I have.
I am so ashamed I couldn't deal with installation from source, autoconf and automake before. These are so often used things, I just had to manage them :(
So good that I learned python more or less. Coursera is a really good place for learning things.
One good person said once, that coursera has opened the whole world for him. I should go and find another course after internship.


Saturday, January 3, 2015

Codeforces first AC

I've been participating ACM ICPC contests since the very first year of university studies. Victoria Ruvinskaia helped me a lot about it. Though I was not the most gifted student. But she believed in me and still believes. This is so encouraging.
I got my first AC on codeforces.com during the Google internship interview training.
Good girl!