search
Tuesday, January 26, 2016
komodo: Use custom version of the jshint
Komodo has an outdated version of the jshint. If you want to use, for example, moz:true option, you need to upgrade it. I tried it multiple times and never succeed. The problem was not in komodo (at least that was the developers say) but in jshint. All latest versions of the jshint does not work with komodo. The latest version of the jshint that is known to work with komodo is 2.6.0.
To configure komodo to use jshint 2.6.0, open File -> Preferences -> Syntax Checking -> Language: Javascript and point Custom linter to the downloaded file:
The version 2.6.0 is somewhere from the early 2015 but still much better then the default one.
Monday, December 14, 2015
fedora: Disable Komodo Edit file association
Remove
text/plain=komodo-edit-9.desktopfrom file
~/.local/share/applications/defaults.list
Thursday, December 10, 2015
bash: How to remove all *.pyc files
Remove all *.pyc files from the current directory (and subdirectories):
find . -name \*.pyc -delete
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;
BYOBU_DARK=black
BYOBU_LIGHT=white
BYOBU_ACCENT=cyan
BYOBU_HIGHLIGHT=cyan
MONOCHROME=white
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:
The content of the file can be something like:
gedit ~/.config/autostart/flux.desktop
[Desktop Entry]
Type=Application
Name=flux
Comment=xflux
Exec=/home/jsn/app/xflux -l 52.3837151 -g 4.8806328
Terminal=false
Tuesday, November 10, 2015
fedora: How to add user to sudoers
You can add user to the sudoers with command:
Log out is required.
usermod username -a -G wheel
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:
Make sure that it contains:
Check that on the server (remote machine) X11 forwarding is enabled. Open this file:
and check that it contains:
Now you can connect from your machine to the remote server with command:
Check with (env command) that environmental variable DISPLAY is something like localhost:10.0. If not, set it with command:
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:
This also might be useful:
vim ~/.ssh/config
Host *
ForwardX11 yes
vim /etc/ssh/sshd_config
X11Forwarding yes
X11DisplayOffset 10
ssh -Y your_name@server
export DISPLAY=localhost:10.0
xclock
google-chrome
google-chrome --user-data-dir=.chrome_profile
google-chrome --no-sandbox
Firefox can be launched just with:
firefox
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:
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:
Finish rebase:
git rebase -i HEAD~1
git commit --amend --author "Your Name <your.name@mail.com>"
git rebase --continue
Tuesday, September 15, 2015
How to unset environmental variable
For example, you set DJANGO=true environmental variable with command:
To unset it run this command:
export DJANGO=true
unset DJANGO
Sunday, September 13, 2015
How to display all available package versions in Ubuntu
To display all available package versions use next command:
apt-cache madisonFor example:
vagrant@vagrant:~$ apt-cache madison redis-server
redis-server | 2:3.0.2-3~bpo8+1 | http://http.debian.net/debian/ jessie-backports/main amd64 Packages
redis-server | 2:2.8.17-1+deb8u1 | http://security.debian.org/ jessie/updates/main amd64 Packages
redis-server | 2:2.8.17-1 | http://http.debian.net/debian/ jessie/main amd64 Packages
redis | 2:2.8.17-1 | http://http.debian.net/debian/ jessie/main Sources
redis | 2:2.8.17-1+deb8u1 | http://security.debian.org/ jessie/updates/main Sources
Friday, May 22, 2015
How to configure dnsmasq to forward all requests to specific address
For example you have a virtual machine, which you use for local development, and you want all requests to the sitesupport.net (name of the website that you are developing) forwarded to the virtual machine. We will use dnsmasq to achieve it.
Install dnsmasq:
Start it with command:
Check if it was started without any errors:
If there is an error that dnsmasq failed to start because port 53 is already in use, you can check what process listening this post with command:
If the process is dnsmasq itself it probably means that you have libvirt installed that has its own dnsmasq copy. To resolve that conflict we need to configure dnsmasq. Configuration file we are going to store in /etc/dnsmasq.d/vm.conf. By default dnsmasq uses file /etc/dnsmasq.conf for configuration. If you open that file, you will be able to see lots of examples and configuration descriptions. Lets left this file intact (almost) and allow dnsmasq to extent configuration with files from dnsmasq.d directory by adding (uncommenting) line:
Now create file /etc/dnsmasq.d/vm.conf with the following content:
The first line determines what interface dnsmasq will be listening. To check all available interfaces use command ifconfig.
Basicly you need to listen to localhost or 127.0.0.1. You can probably do it with:
The last line of the configuration file says that all requests to sitesupport.net (including subdomains, like super.sitesupport.net) will be redirected to 192.168.33.10 (that's my virtual machine).
Also you need to add to the file /etc/dhcp/dhclient.conf (or create the file if it does not exist):
You also need to restart your system. Instead of restarting the system you may try to restart following services:
To check that everything works correctly, use command:
The output should show that the request was redirected to 192.168.33.10.
Install dnsmasq:
sudo yum install dnsmasq
Start it with command:
sudo service dnsmasq start
Check if it was started without any errors:
sudo service dnsmasq status
If there is an error that dnsmasq failed to start because port 53 is already in use, you can check what process listening this post with command:
sudo netstat -tulpn | grep :53
If the process is dnsmasq itself it probably means that you have libvirt installed that has its own dnsmasq copy. To resolve that conflict we need to configure dnsmasq. Configuration file we are going to store in /etc/dnsmasq.d/vm.conf. By default dnsmasq uses file /etc/dnsmasq.conf for configuration. If you open that file, you will be able to see lots of examples and configuration descriptions. Lets left this file intact (almost) and allow dnsmasq to extent configuration with files from dnsmasq.d directory by adding (uncommenting) line:
# Include all files in a directory which end in .conf
conf-dir=/etc/dnsmasq.d/,*.conf
Now create file /etc/dnsmasq.d/vm.conf with the following content:
interface=lo
bind-interfaces
address=/sitesupport.net/192.168.33.10
The first line determines what interface dnsmasq will be listening. To check all available interfaces use command ifconfig.
Basicly you need to listen to localhost or 127.0.0.1. You can probably do it with:
listen-address=127.0.0.1
The last line of the configuration file says that all requests to sitesupport.net (including subdomains, like super.sitesupport.net) will be redirected to 192.168.33.10 (that's my virtual machine).
Also you need to add to the file /etc/dhcp/dhclient.conf (or create the file if it does not exist):
prepend domain-name-servers 127.0.0.1;
You also need to restart your system. Instead of restarting the system you may try to restart following services:
sudo service dnsmasq restart
sudo service NetworkManager restart
To check that everything works correctly, use command:
ping sitesupport.net
The output should show that the request was redirected to 192.168.33.10.
Thursday, May 21, 2015
vagrant: How to automatically update Guest Additions
To autmatically update Guest Additions on your vagrant machine you need to install vagrant-vbguest plugin. From the folder with Vagrantfile run the command:
Next time you start it with vagrant up, Guest Additions will be updated
vagrant plugin install vagrant-vbguest
Next time you start it with vagrant up, Guest Additions will be updated
Wednesday, May 20, 2015
fedora 21: How to add and preserve DNS server
Normally NetworkManager handels all DNS configuration. Every time when new network connection was established (?) it regenerates file /etc/resolv.conf which contains DNS server data, so editing this file is useless.
To add DNS server on top of the DNS servers list from your connections you need to create or edit file /etc/dhcp/dhclient.conf and add the following line:
Where 192.168.33.10 is address of DNS server.
After applying changes you need to reboot or restart NetworkManager service:
To add DNS server on top of the DNS servers list from your connections you need to create or edit file /etc/dhcp/dhclient.conf and add the following line:
prepend domain-name-servers 192.168.33.10;
Where 192.168.33.10 is address of DNS server.
After applying changes you need to reboot or restart NetworkManager service:
sudo service NetworkManager restart
Subscribe to:
Comments (Atom)

