Monday, September 22, 2014

Google Chrome backup or restore Seesion or Tabs

On Linux go to home directory and copy these two files

~/.config/google-chrome/Default

"Last Session"
"Last Tabs"

Wednesday, May 28, 2014

Can't switch keyboard in google-chrome or chromium from version 35+ --> Fixed in /etc/locale.conf

Keyboard layout switcher doesn't work if browser is started in en_US locale!
Because of that you need to start google-chrome or chromium with whatever non-English locale you use for example LANG=sl_SI.UTF-8 for Slovenian locale.

Running google-chrome like this fixes the problem.

`LANG=sl_SI.UTF-8 /usr/bin/google-chrome-stable`

You can create KDE Desktop shortcut Chrome.desktop

[Desktop Entry]
Comment[en_US]=
Comment=
Exec=LANG=sl_SI.UTF-8 /usr/bin/google-chrome-stable
GenericName[en_US]=
GenericName=
Icon=google-chrome
MimeType=
Name[en_US]=Google-Chrome
Name=Google-Chrome
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=

Update 31.08.2014
A general system wide fix for all users is to update locale.conf with more advanced options:

Create or edit /etc/locale.conf with these options:

# Enable UTF-8 with US settings.
LANG="en_US.UTF-8"

# Keep the default sort order (e.g. files starting with a '.'
# should appear at the start of a directory listing.)
LC_COLLATE="C"

# Set the short date to YYYY-MM-DD (test with "date +%c")
LC_TIME="sl_SI.UTF-8"




Monday, April 21, 2014

KDE Upgrade 4.13 came up with baloo indexer and there is no button to turn it off. 

KDE Upgrade 4.13 came up with baloo indexer and there is no button to turn it off.

So here are some ideas

I decided for First method

1. Legal way to block searcher
Go to KDE System Settings > Desktop Search > click plus sign and add your home to excluded folders.

You need to log out or reboot or run the script below  to stop the current indexer!

2. More intrusive version create kill script to run at KDE start-up
vi BalooStop.sh 

#!/bin/bash
killall -9 baloo_file_cleaner
killall -9 baloo_file
killall -9 baloo_file_extr
#rm -rf ~/.local/share/baloo/*

chmod +x BalooStop.sh 
./BalooStop.sh 

3. More hakish way create symlinks to /bin/true

mv /usr/bin/baloo_file_extractor /usr/bin/baloo_file_extractor.orig; ln -s /bin/true /usr/bin/baloo_file_extractor

mv /usr/bin/baloo_file_cleaner /usr/bin/baloo_file_cleaner.orig; ln -s /bin/true /usr/bin/baloo_file_cleaner

Wednesday, April 9, 2014

The heartbleed bug was introduced in OpenSSL 1.0.1 and is present in

1.0.1
1.0.1a
1.0.1b
1.0.1c
1.0.1d
1.0.1e
1.0.1f

The bug is NOT PRESENT in 1.0.1g, 1.0.0 and 0.9.8 branch of OpenSSL.

Check Arch Linux 

pacman -Q openssl
local/openssl 1.0.1.f-1    

If you see any version above you need to patch Arclinux

pacman -Sy ; pacman -S openssl ;

Check rpm based systems Centos/RedHat/Oracle Linux

rpm -qa |grep openssl
openssl-1.0.0

If you see any version above you need to patch OS

yum update openssl
Apache upgrade 2.2 to 2.4

Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe.  You need to recompile PHP.

In your httpd.conf find the line that loads the event MPM:

LoadModule mpm_event_module modules/mod_mpm_event.so

Replace it with one that loads the prefork MPM:

LoadModule mpm_prefork_module modules/mod_mpm_prefork.so

Of course you still need to load the PHP5 module (libphp5.so) and the corresponding config file somewhere.

Tuesday, March 25, 2014

Arch Linux enable / disable journal logging


Create script to enable disable journal logging.
To prevent SD card wearing on RaspberryPi  I've decided to take control of journal logging.

start_loging_journal.sh

#!/bin/bash
sed -i '/Storage=none/d'  /etc/systemd/journald.conf
systemctl restart systemd-journald

stop_loging_journal.sh

#!/bin/bash
sed -i '/Storage=none/d'  /etc/systemd/journald.conf
echo "Storage=none" >> /etc/systemd/journald.conf
systemctl restart systemd-journald

Wednesday, January 22, 2014

BTRFS File-level cloning in a split of a second.

Clone a file on btrfs in a split of a second

cp --reflink=always file.img clone_of_file.img

Before copying file
$ ls -s1
10485760 Centos53-2.img

Copying 10GB file
$ time cp --reflink=always  Centos53-2.img Centos53-2_copy.img

real    0m0.001s
user    0m0.000s
sys     0m0.000s

After copying file 
$ ls -s1
10485760 Centos53-2_copy.img
10485760 Centos53-2.img

Monday, January 20, 2014

Systemd default output or error output for all services and sockets

From man systemd and man systemd.unit(5)

StandardOutput=
StandardError=

Takes one of inherit, null, tty, journal, journal+console, syslog, syslog+console, kmsg, kmsg+console.

Wednesday, January 8, 2014

Arch Linux journalctl -f is very slow on btrfs filesystem


Check log size
journalctl --disk-usage

Check log for fragments
filefrag /var/log/journal/*/*

Defragment log
btrfs fi defrag -v -f -clzo /var/log/journal/*/*