Wednesday, April 27, 2011

s3cmd through a proxy

For those who use Amazon's EC2/S3 cloud.
sodo@linux-8u67:~/Downloads/s3cmd-1.0.0> ./s3cmd --configure

Enter new values or accept defaults in brackets with Enter.
Refer to user manual for detailed description of all options.

Access key and Secret key are your identifiers for Amazon S3
Access Key: enter accesskey
Secret Key: enter secretkey

Encryption password is used to protect your files from reading
by unauthorized persons while in transfer to S3
Encryption password:
Path to GPG program [/usr/bin/gpg]:

When using secure HTTPS protocol all communication with Amazon S3
servers is protected from 3rd party eavesdropping. This method is
slower than plain HTTP and can't be used if you're behind a proxy
Use HTTPS protocol [No]:

On some networks all internet access must go through a HTTP proxy.
Try setting it here if you can't conect to S3 directly
HTTP Proxy server name [http-proxy]:
HTTP Proxy server port [8888]:

New settings:
 Access Key: enter accesskey
 Secret Key: enter secretkey 
 Encryption password:
 Path to GPG program: /usr/bin/gpg
 Use HTTPS protocol: False
 HTTP Proxy server name: http-proxy
 HTTP Proxy server port: 8888

Test access with supplied credentials? [Y/n] y
Please wait...
Success. Your access key and secret key worked fine :-)

Now verifying that encryption works...
Not configured. Never mind.

Save settings? [y/N] y
Configuration saved to '/home/sodo/.s3cfg'

sodo@linux-8u67:~/Downloads/s3cmd-1.0.0> ./s3cmd ls
2011-04-05 19:03  s3://testbucket
2011-03-26 04:42  s3://trendtop

Yay! It works.
sodo

Also, I received this error message from YaST2 using SuSE Enterprise Linux 11 64-bit 11.1:
Problem: nothing provides python(abi) = 2.6 needed by s3cmd-1.0.0-4.1.i586

Resolution: install manually from http://s3tools.org/s3cmd

Reference
http://www.saltycrane.com/blog/2010/02/s3cmd-notes/

Sunday, April 17, 2011

resizing a linux partition using Parted Magic

I was running out of space on the root filesystem of my OpenSuSE 11.4 virtual machine. I needed a few extra gig, so I wanted to enlarge the root filesystem from 18GB to 22GB:
sfrase@linux-8u67:~> df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 18G 14G 4G 22% /
devtmpfs 372M 88K 372M 1% /dev
tmpfs 372M 1.1M 371M 1% /dev/shm
Thinking I could use Gparted, I stumbled upon something even easier..the Parted Magic OS. Parted Magic is a compilation of open source partitioning utilities in one smooth-looking OS in bootable iso format. The bootable iso is about 160MB and is available here:
http://partedmagic.com/doku.php?id=downloads

Overview
I had to do a few things to get the filesystem resized.
1) resized the virtual disk that VMware uses
2) booted the VM with the Parted Magic ISO in the virtual CD of the VM
3) ran GParted and expanded my filesystem
4) rebooted the system to see the expanded disk

Detail
I'll show you the steps in depth below:

In VMware Player settings, select the hard disk, click the Utilities link and press "Expand":


Specify a new maximum disk size:


After VMware resizes the virtual disk, I got a success message:


I mounted the ISO in the virtual CD drive:


Next, I booted the virtual machine. I pressed ESC (escape) while the vm is booting to display the boot menu:


I highlighted CDROM and press enter to start booting the Parted Magic iso:


Parted Magic has a really nice interface. Love the system monitors on the desktop!


Next, I double-clicked the icon labeled "partition editor". This is Gparted, the GNOME partition manager:


I double-clicked the filesystem I wanted to resize. In order to expand the size of the filesystem, I pulled the right tab in the graphic from its current position all the way to the right.


I clicked the resize button and saw the change I made:


I clicked Apply to confirm the changes:


It took a minute or two to resize the filesystem:


I checked out the steps the resize performs by clicking the little twisty:


Once resized, I rebooted the machine:


Now my disk has the extra 4GB of space that I needed! Hooray!
sfrase@linux-8u67:~> df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 22G 14G 8G 22% /
devtmpfs 372M 88K 372M 1% /dev
tmpfs 372M 1.1M 371M 1% /dev/shm


Shrink
You can also shrink filesystems. For instance, I wanted to reduce the size of my root partition from 38GB to 7GB. Again, I used GParted and PartedMagic CD for the task.

Here's the Resize screen after I dragged the right arrow almost to the area on the filesystem that is used, as indicated by the yellow color:


Here's the screen while the job is in progress:


Once finished you'll see a message "All operations successfully completed." The job took about five minutes to complete.

So far, I've used GParted on ext3 and ext4 filesystems without issue.

Please, don't forget to donate a few dollars to the nice folks who compiled this very useful set of utilities.

TAG

Monday, April 11, 2011

weblogic 6.1 nastiness

