to activate logging at the netbackup client do:
#mkdir /usr/openv/netbackup/logs/bpbkar
#mkdir /usr/openv/netbackup/logs/bptm
#mkdir /usr/openv/netbackup/logs/bpcd
#mkdir /usr/openv/netbackup/logs/bpbrm
#chmod -fR 777 /usr/openv/netbackup/logs/
211/433
Month: January 2011
A Netra T1 SPARC running Windows98 using Qemu
I’ve been running Micro$oft Window$98 inside a Sparc system, using QEMU and running Solaris 10 as the host system.
The speed is actually usable.
Get the package from
http://www.martux.org/qemu/RELEASES/sparc/SUNWqemu-0.8.2,REV=2006.10.14-sol8-sparc-opt.pkg.gz
it’ll end up at /opt/SUNWqemu, to install windows you can use a iso image of your Window$98 cd and create
the virtual disk that will contain the OS as:
# /opt/SUNWqemu/bin/qemu-img create /w98.img 1000M
Then start the qemu emulator as:
# /opt/SUNWqemu/bin/qemu -hda /w98.img -m 128 -cdrom
/Windows98_Second_Edition_Full_Boot_From_Cd.iso -boot d
This will boot it to the Window$98 install iso image so you can install the OS.
123/433
share a printer to winxp from samba
To share a printer to the windows world you should:
Modify /etc/cups/cupsd. conf
<Location /printers/deskjet>
#Order Allow,Deny //comment
#Deny From All //comment
Allow From 127.0.0.1
Allow From 172.16.1.*
#AuthType None
Allow from All
</Location>
<Location />
#Order Deny,Allow
#Deny From All
Allow From 127.0.0.1
Allow From 172.16.1.*
</Location>
Browsing On
BrowseProtocols cups
#BrowseOrder Deny,Allow
BrowseAllow @LOCAL
Modify smb.conf, ensure the following is set:
printing = cups
printcap name = cups
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
guest ok = no
writable = no
printable = yes
printing = cups
public = yes
printer name = deskjet
Then I had this error:
lpr: unable to print file: client-error-document-format-not-supported
So we edit /etc/cups/mime.types and change:
application/vnd. cups-raw (string(0,<1B>E) + !string(2,<1B>%0B)) string(0,<1B>@) 238/433
(contains(0,128,<1B>%-12345X) + (contains(0,1024,”LANGUAGE=PCL”) contains(0,1024,”LANGUAGE = PCL”)))
to
application/vnd. cups-raw (string(0,<1B>E) + !string(2,<1B>%0B)) string(0,<1B>@) (contains(0,4096,<1B>%-12345X) + (contains(0,4096,”LANGUAGE=PCL”) contains(0,4096,”LANGUAGE = PCL”)))
Rename powerpath devices
Perhaps you want to use your own nomenclature, so the device names mean something to you.
You can do it this way:
# emcpadm renamepseudo -s emcpowerh -t emcpowerrh
This renames the device called emcpowerh, to be now called emcpowerrh
106/433
Setting a local NTP server and client
You want to synchronize your solaris servers? don’t have access to an atomic clock?
You must pick one of your solaris servers to be the time server, in this case i picked a sun server called “server”. You
will trust in this server’s clock to be correct most of the time.
At “server” do:
root@server# cd /etc/inet
root@server# vi ntp.conf
And paste this inside:
server 127.127.1.0 prefer
fudge 127.127.1.0 stratum 0
broadcast 224.0.1.1 ttl 4
enable auth monitor
driftfile /var/ntp/ntp.drift
statsdir /var/ntp/ntpstats/
filegen peerstats file peerstats type day enable
filegen loopstats file loopstats type day enable
filegen clockstats file clockstats type day enable
keys /etc/inet/ntp.keys
trustedkey 0
requestkey 0
controlkey 0
Then, start ntp:
root@server# /etc/rc2.d/S74xntpd start
Verify its status by checking the process and querying the server:
root@server# ps -ef | grep ntp
root 8339 6236 0 11:39:16 pts/6 0:00 grep ntp
root 6725 1 0 11:15:48 x y z 0:00 /usr/lib/inet/xntpd
root@server# ntpq -pn
remote refid st t when poll reach delay offset disp
==============================================================================
*127.127.1.0 .LCL. 0 l 1 64 377 0.00 0.000 10.01
224.0.1.1 0.0.0.0 16 – – 64 0 0.00 0.000 16000.0
now ON THE CLIENT MACHINE:
root@client# cd /etc/inet
root@client# vi ntp.conf
Paste the contents:
driftfile /var/lib/ntp/ntp.drift
server 150.250.250.18
Notice that 150.250.250.18 is the ip of the timeserver called “server”.
Now nitialize the ntp daemon:
295/433
root@client# /etc/rc2.d/S74xntpd start
Check if it’s running:
root@client # ps -ef | grep ntp
root 23579 1 0 11:20:12 x y z 0:00 /usr/lib/inet/xntpd
root 1054 18332 0 11:41:34 pts/8 0:00 grep ntp
root@client # ntpq -pn
remote refid st t when poll reach delay offset disp
==============================================================================
*150.250.250.18 .LCL. 1 u 4 64 377 18.83 0.473 1.80
That’s it!
now type the “date” command, and see the results!
296/
To re-attach a failed disk on VXVM
vxmend – recover plexes that are in a “DISABLED/RECOVER” state.
vxdiskadm option 1
(/usr/sbin/vxmend)
vxmend -o force off <plex>
vxmend on <plex>
vxmend fix clean <plex>
vxvol start <volume>
fsck the filesystems and mount them
This is Hiram Ruiz’s
219/433
Grow an ext3 Filesystem online
If you want to grow an ext2/ext3 filesystem online and resize2fs can’t do it, use “ext2online”
# ext2online /dev/mapper/my_vg-u10
This will grow the filesystem up to the maximum size the vg allows
thanks to Fergus O’Hea
107/433
Veritas vea java swing window displaying incorrectly in a ssh X11Forwarded session
I connect to a Solaris server using ssh, and turning “ForwardX11 yes” in my ssh client, as well as “X11Forwarding yes”
in my remote solaris server.
The X11 forwarding works fine, because i can exec and view remote solaris dtterms in my slackware machine.
The problem is with java swing apps, like Veritas vea, which, when run, is displayed, but in an incorrectly huge window
size, and with some parts not well redrawn, to the point that it is unusable. Also affected is the WebSphere console…
This is an old bug:
http://bugs.sun. com/bugdatabase/view_bug.do?bug_id=4374153
Everyone basically tells you to set these variables on your shell before executing vea:
NO_AWT_MITSHM=true
NO_J2D_DGA=true
export NO_AWT_MITSHM;export NO_J2D_DGA
But i tried it to no avail. What solved the problem for me was adding a line to my /etc/ssh/ssh_config like this:
ForwardX11Trusted yes
after this everything worked fine!
294/433
Netbackup 5.1 client on Solaris 10
If you push the netbackup client from the master server to a solaris 10 box it thinks it is solaris 8, so it writes entries to
/etc/inetd.conf
Solaris 10 does not have inetd but SMF, so the bpcd port is not activated, you can test by doing a telnet
localhost bpcd… it does not answer.
So you have to convert your /etc/inetd.conf file to SMF descriptors, you do so by running
# inetconv
You make sure it is imported by doing
# inetadm | grep -i bpcd
# telnet localhost bpcd
if you get a connection to the bpcd port you’re all set and you’re ready for backup/restore
🙂
228/433
Message delivery to a dahdi line using the Manager interface with asterisk-java
You want to deliver a message to a pots line, and you don’t trust callprogress in asterisk, so you implement a dialplan
that waits for a digit, then plays a message.
The dialplan, in /etc/asterisk/extensions_custom.conf is
[mimensaje]
exten => s,1(lbl_mensaje_0),Playback(nuevo_mensaje,noanswer)
exten => s,n,WaitForSilence(10,6,10)
exten => s,n,GotoIf($[“${WAITSTATUS}” = “TIMEOUT”]?lbl_mensaje_0:)
exten => s,n,Read(CONTEXT,nuevo_mensaje,1,ni,6,3)
exten => s,n,GotoIf($[“${READSTATUS}” != “OK”]?lbl_mensaje_1:)
exten => s,n,Playback(${elmensaje},noanswer)
exten => s,n,GotoIf($[“${PLAYBACKSTATUS}” = “SUCCESS”]?:lbl_mensaje_2)
exten => s,n(lbl_mensaje_2),Hangup()
exten => s,n(lbl_mensaje_1),Playback(self-destruct,noanswer)
exten => s,n,Goto(lbl_mensaje_2)
The java class that sends the message using that dialplan is:
import java.io.IOException;
import org.asteriskjava.manager.*;
import org.asteriskjava.manager.event.*;
import org.asteriskjava.manager.action. *;
import org.asteriskjava.manager.response.ManagerResponse;
public class HelloEvents1 implements ManagerEventListener
{
private ManagerConnection managerConnection;
String number=””;
String message=””;
int i=0;
public HelloEvents1() throws IOException
{
ManagerConnectionFactory factory = new
ManagerConnectionFactory(“localhost”,”adm”,”password”);
this.managerConnection = factory.createManagerConnection();
}
public OriginateAction setupOriginate(String n,String m) {
OriginateAction originateAction = new OriginateAction();
11/433
originateAction. setChannel(“DAHDI/1/”+n);
originateAction. setVariable(“elmensaje”, m);
originateAction. setContext(“mimensaje”);
originateAction. setExten(“10”);
originateAction. setActionId(n);
originateAction. setAsync(Boolean.TRUE);
originateAction. setTimeout(new Integer(30000));
return originateAction;
}
public void start() throws IOException, AuthenticationFailedException,
TimeoutException, InterruptedException
{
// register for events
managerConnection.addEventListener(this);
// connect to Asterisk and log in
managerConnection.login();
OriginateAction originateAction;
ManagerResponse originateResponse;
originateAction = new OriginateAction();
originateAction=setupOriginate(number,message);
originateResponse = managerConnection.sendAction(originateAction, 30000);
Thread.sleep(20000);
managerConnection.sendAction(new StatusAction()) ;
Thread.sleep(80000);
managerConnection.logoff();
}
public void onManagerEvent(ManagerEvent event)
{
// just print received events
// System.out.println(“——–“+event);
String e=””+event;
if (e.indexOf(“appdata='”+message+”,noanswer'”)>0){
System.out.println(“ISSY: Mensaje recibido<br>”);
System.exit(0);
}
if (e.indexOf(“CONTEXT”)>0||e.indexOf(“nuevo_mensaje”)>0){
i++;
System.out.println(“ISSY: Esperando a que digite 1 : “+i+” de 8 intentos<br>”);
}
if (i==8){
System.out.println(“ISSY: Mensaje no enviado, usuario no digito 1<br>”);
System.exit(1);
}
if (e.indexOf(“HANGUP”)>0){
System.out.println(“ISSY: Linea Colgada, mensaje no enviado<br>”) ;
System.exit(1);
}
}
public static void main(String[] args) throws Exception {
if (args.length<2){
System.out.println(“Usage: Call <number> <message>”);
System.exit(1);
}
12/433
HelloEvents1 hello = new HelloEvents1();
hello.number=args[0];
hello.message=args[1];
hello.start();
}
}
Enjoy!
13/433