Monday, October 26, 2009

setting the Cadence environment variables from script (how to)?




NOTE: This script was tested, see the images above, you can change it according to your needs.

### setup.IC
# NC // Linux 64 bit Machine 
# to run this script switch from "bash" to "tcsh" OR "csh"
# Example:
# bash_linux_prompt:> tcsh (if not installed tcsh try "csh", else, install one of them, better is to install "tcsh".)
# to install: as root run this command: zypper in tcsh (see google how to install on opensuse) ;)
# tcsh(or csh)_linux_prompt:> source /setup.IC
# tcsh(or csh)_linux_prompt:> icfb &
# the CIW should start ...

# NOTES:
# =. After instalation make sure that you have the follow link in :
#    ln -s tools./platform/ tools
# =. Tooladmin's customizable .cdsinit should be in ${CDS_ROOT}/.cdsinit
# =. The follow line need to be present in $HOME/.cdsinit if you have to run Calibre
#    load("$MGC_HOME/shared/pkgs/icv.ss6/tools/queryskl/calibre.skl")


############################
##        Cadence         ##
## Custom IC Design Tools ##
############################


setenv OS_TYPE   `/bin/uname -s`
setenv HOSTNAME  `/bin/hostname`


#############
## License ##
#############

# NOTE: change the line bellow according to your needs (this is the license path?)
setenv CDS_LIC_FILE /usr/licensas/license_cadence.dat


###############
##  Cadence  ##
##   Setup   ##
###############

if ( $OS_TYPE == 'Linux' ) then
   version_:
# -------------------------------
   echo "=========================================="
   echo "        __== Owner /your_name/ ==__"
   echo "------------------------------------------"
   echo "Custom IC Design Tools ver. 5.1.41     [1]"
   echo "Custom IC Design Tools ver.  6.10      [2]"
#  echo "Custom IC Design Tools ver. ...        [3]"
#  echo "Custom IC Design Tools ver. ...        [4]"
   echo "------------------------------------------"
# -------------------------------
   echo " "
   echo -n "Select version ([q] - quit; default [1]): "
   set ver=$<
   echo " "
   echo "========================="
   echo "INFO: "
# -------------------------------
   if ( $ver == q ) then 
       echo "Exit: DONE!"  
       echo "========================="
       exit 1
   else if ( $ver == 1 || $ver == "" ) then
      setenv CDS_ROOT  /usr/tools/cad/cadence/ic5141/current
      set vername="IC 5.1.41"
      echo "The version is: $vername => License path is: CDS_LIC_FILE = $CDS_LIC_FILE"
      echo "Done!"
   else if ( $ver == 2 ) then
#   Note: configure the path for IC610 version ...
    echo " ---------------------"
    echo "NOTE: You haven't yet configured this script to run IC610 version!"
    echo " -->  Need your intervention!"
    echo "      Please, set the correct path CDS_ROOT and CDS_LIC_FILE (if needed)"
    echo " ---------------------"
#    setenv CDS_ROOT  where_is_your_ic610? 
#    setenv CDS_LIC_FILE 
    set vername="IC 610"
    echo "The version is: $vername => License path is: CDS_LIC_FILE = $CDS_LIC_FILE"
    echo "Done!"
# -------------- have more versions? --------
#   else if ( $ver == 3 ) then
#      setenv CDS_ROOT  
#    set vername="IC xyz"
#    echo "The version is: $vername => License path is: CDS_LIC_FILE = $CDS_LIC_FILE"
#   else if ( $ver == 4 ) then
#      setenv CDS_ROOT  
#    set vername="IC xyz"
#    echo "The version is: $vername => License path is: CDS_LIC_FILE = $CDS_LIC_FILE"
   else
      echo "Wrong version!"
      goto version_
   endif
endif
# ------------------------
#   Is your machine 64 BIT? (some feature in Cadence can be switched to 64 BIT /Layout, spectre, etc. see documentation/)
#   if ( $HOSTNAME == 'your_hostname_here' ) then
#      setenv CDS_AUTO_64BIT  ALL
#   else
#      setenv CDS_AUTO_64BIT  NONE
#   endif

echo " "
echo "========================="
#echo "Comment this if solved"
echo "Note: Try 'setenv LD_ASSUME_KERNEL 2.6.19'"
echo "Cadence set this variable in 'icfb' startup script"
echo "You should change it in the startup script"
echo "if not, the setenv is overwriten, resulting no effect!"
echo "========================="