I had to resurrect an old WebLogic 6.1 system today. Ooof! A conversion from IIS5 to IIS6. Went through quite a bit of h3ll.

1) Under Control Panel -> System -> Advanced -> Performance -> Data Execution Prevention had to be enabled for the specific WebLogic and java processes:
-beasvc
-java
-javac

Otherwise, I'd get errors in the Application Event Log and to the desktop.

See more here:
http://en.wikipedia.org/wiki/Data_Execution_Prevention#Windows

2) In IIS, the WebLogic ISAPI filter priority was set to *Unknown*. I resolved with help from Vivek's post here:
http://blogs.msdn.com/b/vivekkum/archive/2009/02/20/unknown-status-for-isapi-filter.aspx
-otherwise, IIS would hang

3) In IIS, the WebLogic DLLs need to be configured as Web Service Extensions and set to a status of Allowed

4) In IIS, unknown ISAPI extensions need to be Allowed
-otherwise, I'd get 404s from .wlforward

5) In IIS, the website needs to be run in IIS5 isolation mode
-otherwise, IIS would hang

6) The iisproxy.ini file needed to be copied to c:\weblogic
-otherwise, I'd get an HTTP 500 from .wlforward

7) Faulting application w3wp.exe, version 6.0.3790.3959, faulting module iisforward.dll
-caused by dll memory corruption trying to access Physical Address Extension memory
-resolved by adding /nopae to boot.ini
http://forums.iis.net/t/1158864.aspx
http://support.microsoft.com/kb/895575

Ugh!
TAG

Friday, April 08, 2011

rdp: ERROR: recv: Connection reset by peer

Strangely, the RDP (rdesktop) sessions to my Windows Servers were timing out within five minutes. I'd get an error like this:
Autoselected keyboard map en-us
ERROR: recv: Connection reset by peer


The Terminal Services Configuation on the destination server were set to timeout after an hour. So something was definetly amiss. Even more weird, when I exited GNOME and logged onto Enlightenment, the problem went away. So that meant the problem was with my window environment. Reading up here:
http://ubuntuforums.org/showthread.php?t=398447

To fix the problem, one guy had to change his keyboard in GNOME:


I changed my keyboard from Unknown to Microsoft Natural Keyboard Pro, restarted GNOME and voila..problem gone!

I love it when a plan comes together!
TAG

Saturday, April 02, 2011

what window manager am I running?

Recently, I've installed quite a few new Linux distributions as virtual machines. They all use different window managers and it is difficult to tell what window manager I have installed. The "wmctrl" program clears this fog. Run the command like this:
sodo@linux-nie4:~> wmctrl -m
Name: Metacity
Class: N/A
PID: N/A
Window manager's "showing the desktop" mode: OFF


Et voila! You have the name of your window manager. Also, you could grep your process list for a known window manager like metacity or compiz like so:
sodo@linux-nie4:~> pidof metacity
5134
sodo@linux-nie4:~> ps -ef | grep metacity
sodo 5134 4984 0 10:36 ? 00:00:01 /usr/bin/metacity
sodo 30798 5467 0 11:35 pts/0 00:00:00 grep metacity


Also, it might be helpful to know your X session setup. This can be determined by looking at your environment variables:
sodo@linux-nie4:~> printenv | egrep 'MANAGER|SESSION' | sort
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-1UXtH7rCgE,guid=9b7438cbc749781f920116e54d973474
DESKTOP_SESSION=gnome
GDMSESSION=gnome
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
SESSION_MANAGER=local/linux-nie4:@/tmp/.ICE-unix/4984,unix/linux-nie4:/tmp/.ICE-unix/4984
WINDOWMANAGER=/usr/bin/gnome
XDG_SESSION_COOKIE=74cab8c1ad6aab7a0cf6c38f4d8dc6fa-1301754995.529512-1092139338
XSESSION_IS_UP=yes


A KDE Example
sodo@linux-z6tw:~> printenv | egrep 'MANAGER|SESSION' | sort
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-mzeA1Sx0fF,guid=43e3b1dcb893bbe684e0bdfe00001fe6
DESKTOP_SESSION=default
KDE_FULL_SESSION=true
KDE_SESSION_UID=1000
KDE_SESSION_VERSION=4
KONSOLE_DBUS_SESSION=/Sessions/1
SESSION_MANAGER=local/linux-z6tw:@/tmp/.ICE-unix/11242,unix/linux-z6tw:/tmp/.ICE-unix/11242
SHELL_SESSION_ID=985449ee0b7140008fe9978a32662d10
WINDOWMANAGER=/usr/bin/startkde
XDG_SESSION_COOKIE=6b050dcfcaf094a4a7c7a30e000002ae-1301545596.870464-842889003
XSESSION_IS_UP=yes

sfrase@linux-z6tw:~> wmctrl -m
Name: KWin
Class: kwin
PID: 11247
Window manager's "showing the desktop" mode: OFF


cool.
TAG
Feel free to drop me a line or ask me a question.