Showing posts with label unix. Show all posts
Showing posts with label unix. Show all posts

Sunday, September 09, 2012

list processes running in MySQL

login to mysql as a root:
mysql -uroot -p
end execute:
mysql> show processlist;
will show you list of processes running in MySQL
and using  \G delimiter will present processes in more readable format.
mysql> show processlist \G

Provided by: ForthScale systems, scalable infrastructure experts

Friday, July 27, 2012

Force ssl in nginx with redirect

Just edit your site configuration file make sure you have a site setup for HTTPS - SSL (port 443)
edit the portion for HTTP:


server {
    listen      80;
    server_name server.yourdomain.tld;
    rewrite     ^   https://$server_name$request_uri? permanent;
}

save and restart nginx
Provided by: ForthScale systems, scalable infrastructure experts

Monday, July 09, 2012

Adding ( passing) linux system variable to Tomcat.

Sometimes you need to pass system variables to applications running in tomcat environment. those could b for example configuration files.
Trying to pass them to start-up script as variables such as 

export TOMCAT_OPTS=-Your.var=foo
will set it in the system shell and will not pass it to the tomcat on it`s start since it runs as a different user.
Java`s System.getEnv("Your.var")
Will return: NULL value.
You need to edit relevant tomcat.conf (tomcat6.conf for example in /etc)
and add:
export Your.var=foo
to the end of file
You can check that variable s set with System.getEnv("Your.var") in you java code.



Provided by: ForthScale systems, scalable infrastructure experts

Friday, June 15, 2012

Fixing SSH Daemon - Authentication refused: bad ownership or modes for directory

Then you are unable to connect to your ssh server with your PEM (or PPK) key with connection refused message check the /var/log/auth.log file.
If you see something similar to:
sshd: Authentication refused: bad ownership or modes for directory /Your/Home/Path
You have a home directory permission problem.
change to that user if not already one and execute:
chmod go-w ~/
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys 
It will restore your permissions and you should be able to connect.

 Provided by: SiQ systems, Cloud experts

Wednesday, January 25, 2012

Adding global DNS servers

Sometimes you need to preconfigure your servers for dns resolution and you are not sure what local DNS addresses will be or just to use backup dns servers for resolution.
Here is small list of globally accessible DNS servers:

nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 210.80.60.1
nameserver 210.80.60.2
nameserver 208.67.222.222
nameserver 208.67.220.220

Tuesday, January 24, 2012

NTP servers for Israel

For Israeli NTP servers you can use: il.pool.ntp.org

Since there are not enough servers in this zone, we recommend you buck up by use the Asia zone (asia.pool.ntp.org):

server 0.asia.pool.ntp.org
server 1.asia.pool.ntp.org
server 2.asia.pool.ntp.org
server 3.asia.pool.ntp.org

Provided by:SiQ systems, Cloud experts

Sunday, May 24, 2009

Searching for a pattern string under a directory

In order to search for a pattern string in all files under a specific directory you can use following command:
find $dir -exec grep $pattern {} \; -print
just replace $dir with the directory you want to start searching in and $patter with patter you are searching for.
for example:
find /etc -exec grep support {} \; -print

Tuesday, July 15, 2008

unix backup with tar and mt

Rewind tape drive:# mt -f /dev/st0 rewind
Backup directory /www and /home with tar command (z - compressed):
# tar -czf /dev/st0 /www /home

Find out what block you are at with mt command:
# mt -f /dev/st0 tell

Display list of files on tape drive:
# tar -tzf /dev/st0

Restore /www directory:
# cd /
# mt -f /dev/st0 rewind
# tar -xzf /dev/st0 www

Unload the tape:
# mt -f /dev/st0 offline

Display status information about the tape unit:
# mt -f /dev/st0 status

Erase the tape:
# mt -f /dev/st0 erase
You can go BACKWARD or FORWARD on tape with mt command itself:
(a) Go to end of data:
# mt -f /dev/nst0 eod

(b) Goto previous record:
# mt -f /dev/nst0 bsfm 1
(c) Forward record:
# mt -f /dev/nst0 fsf 1

Thursday, July 10, 2008

deleting message from postfix queue

To list the queue execute:
mailq
You can find the problematic messages id and the execute:

find /var/spool/postfix -name "messegeID" | xargs rm

Sunday, October 14, 2007

bmc configuration manager ( marimba ) cli runchannel return codes

those are CLI return codes for marimba runchannel on UNIX.
The return codes are 0, for success, and -1 through -12, for failure, as described below.
0 - runchannel -help was requested (and provided). A channel was started and completed an operation successfully.
1 - In the tuner's installation directory, the properties.txt file was missing from the lib/tuner/ directory. There was an incorrect runchannel command-line argument. An exception occurred while trying to start the tuner. There were notifications related to channel exceptions, RPC Disconnects, or RPC timeouts.
2 - An unexpected exception was caught. An associated stack trace gives more details. If you see this code while publishing a signed channel, then make sure that the cert DN (certificate's distinguished name) is specified correctly.
3 - Command was canceled.
4 - I/O error. Log entries should give more details, but this error can mean that the command failed to get data channel properties (that is, a communication problem between the endpoint and transmitter exists). This error can also mean that the command failed to move internal directories in or out during a publish or install operation.
5 - Publish error. A publish or unpublish command failed in the publish process. The actual error is described in the logs.
6 - Cleanup error. Not currently used.
7 - Update error. An install or uninstall command failed in the installation process. The actual error is described in the logs.
8 - Concurrency error. This error can occur only when the application is used as a library. The same instance of a kernel was used to perform multiple publish or installation commands simultaneously.
9 - Exec error. An error occurred while trying to execute a pre- or post- installation command.
10 - Unsigned error. Not currently used. Attempting to install a channel that is not properly signed returns a -3 (canceled) code, but a log entry indicating that the channel was not signed correctly also exists.
11 - Unknown error. This error should not be returned. If this error is returned, the logs contain entries indicating the problem.
12 - No-such-channel error. An error occurred while getting the data channel list from a transmitter. When installing, the data channel is what the application publishes to the transmitter during a publish command.

Provided by:SiQ systems, Cloud experts

how to restore system user in oracle and lock it back

Following instructions will help you unlock the oracle db system user and lock it back when needed.
Those are the instructions:
1) login to a machine as user oracle
2) connect to sqlplus: sqlplus '/ as sysdba'
3) unlock user: alter user system account unlock;
4) change password: alter user system identified by manager;
5) verify connection: conn system/manager
6) restore password: ALTER USER system IDENTIFIED BY VALUES 'F2B917B76C7DFF0A';
7) lock user: alter user system account lock;
8) verify lock: conn system/manager
you should see the following message: ERROR: ORA-28000: the account is locked

how to locate oracle SID on linux / unix machine

Log into a UNIX or Linux machine as root.
execute: ps -ef |grep -i pmon
you should see something like that:
oracle 27161 1 0 Mar07 ? 00:03:53 ora_pmon_ODS
then ODS is a SID of that oracle.

2026. What I Actually Do Now

It’s been over 20 years of on-and-off dumping into this blog. 27 and going years in tech, more than 10 years around AI, going back to Heili ...