ohmkara 1.0

a technical blog.

Archive for the ‘my notes’ Category

fvwm + xscreensaver

leave a comment »

For xscreensaver to work, a daemon process has to be running in the background. I load it up with the following line in my ~/.xinitrc

xscreensaver -no-splash &


Written by deepak

April 15, 2010 at 8:55 pm

Posted in linux, my notes

linux screen resolution

leave a comment »

I have just started using FVWm2 @ home but everytime I login, X was going into weird screen resolutions — the solution is available here: @Ubuntu wiki

The following works — adding

xrandr -s 1152×864

to your ~/.xprofile file (ya, I know, wierd resolution — more on that in another post, if ever)

Written by deepak

April 15, 2010 at 8:49 pm

Posted in linux, my notes

how long did it take?

leave a comment »

How to measure how long it took to run a command — to benchmark etc. in linux / unix etc.

…]$ time command

Online man-page

Written by deepak

January 26, 2010 at 9:07 am

Posted in linux, my notes, tools

Tagged with

wireless ad-hoc network

leave a comment »

Try with static IP setting if you are un-able to logon to a wireless ad-hoc network. IP setting over DHCP did not work whenever I tried…. Maybe I am trying wrong.

Thanks to my roomie for this gyaan.

Written by deepak

January 26, 2010 at 8:59 am

Posted in my notes

Tagged with

split / join files in linux

leave a comment »

I was looking for a way to split and join files in linux.

“split” command splits — online man

“join” command joins — online man

Another way to join files is (say join two files file1, file2 to a combinedfile)

cat file1 file2 > combinedfile

You can specify sizes. Ex. If you want to split a bigfile (of size 820Mb) to an 700Mb file and the rest

the following ‘may’ work

split -b 734003200  bigfile

And so on see the manpage

Written by deepak

January 26, 2010 at 8:53 am

Posted in linux, my notes, tools

Tagged with

‘spice’ up linux

leave a comment »

To spice in linux I recommend ngspice (and post processor ngnutmeg).

# yum install ngspice

should install this (at-least on fedor10).

This page – link – tells what you need to know to get the tool-flow going — A ngspice / ngnutmeg basic how-to / tutorial.(explained in a simpler manner than in man pages)

Just a suggestion on top of link, entering stuff in nutmeg interactive session takes time, better type up a nutmeg command card file like

set hcopydevtype=postscript
hardcopy plot.ps i(vids)

Then you can call it up as

ngnutmeg raw_file.raw < nutmeg_command_card_file

It is faster going this way or so I feel.

Written by deepak

January 14, 2009 at 12:33 pm

Posted in links, my notes, tools

Tagged with

spice mosfet parameter annotator perl script

leave a comment »

This is a very crude perl script (perl experts might have a heart-attack if they read this) but it works (I am just starting to learn perl).

What does it do?

Input: Spice code in which mosfets have only L and W specified — ether in nm,um or lambda units. Does not work if you have already specified AD,AS,PD,PS for some mosfet’s but that is a trivial expansion – do if you want to.

Output: Fully annotated code with AD,AS,PD,PS parameters and lambda to units conversion done for mosfet lines.

The Script: spice_fet.pl

use warnings;
use strict;
# spice_fet.pl (v0.9)
# functionality: To automatically annotate spice file with the AS,AD,PS,PD parameters
# 	Input spice file L and W could be in
# 	1) no units -- implying lambda based line
# 	2) n or u -- nm or um units
# Note: 1) please set the technology node variable $x in the first line of code
# 	2) equations used are as follows if different change it in code
# 	AS=AD=(5*$x*width)
# 	PS=PD=((10*$x) + (2*width))
# Author: deepak
# Timestamp: Wed 14 Jan 2009 08:08 AM

my $x=120e-9;	#my technology node
my $lambda_flag=0;

sub strip	#convert l,w to floating point numbers
{		#and see if the line is lambda based
	my $a=$_[0];
	my $a_int=$a;
	if($a =~ m/(d+)n/i)	#l/w in units of n(m)
	{	$a_int = $1*(1e-9);	}
	elsif($a =~ m/(d+)u/i)	#l/w in units of u(m)
	{	$a_int = $1*(1e-9);	}
	else			#lamda based design
		$a_int *= $x;
		$a *= $x;
		$lambda_flag=1;	#flags the design as lambda based
	return $a_int;
if(($ARGV[0] eq "-h")|($ARGV[0] eq "--help"))	# if help requested
{	#print usage and exit;
	print "usage-- n spice_fet  n";
	exit 0;
open FILE_IN,"","annotated.sp" or die $!;	#open output file -- annotated.sp
	# ex line1: M1 1 2 0 0 N_50n L=120n W=120n
	# ex line2: Mnmos1 net1 net2 net3 net4 model_nmos_120 L=240n W=240n
	# ex line3: M1 1 2 0 0 N_120n L=2 W=6 	-- lambda based line
	my $line;
	if($_ =~ m/M([w s]+)L=(w+)(s+)W=(w+)/i)
		my $l_int = strip($2);	#pass L parameter
		my $w_int = strip($4);	#pass W parameter
		my $ad = (5*$x*$w_int);
		my $as = $ad;
		my $ps = ((10*$x)+(2*$w_int));
		my $pd = $ps;
		if($lambda_flag==1)	#if the line looks like lambda based make it normal
		chomp $_;
		$_ = $_." AD=$ad AS=$as PD=$pd PS=$ps	*annotated by spice_fet.pln";
	print FILE_OUT $_;

It can definitely be optimised but I did not much care about optimization (point of diminishing return).

Written by deepak

January 14, 2009 at 12:07 pm

Posted in my notes, scripts, tools

Tagged with ,