Tuesday, June 8, 2010

Create an FTP only account in Solaris

The FTP-only username is ftpuser in the following instructions.
   
1. su to root

2. # cat /etc/passwd|cut -f 1 -d: > /etc/ftpusers

3. # echo 'echo "FTP user"' > /bin/ftpuser
# chmod a+x /bin/ftpuser

4. If /etc/shell exists, add 


/bin/ftpuser 

to the last line. 

If not

# ls /bin/*sh > /etc/shells
 

Then add /bin/ftpuser to the last line

5. # useradd -c "FTP User" -d /export/home/ftpuser -m -s /bin/ftpuser -g staff ftpuser
6. # passwd ftpuser



Source: http://www.tek-tips.com/faqs.cfm?fid=2315 + my modifications.
  
Added on 6/9/2010: I just found that my full access account couldn't ftp any more after this. Only ftpuser can ftp. For some strange reason, my username got added to /etc/ftpusers which lists the users that can NOT ftp... Very very weird. After removing my username, the ftp works again.

Friday, June 4, 2010

gconf problem

Yesterday for some reason my CentOS 5.3's gnome session couldn't start any more. It kept showing this kind of messages:

"An error occurred while loading or saving configuration information for gnome-session. Some of your configuration settings may not work properly.


An error occurred while loading or saving configuration information for Nautilus. Some of your configuration settings may not work properly.


An error occurred while loading or saving configuration information for Power Manager. Some of your configuration settings may not work properly.
.
.
."

Clicking on "Details" showed:
"GConf error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://www.gnome.org/projects/gconf/ for information. (Details - 1: Could not send message to gconf daemon: Message did not receive a reply (timeout by message bus))"

This morning I spent hours trying to figure out what's going on here. Reinstalling is the last resort. Creating a new user and copy all the files under it is a workaround.

Finally from one of the numerous posts I read, I found "messages" file under /var/log could give you some clues if the system encounters problems during the process of starting up.

The last part of my messages file showed:
Jun  4 04:08:18 mboot-dell gconfd (root-10001): starting (version 2.14.0), pid 10001 user 'root'
Jun  4 04:08:18 mboot-dell gconfd (root-10001): Bad permissions 777 on directory /tmp/gconfd-root
Jun  4 04:08:18 mboot-dell gconfd (root-10001): Failed to get lock for daemon, exiting: Directory /tmp/gconfd-root has a problem, gconfd can't use it

It turned out that the directory /tmp/gconf-xxxx has to have permission 700 instead of 777 where xxxx is the user name. I must have changed it to 777 while doing one of my scribed tests.

Can you believe that? The success of starting the GNOME session depends on the permission of the directory in /tmp directory! This is really hard to conceive. /tmp should be used as /tmp not as a place to save anything mission critical. Don't you think so?

Tuesday, May 11, 2010

Handbrake hangs at 100%

I wanted to convert one of my exercise DVD discs (VIDEO_TS folder) to mp4 but for some reason, Handbrakes always hung at 100% and the file kept growing. The activity window showed the following:

[14:12:47] sync: adding 252 ms of silence to audio 0 start 15879500, next 15856782
[14:12:47] sync: adding 307 ms of silence to audio 0 start 16039772, next 16012100
[14:12:47] sync: audio 0 time went backwards 0 ms, dropped 25 frames (next 16040900, current 16040900)
[14:12:53] sync: adding 70 ms of silence to audio 0 start 19398884, next 19392572
[14:12:58] sync: adding 70 ms of silence to audio 0 start 22515044, next 22508732
[14:13:03] sync: adding 70 ms of silence to audio 0 start 25631204, next 25624892

After using Ctrl+C to kill the process, the resulting file only has the first two chapters, the rest of it consisted the repeats of a couple of frames.

I used Magic DVD copier to cut down the DVD content to only the title with the chapters I want. But Handbrake still hung at 100%.

Finally I concatenated the VOBs (there are three, copy /b file1+file2+file3 big_file) in the folder and converted it. Finally, it was a success.

Looks like the problem is something to do with the wrong Chaptering and sync. Handbrake just couldn't handle it. And it can do it if it's pure vob files. Still a mystery to me...

Wednesday, April 21, 2010

