Sunday, November 15, 2015

firefox: Enable tracking protection for normal session

Firefox 42 includes very interesting feature - Tracking protection. By default it is active only in the Private mode. When the Firefox team presented a new video that described the usage of the Memory tab in the Developer toolbar, they show that the CNN website normally consumes about 40 Mb of memory and with Tracking protection on it consumes about 10 Mb. If you want to enable this feature not only for the private sessions, but also for the normal sessions, you can do that by typing about:config in the address bar and changing the value of the privacy.trackingprotection.enabled to true: There is also a really interesting setting privacy.trackingprotection.updateURL, which means, that, I believe, you can host your own tracking protection list (See shavar project, blocking list format is here). When Tracking protection has blocked some resources, it shows a shield icon near the address bar. If you open the Developer console (F12 or Ctrl+Shift+K) you can see what resources were blocked: Together with AdBlock extension it could be a nice way to improve your browsing expierence.

Change colours in byobu

Colour settings file for the byobu located in the folder ~/.byoubu, if you use tmux, it will be color.tmux:
BYOBU_ACCENT - is the colour of the window delimiter; BYOBU_HIGHLIGHT - is the colour of the current highlighted window; MONOCHROME - background colour of the window title in the bottom panel;

fedora: Automatically start application during the boot

To start an application automatically in fedora, you need to create a *.desktop file in the directory ~/.config/autostart, for example:
gedit ~/.config/autostart/flux.desktop
The content of the file can be something like:
[Desktop Entry]
Exec=/home/jsn/app/xflux -l 52.3837151 -g 4.8806328

Tuesday, November 10, 2015

fedora: How to add user to sudoers

You can add user to the sudoers with command:
usermod username -a -G wheel
Log out is required.

Wednesday, October 7, 2015

How to open browser (Chrome, Firefox) on the remote machine via terminal

You can open a chrome window on the remote machine via terminal with X11 forwarding. First of all, some configuration needs to be done. Open on your machine (client) ssh configuration:
vim ~/.ssh/config
Make sure that it contains:
Host *
  ForwardX11 yes
Check that on the server (remote machine) X11 forwarding is enabled. Open this file:
vim /etc/ssh/sshd_config
and check that it contains:
X11Forwarding yes
X11DisplayOffset 10
Now you can connect from your machine to the remote server with command:
ssh -Y your_name@server
Check with (env command) that environmental variable DISPLAY is something like localhost:10.0. If not, set it with command:
export DISPLAY=localhost:10.0
To check that everything was set up correctly, run on the remote server:
You should be able to see a window of the xclock application. Now you are ready to run chrome with command:
I had some permission issue that prevented chrome from starting, I managed to fix it by changing user data directory:
google-chrome --user-data-dir=.chrome_profile
This also might be useful:
google-chrome --no-sandbox 
Firefox can be launched just with:
Make sure that you have permissions for the .mozilla and .cache directory on the remote machine

git: How to change the author of the commit

If you want to change the author of the specific commit (for example the latest one), run rebase command:
git rebase -i HEAD~1
HEAD~1 points to the latest commit, but it can be a commit id or branch name. To mark a commit for edit, replace `pick` with `e`: Replace commit author:
git commit --amend --author "Your Name <>" 
Finish rebase:
git rebase --continue

Tuesday, September 15, 2015

How to unset environmental variable

For example, you set DJANGO=true environmental variable with command:
export DJANGO=true
To unset it run this command:
unset DJANGO