Tuesday, July 28, 2015

vi

Complete list of color groups
:so $VIMRUNTIME/syntax/hitest.vim

Monday, July 20, 2015

๊Set up emacs for HTML editing with multiple browsers realtime preview

Install melpa in emacs.

<meta>x package-list-packages
<ctrl>s            <- to do incremental search  and then look for impatient
impatient

Use i to select impatient-mode for installation
and then x to install it.


To use it:
<ctrl>x+f
test.html

open/create test.html

and then
<meta>x httpd-start
<meta>x impatient-mode

Launch any browsers for preview and open localhost:8080/imp
select test.html

Start typing in test.html and the browser will always updated to reflect change in editing buffer.

Saturday, May 9, 2015

Friday, May 8, 2015

How to supporess Picked up JAVA_TOOL_OPTIONS Picked up JAVA_OPTIONS Picked up _JAVA_OPTIONS

Picked up JAVA_TOOL_OPTIONS:
Picked up _JAVA_OPTIONS:

These lines appear before any java program execution, if the environment variables with these names were set.  Remove it to supporess these ugly lines.

Windows:

set JAVA_TOOL_OPTIONS=

Linux

bash (default for Ubuntu, Debian, Redhat, CentOS, etc.)

unset JAVA_TOOL_OPTIONS

Install latest maven from apache

Since Ubuntu's repository comes with rather old version of maven, we need to install this from binary download from apache web site.

Here, we install latest version of 3.2.x which is 3.2.5 at the moment.
(linux diredory layout http://www.nixtutor.com/linux/understanding-the-linux-directory-layout/ )

Download from http://maven.apache.org/download.cgi

Install to /usr/lib/apache/maven/3.2.5

sudo mkdir -p /usr/lib/apache/maven/3.2.5

cd /usr/lib/apache/maven/3.2.5

sudo tar xvf ~/Downloads/apache-maven-3.2.5-bin.tar.gz

sudo mv apache-maven-3.2.5/* .

sudo rmdir apache-maven-3.2.5


Then we need to set environment variables.

add /usr/lib/apache/maven/3.2.5/bin to PATH

export MAVEN_HOME=/usr/lib/apache/maven/3.2.5



If we set environment variables in .bashrc, we will need to source the .bashrc file.

. ~/.bashrc

Check with :

mvn -ver

Wednesday, May 6, 2015

How to mount an lvm, volume from ubuntu livecd

Install lvm2 tool, if the distribution cd does not have it.  For 15.04, it's already there.
 
apt-get install lvm2

fdisk -lu

 
pvscan

vgscan

vgchange -a y


lvscan


Now, mount the volume to any directory you want.
 mount /dev/VolGroup00/LogVol00 /mnt

Tuesday, April 28, 2015

how to search packages that provides certain missing files in linux

repoquery --whatprovides \*gtkmm-2.4.pc

Install 3rd parties codecs in fedora

su -c 'yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm'

sudo yum update

sudo yum install gstreamer-plugins-bad gstreamer-plugins-bad-free-extras gstreamer-plugins-bad-nonfree gstreamer-plugins-ugly gstreamer-ffmpeg gstreamer1-libav gstreamer1-plugins-bad-free-extras gstreamer1-plugins-bad-freeworld gstreamer1-plugins-base-tools updates gstreamer1-plugins-good-extras gstreamer1-plugins-ugly gstreamer1-plugins-bad-free gstreamer1-plugins-good gstreamer1-plugins-base gstreamer1 x264

Then relaunch browser

Friday, April 24, 2015

How to fix ... System program problem detected Do you want to report the problem now? (Ubuntu)

This popup comes from apport.  It is a process that will collect and report and problem.  From Ubuntu wiki:

Apport is a system which

  •     intercepts crashes right when they happen the first time,
  •     gathers potentially useful information about the crash and the OS environment,
  •     can be automatically invoked for unhandled exceptions in other programming languages (e. g. in Ubuntu this is done for Python),
  •     can be automatically invoked for other problems that can be automatically detected (e. g. Ubuntu automatically detects and reports package installation/upgrade failures from update-manager),
  •     presents a UI that informs the user about the crash and instructs them on how to proceed,
  •     and is able to file non-crash bug reports about software, so that developers still get information about package versions, OS version etc. 
edit /etc/default/apport
Change enabled=1
to enabled=0

Then
sudo  /etc/init.d/apport restart

Thursday, April 23, 2015

How to set Ubuntu vmware guest screen resolution to 1920 x 1080

xrandr --newmode "1920x1080"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
xrandr --addmode Virtual1 1920x1080
xrandr --output Virtual1 --mode 1920x1080

Wednesday, April 22, 2015

How to copy fonts from Windows to Ubuntu

To make new fonts available system-wide on ubuntu, copy fonts into /usr/share/fonts using nautilus.

Nautilus has to be rooted.  Launch with:
gksu nautilus

We can create subdirectory to organize font files.

The system will automatically convert font to ubuntu format.

Next, clear the font cache with this command

sudo fc-cache -v -f

Done.

Tuesday, April 21, 2015

How to control (start/stop/enable/disable) services using systemd in linux

This applies to system using systemd to control service such as Fedora, Ubuntu 15.04, Centos, Debian (later version)

systemctl     - > list all services
systemctl status mysqld   -> check mysqld service status
systemctl {start|stop|restart|enable|disable} mysqld    -> perform service control

systemctl mask mysqld    -> mysqld cannot be started even manually.  Have to unmask

systemctl is-enabled mysqld   -> check if mysqld is enabled


systemctl isolate {multi-user.target|runlevel3.target}   -> switch to run level 3
systemctl isolate {graphical.target|runlevel5.target}    -> switch to run level 5

systemctl set-default <name of target>.target    -> set default target
systemctl get-default                                           -> get current target

systemctl list-units --type=target      ->   list of all possible targets

For further info
man systemd
or https://fedoraproject.org/wiki/Systemd

Saturday, April 18, 2015

How to activate networking after install centos 7 minimally

use nmcli & nmtui

nmcli         ; check the current networking device setting

nmtui         ; a text ui to configure network. use edit and check auto start networking, exit , done

Tuesday, April 14, 2015

How to type a special character?

To enter these, you follow the standard Unicode entry sequence:
Control + Shift + U, unicode hex (in lower case), Return

To find out the Unicode of a character, can use this web site.

http://www.babelstone.co.uk/Unicode/whatisit.html

Monday, March 30, 2015