### Variables
# ------------------------
setenv CDS_INST_DIR                    $CDS_ROOT/tools/dfII
setenv CDS_LIB_PATH                    ${CDS_ROOT}/tools/lib:${CDS_ROOT}/lib:${CDS_ROOT}/dfii/lib:${CDS_ROOT}/spectre/lib/mdl
setenv CDS_Netlisting_Mode             Analog                                ;# also can be: Digital or Compatibility
setenv CDS_NUM_USER_COLORS             85
setenv CDS_SITE                        $CDS_ROOT/share
setenv CDS_USE_PRIVATE_CAMP            True
setenv CDS_VHDL                        $CDS_ROOT/tools/leapfrog
setenv CLS_CDSD_COMPATIBILITY_LOCKING  NO
setenv SPECTRE_DEFAULTS                " +param $CDS_ROOT/tools/spectre/etc/limits/range.lmts"
setenv TNT_INST_DIR                    $CDS_ROOT


### Libraries
# ------------------------
if ( $?LD_LIBRARY_PATH ) then
    if ( $LD_LIBRARY_PATH == "" ) then
 setenv LD_LIBRARY_PATH ${CDS_LIB_PATH}
    endif
    if ( $LD_LIBRARY_PATH !~ *${CDS_LIB_PATH}*) then
 setenv LD_LIBRARY_PATH ${CDS_LIB_PATH}:${LD_LIBRARY_PATH}
    endif
else
    setenv LD_LIBRARY_PATH  ${CDS_LIB_PATH}
endif


### Mans
# ------------------------
if ( $?MANPATH ) then
    if ( $MANPATH == "" ) then
 setenv  MANPATH ${CDS_ROOT}/share/man:${CDS_ROOT}/tools/stream_mgt/man
    endif
    if ( $MANPATH !~ *${CDS_ROOT}/share/man*) then
 setenv  MANPATH ${CDS_ROOT}/share/man:${MANPATH}
    endif
    if ( $MANPATH !~ *${CDS_ROOT}/tools/stream_mgt/man*) then
        setenv  MANPATH ${CDS_ROOT}/tools/stream_mgt/man:${MANPATH}
    endif
else
 setenv  MANPATH ${CDS_ROOT}/share/man:${CDS_ROOT}/tools/stream_mgt/man
endif


### Paths
# ------------------------
if ( " $path" !~ *\ ${CDS_ROOT}/tools/bin\ * ) then
set path = ($CDS_ROOT/tools/bin $path)
endif
if ( " $path" !~ *\ ${CDS_ROOT}/tools/concice/bin\ * ) then
set path = ($CDS_ROOT/tools/concice/bin $path)
endif
if ( " $path" !~ *\ ${CDS_ROOT}/tools/plot/bin\ * ) then
set path = ($CDS_ROOT/tools/plot/bin $path)
endif
if ( " $path" !~ *\ ${CDS_ROOT}/tools/dracula/bin\ * ) then
set path = ($CDS_ROOT/tools/dracula/bin $path)
endif
if ( " $path" !~ *\ ${CDS_ROOT}/tools/dfII/bin\ * ) then
set path = ($CDS_ROOT/tools/dfII/bin $path)
endif

# ------------------------
# NOTES:
# =. After instalation make sure that you have the follow link in :
#    ln -s tools./platform/ tools
# =. Tooladmin's customizable .cdsinit should be in ${CDS_ROOT}/.cdsinit
# =. The follow line need to be present in $HOME/.cdsinit if you have to run Calibre
#    load("$MGC_HOME/shared/pkgs/icv.ss6/tools/queryskl/calibre.skl")

Friday, October 23, 2009

How to runas in Win's XP a program with Admin privileges without password prompt?

Solved such way:

1. Create a BAT file with the following content in the directory "C:\Program Files\Dir_with_program_to_run\your_program_name_to_run.bat": (create "your_program_name_to_run.bat")

@REM ======= your.bat file ======
@runas /user:Your_Administrator_name /savecred "C:\Program Files\Dir_with_program_to_run\your_program_name_to_run.exe"
@REM ======= fin your.bat file ======

2. I modified the path of the shortcut from Desktop to point to the created BAT file.

3. Start the shortcut (double click ;) ). You will be prompted for password only once.
Enter the Your_Administrator_name password.

4. Close the program, start the program again. Program should start without asking you for a password again.

Simple, isn't it? Enjoy!

Thursday, October 22, 2009

How to install the MS SQL server 2000 A (or SP3) on Win's XP (solved)

If you get errors when installing the SQL 2000 server release A, follow these steps:

1. In the directory where is the "setup.exe" I made the BAT file "setup.bat" with the following content:

@REM ===========
@echo off
@setup.exe SAPWD="replace_with_your_admin_password" USERNAME="Your_Admin_name" /l*v setup.log
@REM setup.log will be created in the current run directory
@REM ===========

2. Enter to c:\windows\inf, then right click on "mdac.inf" and select "Install" from the popup
If prompted for CD, insert it and go to [Your_CD-Drive]:\i386

3. Open the Start->ControlPanel->Administrative Tools->Services
find here service: Terminal Services
double click, and make it "Disabled" in the StartupType, click OK, then restart the system.

4. now run the "setup.bat" created at step (1.) to install.

