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
Uncategorized
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
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
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/
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
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”)))
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
netbackup client logging
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
Building a VPN with ppp over ssh within 2 linuxes
To build a Virtual Private Network within two remote machines, you might follow the howto at
http://www.tldp. org/HOWTO/VPN-HOWTO/index.html
which is very detailed, or, if you have two slackware 10.x
with default 2.4.x kernels, just use the procedure described in this document.
This OBSOLETES the ssh reverse telnet entry previously detailed in this blog.
Requirements:
– 2 machines, machineA and machineB.
– machineA will be the ppp client and machineB the ppp server
– machineA MUST have access to machineB through ssh.
– pty-redir in machineA from http://www.shinythings.com/pty-redir/
– No extra ethernet interfaces needed.
At machine A:
Make a file at /scripts/rtelnet/rt.ksh with contents:
#!/bin/bash
ADATE=`date “+%Y-%m-%d-%H:%M”`
PS=`ps -ef | grep -v grep |grep ppp | wc -l`
if [ $PS -gt 0 ]; then
echo “no need to retunnel $ADATE” >> /dev/null
else
echo “now retunneling ppp: $ADATE” >> /root/rtelnet.log
K=`ps -fe | grep ssh | grep -i Batchmode | awk ‘{ print $2 }’`
kill -9 $K >> /root/rtelnet.log
/usr/sbin/pty-redir /usr/bin/ssh -C -t -e none -o ‘Batchmode yes’ vpn@machineB > /tmp/vpn-device
sleep 10
/usr/sbin/pppd `cat /tmp/vpn-device` 192.168.40.253: 192.168.40.254
fi
You can choose 192.168.x.x addresses or 172.16.x addresses at your own will…
Then make a link to this file at /etc/cron.hourly:
machineA# ln -s /scripts/rtelnet/rt.ksh /etc/cron.hourly/rt.ksh
At machine B:
Create user vpn with shell /usr/sbin/pppd, and allow him to execute pppd:
machineB# useradd -d /home/vpn -m vpn -s /usr/sbin/pppd
machineB# mkdir -p /home/vpn/.ssh; chown vpn /home/vpn/.ssh
machineB# chmod u+s /usr/sbin/pppd
At machine A:
Copy a ssh key to allow root to login as user vpn in machine B
machineA# scp /root/.ssh/id_dsa.pub machineB:/home/vpn/.ssh/authorized_keys
At machine B:
machineB# chown vpn /home/vpn/.ssh/authorized_keys
machineB# chmod -fR 700 /home/vpn/.ssh
Edit /etc/ppp/options, and make sure you have enabled:
noauth
proxyarp
ipcp-accept-local
ipcp-accept-remote
You might then run the script manually at machineA:
machineA#/scripts/rtelnet/rt.ksh
Or wait until the crontab executes it hourly.
You can see the results as having a ppp interface when you type ifconfig -a:
machineA# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:11:43:01:BF:97
inet addr:150.100.106.32 Bcast:150.100.106.255 Mask:255.255.255.0
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1442299 errors:0 dropped:0 overruns:0 frame:8
TX packets:791769 errors:0 dropped:0 overruns:0 carrier:0
collisions:108549 txqueuelen:1000
RX bytes:725406260 (691.8 Mb) TX bytes:113886692 (108.6 Mb)
Interrupt:11
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:7662 errors:0 dropped:0 overruns:0 frame:0
TX packets:7662 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:9507700 (9.0 Mb) TX bytes:9507700 (9.0 Mb)
ppp0 Link encap:Point-to-Point Protocol
inet addr:192.168.40.253 P-t-P:192.168.40.254 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:116175 errors:0 dropped:0 overruns:0 frame:0
TX packets:111813 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:31145420 (29.7 Mb) TX bytes:7337890 (6.9 Mb)
Now do the same in machineB:
machineB# ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:0C:76:AC:C7:AD
inet addr:201.154.187.65 Bcast:201.154.187.67 Mask:255.255.255.252
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1128235 errors:0 dropped:0 overruns:0 frame:0
TX packets:798177 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1028702533 (981.0 Mb) TX bytes:139249041 (132.7 Mb)
Interrupt:10 Base address:0x4000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:94489 errors:0 dropped:0 overruns:0 frame:0
TX packets:94489 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:550735249 (525.2 Mb) TX bytes:550735249 (525.2 Mb)
ppp0 Link encap:Point-to-Point Protocol
inet addr:192.168.40.254 P-t-P:192.168.40.253 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:111998 errors:0 dropped:0 overruns:0 frame:0
TX packets:116406 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:7353046 (7.0 Mb) TX bytes:31169104 (29.7 Mb)
You’ll see machine A as 192.168.40.253 and machineB as 192.168.40.254.
Go ahead and ping’em, nmap’em, use their samba resources, or whatever you want, you have a network
within them!
using mod_deflate in apache2 to compress everything
We’re trying to save bandwidth here, so we added to httpd.conf:
LoadModule deflate_module lib64/httpd/modules/mod_deflate. so
SetOutputFilter DEFLATE
DeflateCompressionLevel 9
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
DeflateFilterNote Input input_info
DeflateFilterNote Output output_info
DeflateFilterNote Ratio ratio_info
LogFormat ‘”%r” %b (%{input_info}n===>%{output_info}n) (%{ratio_info}n%%)’ deflate
CustomLog /var/log/httpd/deflate_log deflate
We can see some entries in the /var/log/httpd/deflate_log
“GET /blog/images/magplus.gif HTTP/1.1” 192 (923===>174) (18%)
“GET /blog/ HTTP/1.1” 8044 (50582===>8026) (15%)
“GET /blog/index.php? /serendipity.css HTTP/1.1” 2778 (11987===>2760) (23%)
“GET /blog/templates/translucency/transblue.css HTTP/1.1” 903 (2787===>885) (31%)
“GET /nomove.js HTTP/1.1” 274 (566===>256) (45%)
53/433