db2greg -delinstrec instancename=db2inst1db2greg is a nice tool that lets you display and alter global registry. More at DB2 10.1 Info Center
ponedeljek, 1. julij 2013
How to drop a DB2 instance if instance owner does not exist anymore
Let's say that your instance owner was user db2inst1 and you removed it via OS tools. When you want to uninstall DB2 it complains that you have to drop db2inst1 instance. Running db2idrop gives you error, since user db2inst1 does not exist anymore. In this case you can use this:
Enable hibernate in Ubuntu 13.04
Follow these steps:
- open terminal
- sudo vi /var/lib/polkit-1/localauthority/50-local.d/hibernate.pkla
- paste these lines:
- reboot
- open terminal
- sudo vi /var/lib/polkit-1/localauthority/50-local.d/hibernate.pkla
- paste these lines:
[Re-enable Hibernate]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes
- reboot
torek, 25. junij 2013
NetBeans in maximized mode on Ubuntu 13.04
Today I upgraded my laptop (Dell Latitude E5520) to Ubuntu 13.04.
On there I'm also running NetBeans 7.3.1 on JDK 1.7.0_25. The problem I had was that when I maximized NetBeans the content of the window was not refreshed.
After testing several settings I found that setting sun.java2d.opengl=false fixed the problem.
Laptop is using Intel graphics card with a i915 driver. Maybe there is some kind of a problem between this setting and Java. I don't know.
On there I'm also running NetBeans 7.3.1 on JDK 1.7.0_25. The problem I had was that when I maximized NetBeans the content of the window was not refreshed.
After testing several settings I found that setting sun.java2d.opengl=false fixed the problem.
Laptop is using Intel graphics card with a i915 driver. Maybe there is some kind of a problem between this setting and Java. I don't know.
petek, 19. april 2013
Mouse not working after suspend in Ubuntu 12.04
If you mouse is now working after computer gets back from suspend try this:
- sudo vi /etc/pm/
sleep.d/ 20_custom- ehci_hcd:
#!/bin/sh
# File: "/etc/pm/sleep.d/ 20_custom- ehci_hcd" .
TMPLIST=/tmp/ehci- dev-list
case "${1}" in
hibernate| suspend)
;;
resume| thaw)
chvt 1
chvt 7
;;
esac
- sudo chmod 755 /etc/pm/
sleep.d/ 20_custom- ehci_hcd
četrtek, 28. marec 2013
Initialize DB2 environment in cmd
Usually when I want to work with DB2 on Windows I run db2cmd, so the DB2 environment gets initialized. However this does not work if I'm connected to a Windows machine via SSH, since db2cmd opens new cmd window.
Solution to this problem is typing "db2cmd -i -w db2clpsetcp" in cmd. Wihout quotes of course.
Solution to this problem is typing "db2cmd -i -w db2clpsetcp" in cmd. Wihout quotes of course.
sobota, 23. marec 2013
Ubuntu: Make F10 work in Midnight Commander
If you are using Unity and Midnight Commander in gnome-terminal then F10 gets send to the terminal program not the Midnight Commander.
Here are the steps to correct this:- install compizconfig-settings-manager
- run it
- go to "Ubuntu Unity plugin"
- disable "Key to open first panel menu"
- go to terminal menu Edit - keyboard shortcuts and disable "Enable the menu shortcut key (F10 by default)"
- paste this code into terminal (https://bugs.launchpad.net/ubuntu/+source/unity/+bug/726639/comments/18):
mkdir -p ~/.config/gtk-3.0
cat<~/.config/ gtk-3.0/ gtk.css @binding-set NoKeyboardNavigation {
unbind "F10"
}* {
gtk-key-bindings: NoKeyboardNavig ation
}EOF
Ubuntu: How to change the location of various default directories
If you want to change the location of the Desktop, Documents, Download, ... directories:
vi ~/.config/user-dirs.dirs
nedelja, 24. februar 2013
Finding bad blocks on hard drive in Linux
Run:
- sudo badblocks -v /dev/sda1 > bad.block
- sudo fsck -t ext4 -l bad.block /dev/sda1
badblocks is part of the e2fsprogs package in Ubuntu. The first command will find all bad blocks that you may have on /dev/sda1 and the second one will try to move data found in bad blocks to another place. If it can't then the file may be corrupted and lost.
petek, 22. februar 2013
Pass all script arguments to another script
When you want to pass all the input arguments to another script or program you can do it like this:
- in bash use "$@"
- in bat use %*
From Kubuntu to Ubuntu
Steps:
- sudo apt-get install ubuntu_desktop
- change display manager to lightdm as described in Change Linux display manager
- change lightdm greeter theme as described in Change lightdm greeter theme
- set ubuntu boot splash screen:
- sudo update-alternatives --set default.plymouth /lib/plymouth/themes/ubuntu-logo/ubuntu-logo.plymouth
- sudo update-alternatives --set text.plymouth /lib/plymouth/themes/ubuntu-text/ubuntu-text.plymouth
četrtek, 21. februar 2013
Change Linux display manager
You can have mulitple diplay manager installed at any time:
- gdm
- lightdm
- kdm
You can switch between them:
- if you have gdm running then use
sudo dpkg-reconfigure gdm
- if you have kdm running then use
sudo dpkg-reconfigure kdm
- if you have lightdm running then use
sudo dpkg-reconfigure lightdm
Change lightdm greeter theme
Run
sudo vim /etc/lightdm/lightdm.confand change
greeter-session=unity-greeterto
greeter-session=lightdm-gtk-greeteror something. There are multiply *-greeter packages you can install and use
Disable scrollbar overlay in Ubuntu
In 12.04:
gsettings set org.gnome.desktop.interface ubuntu-overlay-scrollbars false
In 12.10:
gsettings set com.canonical.desktop.interface scrollbar-mode normal
And to return to the default settings:
gsettings reset com.canonical.desktop.interface scrollbar-mode
All commands are run from console
gsettings set org.gnome.desktop.interface ubuntu-overlay-scrollbars false
In 12.10:
gsettings set com.canonical.desktop.interface scrollbar-mode normal
And to return to the default settings:
gsettings reset com.canonical.desktop.interface scrollbar-mode
All commands are run from console
Touchscreen calibration under Linux
If you have a touchscreen and want to caibrate it follow this steps:
- sudo apt-get install xinput-calibrator
- run it. You can run it from console or find it somewhere in your menu
- after calibration you will get an output in your console and the line you should copy looks something like this:
Option "Calibration" "77 3935 115 3984" - sudo vi /usr/share/X11/xorg.conf.d/10-evdev.conf and copy previous line in touchscreen section:
Section "InputClass" Identifier "evdev touchscreen catchall" MatchIsTouchscreen "on" MatchDevicePath "/dev/input/event*" Driver "evdev" Option "Calibration" "77 3935 115 3984"EndSection
I've used xinput_calibrator on Ubuntu 10.11 and 12.04.
sreda, 13. februar 2013
Where is GRUB installed on Linux system
If you want to know that use script located at http://bootinfoscript.sourceforge.net/
torek, 1. januar 2013
sreda, 14. november 2012
Running sudo command without password
What I found out is that running a command using sudo without entering password there are two options:
You can check what sudo priviliges you have using
- echo PASSWORD | sudo -S COMMAND
- adding following lineto /etc/sudoers:
username ALL=(ALL) NOPASSWD: COMMANDPlease note that this has to be after all group definitions.
You can check what sudo priviliges you have using
sudo -lFor this case this gives:
(ALL) ALLThis means that all command require password except for the COMMAND. If we would put the username definitin before group definitions sudo -l would give:
(ALL) NOPASSWD: COMMAND
(ALL) NOPASSWD: COMMANDThis would still require password for all commands.
(ALL) ALL
sreda, 7. november 2012
Find where code was changed in Mercurial
If you want to find out in which revisions a piece of code was changed then you can use a Mercurial command something like this:
hg grep --all PIECE_OF_CODE | awk 'BEGIN {FS=":"} {print $1" "$2}' | uniq
and you will get back a list of files with coresponding revisuin numbers:
repo/src/java/com/kovica/File1.java 30
repo/src/java/com/kovica/File1.java 10
torek, 6. november 2012
Remove empty lines from a file on Linux using command line
This one is especially useful when searching through Glassfish's log files.
There are many ways you can remove empty lines from a file:
There are many ways you can remove empty lines from a file:
- awk 'NF' file
- sed '/^$/d' file
- grep "^$" -v file
- grep . file
- egrep "^[[:space:]]?$" -v file
- perl -n -e 'print unless /^\s*$/' file
And I'm sure there are many more. :)
torek, 9. oktober 2012
Convert author in Mercurial repositiories
This is a summary of StackOverflow question http://stackoverflow.com/questions/12136895/change-the-author-in-mercurial-history
- cd repo1/.hg
- vi .hgrc and add
[extensions]
hgext.convert=
- cd $HOME
- vi authors.convert.list
USER1=USER2
- hg convert --authors $HOME/authors.convert.list repo1 repo1.NEW
- cd repo1/.hg
- vi .hgrc and add
[extensions]
hgext.convert=
- cd $HOME
- vi authors.convert.list
USER1
- hg convert --authors $HOME/authors.convert.list repo1 repo1.NEW
Naročite se na:
Objave (Atom)