bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory

Macintosh-3:~ user$ ssh root@vps.server.com
root@vps.server.com’s password:
Last login: Sun Sep  7 17:07:46 2014 from x.x.x.x
-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
[root@vps ~]# locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.utf8
LC_CTYPE=UTF-8
LC_NUMERIC=”en_US.utf8″
LC_TIME=”en_US.utf8″
LC_COLLATE=”en_US.utf8″
LC_MONETARY=”en_US.utf8″
LC_MESSAGES=”en_US.utf8″
LC_PAPER=”en_US.utf8″
LC_NAME=”en_US.utf8″
LC_ADDRESS=”en_US.utf8″
LC_TELEPHONE=”en_US.utf8″
LC_MEASUREMENT=”en_US.utf8″
LC_IDENTIFICATION=”en_US.utf8″
LC_ALL=
[root@vps ~]# vi /etc/sysconfig/i18n 

LANG=”en_US.utf8″
LC_CTYPE=”en_US.utf8″
LC_ALL=”en_US.utf8″

[root@vps ~]# source /etc/sysconfig/i18n
problem solved 🙂

How to reproduce ORA-04031

You are able to reproduce the ORA-04031 with shared pool depletion by pin dbms_shared_pool procedure by all the cursor on the SGA as shown below, it prohibits the release.
 

 conn / as sysdba
declare
i number;
j char (30);
sqlstr varchar2 (100);
cursor cur_pin is
select rawtohex (address) | | ',' | | to_char (hash_value)
from sys.v_ $ sql where kept_versions = 0;
rec_pin varchar2 (1000);
begin
i: = 1;
loop
loop
i: = i +1;
exit when i mod 1000 = 0;
sqlstr: = 'select''' | | i | |'' 'from dual';
execute immediate sqlstr into j;
end loop;
open cur_pin;
loop
fetch cur_pin into rec_pin;
exit when cur_pin% notfound;
dbms_shared_pool.keep (rec_pin, 'x');
end loop;
close cur_pin;
end loop;
end;
/ 
 
Source: http://www.doppo1.net/oracle/trouble/ORA-04031.html

No buffer space available (maximum connections reached?)

Caused by: java.net.SocketException: No buffer space available (maximum connections reached?): connect

This is most likely due to the number of ephemeral TCP ports being exhausted, the server has too many active client connections due to which the ephemeral TCP ports are all used up and in this case no more ports can be allocated to a new client connection request resulting in the behaviour we see here that no new connections can be setup.

Quoting from Wikipedia entry:
http://en.wikipedia.org/wiki/Ephemeral_port

“Ephemeral port is a transport protocol port for Internet Protocol (IP) communications allocated automatically from a predefined range by the TCP/IP Stack Software. It is typically used by the TCP, UDP or SCTP as port for the client end of a client-server communication when the application doesn’t bind the socket to a specific port number, or by a server application to free up service’s well known listening port and establish a service connection to the client host. The allocations are temporary and only valid for the duration of the connection. After completion of the communication session the ports become available for reuse, although most implementations simply increment the last used port number until the ephemeral port range is exhausted.”

This is a known issue on Windows boxes, a hotfix is available from Microsoft: “Kernel sockets leak on a multiprocessor computer that is running Windows Server 2008 R2 or Windows 7” – http://support.microsoft.com/kb/2577795

http://rwatsh.blogspot.be/2012/04/resolution-for-no-buffer-space.html
http://dbaktiar-on-java.blogspot.be/2010/03/hudson-shows-buffer-space-available.html

HOW TO: Disable DNS caching

For Solaris:
To disable the DNS cache on Solaris
1. Edit the file /etc/nscd.conf as follows:
a. un-comment the line # enable-cache hosts no.
b. add the line enable-cache ipnodes no after the line above.
2. To activate the changes, restart the nscd daemon by typing the command:
$ svcadm restart svc:/system/name-service-cache

For AIX:
To disable the DNS cache on AIX 6.1
DNS caching is managed by the network caching daemon (netcd).
1. stop the network caching daemon : #stopsrc -s netcd
2. prevent the network caching daemon from starting at boot time, edit the file /etc/rc.tcpip:
a. comment the line for the netcd daemon as follows:
# Start up binld daemon
#start /usr/sbin/binld “$src_running”
For more information see IBM Technote T1010925

For Linux:
To disable the DNS cache on Linux
1. Edit the file /etc/nscd.conf as follows:
a. un-comment or update the line to reflect: enable-cache hosts no
2. To activate the changes, restart the nscd daemon by typing the command:
# service nscd restart
3. Make sure the dnsmasq service not running:
a. stop the service : # service dnsmasq stop
b. disable the service from starting at boot time :
# chkconfig dnsmasq off
# chkconfig –list dnsmasq
dnsmasq         0:off   1:off   2:off   3:off   4:off   5:off   6:off
#

Use your arrow keys in AIX KSH

  • login as root
  • open /root/.kshrc (change /root in caes you change the home dir of root)
  • add the following

set -o emacs
alias __A=`echo “20”`     # up arrow = ^p = back a command
alias __B=`echo “16”`     # down arrow = ^n = down a command
alias __C=`echo “06”`     # right arrow = ^f = forward a character
alias __D=`echo “02”`     # left arrow = ^b = back a character
alias __H=`echo “01”`     # home = ^a = start of line
alias __Y=`echo “05”`     # end = ^e = end of line

  • save the file
  • logout
  • login and you can make use of the arrow keys

Mount SMB Network Drive permanently

How to mount a smb network drive permanently in Mac OS X:

1. Mount drive in Finder
2. Go to System Preferences > System > Users & Groups > your account > Login items tab
3. Add the SMB drive in the list of objects as if it was an application

Allow Excel 2010 to open separate windows.


There is no real trick to getting Excel 2010 to open two screens side by side.  There’s many tricks out there but none seem to work properly, if at all.  Registry hacks can work but then other problems can arise and you need to fix those issues.  Then you get in deep over your head and need to call a technician.  Embarrassed to say what you did, the technician maybe racking up the hours trying to fix the registry because you probably didn’t back it up first.
It’s simple, have a shortcut to Excel on your desktop.  Not a shortcut to the individual files, but a shortcut to the main Excel 2010 program.  Open Excel, click File and open your file.  Next, minimize that Excel document or move it to your other screen, out of the way so you can see the shortcut to Excel 2010.  Open the second instance of Excel 2010 via the shortcut on your desktop.  The second window comes up blank and available for you to go to File and open your second spreadsheet file.
Now you have two windows/instances of Excel 2010 at the same time which you can either overlap, side by side on same screen, or if you have two monitors, you can have one on each monitor.

Source: http://blog.twinbytes.ca/2012/10/25/excel-2010-open-separate-windows/