TDSS Toolkit Infection Fix

Finally I got rid of this crazy Google search result redirecting virus. I'm pretty certain that I got it (and others which are easier to remove) from one of free games for Nokia phone sites. I struggled with it for more than a week. What a shame. This really taught me a huge lesson about nothing is free...

Symptoms:
1. Fake Windows XP Security Center showed up and it said I should turn on some security thing.

2. Some kind of virus doctor window showed up and started scanning.

3. Task Manager button was grayed out when Alt+Ctrl+Del were pressed.

4. regedit, regedt32 were disabled.

5. Windows update site was blocked.

6. Google search results got redirected.

7. Tab completion is disabled in command line.

8. Does not recognize .exe file

Fix:
1. Download ComboFix from bleepingcomputer and run it. This program takes a long time to run but it's worth it.

2. Download TDSSKiller.zip from kaspersky and run it. If TDSSKiller says your atapi.sys or tskXX.tmp (XX is a number, it's different for each system. Mine is tsk21.tmp) is infected and wants you to reboot to fix it. Don't do it yet.

3. If the problem is with atapi.sys, find a clean XP machine with the same SP level, copy its atapi.sys in c:\windows\system32\drivers to a floppy or flash drive. Boot the infected system to Safe Mode (F8 during system startup) with Networking, replace the infected atapi.sys with the clean one. Do step 4 although TDSSKiller doesn't report tskXX.tmp is infected.

4. If tskXX.tmp is infected, run regedit (To re-enable it if it's disabled by virus, run
gpedit.msc->User configuration -> Administrative Templates -> System.
Choose "Prevent access to registry editing", set it to disable and then set it back to Not Configured.). Search the specific tskXX.tmp in the registry and replace it with atapi.sys.

5. Delete tskXX.tmp in C:\windows\system32\drivers

6. Reboot

7. Clean up and prevention

a. Re-enable Alt+Ctrl+Del: Run gpedit.msc->User Configuration->Administrative Templates-> System->Ctrl+Alt+Del Options. Choose "Remove Task Manger", set it to disable and then set it back to Not Configured.

b. If you're using Firefox, I suggest installing the following Add-Ons to prevent future infections.

NoScript
Verify Redirect

Hope this fixes your problem. It was such a painful process to figure this out...

Tuesday, May 26, 2009

Loud loud Sun Ultra 45 SPARC

Came in to work this morning, at around 2 or 3 cubicles away from my desk. I heard a huge huge humming noise (sounds like somebody was vacumning.) Immediately I was afraid it's my machine and changed my mind next second because I thought it was just too loud. But unfortunately, it IS my machine. It was toally intolerable. I shut it down right away.

After around 10 minutes, I booted it up again. Thought the noise was getting better. But when I came back from the restroom, the huge humming started again. Googling "loud ultra 45" returned this link. Forget about the cables + fanctl suggestion. I tried the second suggestion.

It worked! But the noise still seems to cycle from quite to medieum loud especially I started to work on something after a long rest. Well, at least it doesn't look like it's due to refurbishment since other people had the same problem as well.

Steps:

1. Change to root
2. # vi /etc/power.conf

Add the following lines:

cpupm enable
cpu-threshold 15s

3. # pmconfig

Friday, April 10, 2009

DHCP in Solaris 10

# Setup DHCP client in Solaris 10

find the interface name.e.g. /etc/hostname.eri0

touch dhcp.eri0

Reboot

Wednesday, April 8, 2009

Quadruple boot with OpenSolaris, openSUSE, Fedora and Ubuntu

Hello, obsessive nuts (meaning myself). I just had to do it to see if quadruple boot is possible...

1. Install OpenSolaris

2. Install openSUSE. Create the boot USB drive using UNetBootIn (Let it download from the net, do not use the pre-downloaded iso) . Use the USB to boot, choose the network http installation.

http address: http://opensuse.cs.utah.edu
Directory: /distribution/11.1/repo/oss/

Delete all the LVM group thing, create a new ext3 partition and mount it to /. And create a swap area which is double of the ram size (4GB in my case)

3. Install Fedora 10, create a new ext parition and mount it to / again. And it will use the swap created in the previous step.

4. Install Ubuntu 8.10.