Tag: Linux

~/.bashrc

export PS1='\[\e[0;34m\][\@]\[\e[m\] \[\e[0;36m\]\u@\h: \[\e[m\]\w $ '

alias chgrp='chgrp --preserve-root'
alias chmod='chmod --preserve-root'
alias chown='chown --preserve-root'

alias grep='grep --color=auto'

alias ll='ls -l'
alias ls='ls --color=auto'

alias h='history | grep'

# Show open ports
alias ports='netstat -tulanp'

# Lookup for process
alias psx='ps auxw | grep'

# History settings
export HISTFILESIZE=20000
export HISTSIZE=10000
shopt -s histappend

# Combine multiline commands into one in history
shopt -s cmdhist

# Ignore duplicates, and some commands
HISTCONTROL=ignoredups
export HISTIGNORE="&:ls:ll:cd:[bf]g:exit"
export HISTTIMEFORMAT='[%F %T] '

PATH=$PATH:~/bin
for d in ~/apps/*/bin; do PATH="$PATH:$d"; done
export PATH

export GREP_OPTIONS='-n -I --exclude-dir=.git --exclude-dir=.idea'
export JAVA_HOME=/usr/lib/jvm/java-8-oracle

Enable search suggestions in Firefox for Linux Mint

Unfortunately, 'out-of-the-box' Firefox under Linux Mint doesn't show suggestions when you type in search box.

How to fix:

  • download Firefox from mozilla.org
  • find google.xml in archive (firefox/browser/searchplugins)
  • copy this file to local firefox setting directory (in my case it was ~/.mozilla/firefox/mwad0hks.default/searchplugins)
  • restart browser
  • enable 'Provide search suggestions' box in search settings

Simplest way to create skeleton: maven + Spring MVC + Hibernate

Run maven:

mvn archetype:generate -DarchetypeGroupId=com.highwise -DarchetypeVersion=0.22 -DarchetypeArtifactId=weby -DgroupId=org.iblogger.lbn -DartifactId=demo -Dversion=1.0-SNAPSHOT -DinteractiveMode=false

(replace text in red with your own values)

You should get the following structure:

demo
├── pom.xml
└── src
    └── main
        ├── java
        │   └── org
        │       └── iblogger
        │           └── lbn
        │               └── demo
        │                   ├── model
        │                   │   ├── Authority.java
        │                   │   ├── Person.java
        │                   │   └── User.java
        │                   ├── service
        │                   │   └── RootUserCreatorService.java
        │                   └── web
        │                       └── PersonController.java
        ├── resources
        │   ├── hibernate.cfg.xml
        │   ├── hsqldb.properties
        │   ├── jdbc.properties
        │   ├── log4j.xml
        │   ├── mysqldb.properties
        │   └── oracle.properties
        └── webapp
            ├── css
            │   └── style.css
            ├── index.jsp
            └── WEB-INF
                ├── demo-servlet.xml
                ├── spring-basic-context.xml
                ├── spring-persistence-context.xml
                ├── spring-security-context.xml
                ├── tags
                │   ├── footer.tag
                │   ├── jquery.tag
                │   ├── menu.tag
                │   └── style.tag
                ├── views
                │   ├── addPerson.jsp
                │   └── allPersons.jsp
                └── web.xml

Now you can import project into Intellij IDEA (as is) or into Eclipse (execute mvn eclipse:eclipse -Dwtpversion=2.0 before importing) and start to edit code for your requirements.

Run project: mvn tomcat:run
URL: http://localhost:8080/demo

Enjoy!

Linux Mint: Wi-Fi disconnect

In case of regular Wi-Fi disconnection replace content of /etc/modprobe.d/iwlwifi.conf with the following one:
options iwlwifi wd_disable=0 bt_coex_active=0 11n_disable=1

It helped me in 'Linux Mint 17 (Qiana)' with 'Intel Corporation Centrino Wireless-N 130 [8086:0896] (rev 34)' adapter.

Useful aliases and settings for .bashrc

alias chgrp='chgrp --preserve-root'
alias chmod='chmod --preserve-root'
alias chown='chown --preserve-root'

alias grep='grep --colour=auto'

alias ll='ls -l'
alias ls='ls --color=auto'

# Show open ports
alias ports='netstat -tulanp'

# Lookup for process
alias psx='ps auxw | grep '

# History settings
export HISTFILESIZE=20000
export HISTSIZE=10000
shopt -s histappend

# Combine multiline commands into one in history
shopt -s cmdhist

# Ignore duplicates, ls without options and builtin commands
HISTCONTROL=ignoredups
export HISTIGNORE="&:ls:ll:[bf]g:exit"

Gnome Commander & SMB

После установки, Gnome Commander не поддерживает доступа к win-сети.
К счастью, лечится это просто:

sudo apt-get install libgnomevfs2-extra