5. Check the setup.log file (from where you started the "setup.bat") you should see this at the end of log file:
"MSI (c) (B0:DC) [20:24:49:734]: Product: Microsoft SQL Server Desktop Engine -- Installation operation completed successfully."

6. Enable the Terminal Services (step 3.) (select the StartupType: ---> Manual) and restart computer.

PS: If the installation freeze follow instructions from here

Saturday, October 17, 2009

How to reset root password?

How to reset/recover the ROOT password in openSUSE?

Don’t have to mention the panic that kicks in when you have forgot or misplaced your root user password. Like most other operating systems, openSUSE helps you to recover or reset the root password from the console.


Please try the following to reset/recover root password. This should work on openSUSE 11.0 & openSUSE 10.x (tested on openSUSE 10.3):


1. Boot the system and select the normal boot menu from the list. Once selected, in the “Boot Options” box type

“init=/bin/bash” if you are using GRUB Boot loader

“linux init=/bin/bash” if you are using LILO Boot Loader, then at the prompt enter:

bash$> password
New password:*****
Confirm password:*****

Password updated successfully!
bash$> reboot

Enjoy!

Friday, October 16, 2009

How to copy from host and to host with visual speed control?

============================

The scp provide the speed connection statistic when active ...

more details on WikiPedia

Copying file to host:
scp SourceFile user@host:directory/TargetFile
Copying file from host:
scp user@host:directory/SourceFile TargetFile

Image below from here


Monday, October 12, 2009

how to enable in Vista (etc ...) clipboard tricks

If you don't know what I'm talking about read this article.

you can make in windows such thinks:


ctrl+g => append to clipboard new selection
ctrl+d => empthy clipboard
win+s => show clipboard content

These all are possible with: AutoHotKey

Check this tutorial: Tutorial

The script is:

; this code below enable append clipboard content

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
^g::
clipboard = %clipboard%
ClipisSaved := clipboard
Send ^c
clipboard = %clipboard%
clipboard = %ClipisSaved%`r`n%clipboard%
;StringReplace, clipboard, ClipisSaved, 'n, clipboard
;MsgBox % ClipBoard
return

;this code below empthy clipboard
^d::
clipboard = ;
;MsgBox ClipBoard is Empthy!
return

;this code below show the content from the clipboard
#s:: MsgBox % ClipBoard

How to make the compilation faster (NetBeans) with NIS NFS server?

Hint:
We configured the NetBeans to store cache on local host (don't send on NIS).

To be continued ...

Friday, October 9, 2009

how to publish real html code on blog?

The code should be first encoded with HTML Encoder, after that inserted ;)

You can try with colors also Color Encoder

Before encode, html tags are executed (we want publish code!):

test page


After encode we can see all the code:

<html>
<title> Test </title>
<body>
<p>
Test page
</p>
</body>
</html>

how to pass php value to javascript?

Try this example: test.php

<?php
$test = 5;
echo 'OUTPUT: php_test='.$test;
?>
<html>
<body>
<script type="text/javascript">
test
= 3;
var test='<?php echo $test;?>';

document.write(
"js_test=" + test);
//alert("I am an alert box!");
</script>

</body>
</html>

Rezult:
OUTPUT: php_test=5 js_test=5

Eurica !

P.S.: The html tags can be published on blog if convert the code with HTML Encoder

The code should be first encoded with HTML Encoder, after that inserted ;)

You can try with colors also Color Encoder

Thursday, October 1, 2009

Redirect, Forward over ssh how to examples ...

===============
Example 1:
The user pinky enter in channel #users over ssh tunnel that start on localhost over 1234 TCP port and end on server.example.com (irc server) on port 6667 (standart IRC port)
# ssh -f -L 1234:localhost:6667 server.example.com sleep 10
# irc -c '#users' -p 1234 pinky 127.0.0.1

===============
Example2:
Multiple hops over ssh ...
# ssh -t user@server "ssh user@workstation2"
===============
Securing RDP with SSH tunnel

The SSH client software like PuTTY can be used connect to home SSH server from the office. From your computer at the office, SSH into the home "SSH Server" with PuTTY or by executing the following command from the prompt:

ssh –p ssh.port.number home.username@home.ip.address
You should now have a command prompt on the home "SSH Server". From there, execute the following command to enable traffic tunneling:

ssh -R 3390:home.ip.address:3389 -C -N office.username@office.ip.address
This will tunnel all traffic arriving from source office.username@office.ip.address port 3390 to destination home.ip.address port 3389. Now from your computer at the office, use your Remote Desktop client to connect to localhost:3390, this will connect you to the home computer. The Remote Desktop traffic will be tunneled over SSH. If localhost does not work, try to use 127.0.0.1:3390 on Windows XP SP1, or 127.0.0.2:3390 on Windows XP SP2. This is due to changes in TCP loopback interface that occurred in SP2.
===============