Tuesday, February 28, 2012

How to find non UTF-8 file causing issue with SVN Update


If Error is - 
[user1@288832-web3 public_html]$ svn update
svn: Error converting entry in directory 'images' to UTF-8
svn: Valid UTF-8 data
(hex: 46 65 6e 65 72 62 61 68)
followed by invalid UTF-8 sequence
(hex: e7 65 2b 46)

Then do this. 
[user1@288832-web3 public_html]$ printf "\x46\x65\x6e\x65\x72\x62\x61\x68\n"
Fenerbah
[user1@288832-web3 public_html]$ cd  images
[user1@288832-web3 images]$ rm -rf Fenerbahçe+Forma+2.jpg

Run a command in background example: wget

Run the command in background on Linux:
$> nohup wget URL


This is true for running any command in background. Also, the command
generates a file called nohup.out, which might grow as the command
proceeds. So if you are downloading something using wget in
background, you can see the status by

cd <download_folder>
tail -f nohup.out


Remove Keyring issue when rebooted for first time for VNC


Issue: 
I'm trying to use VNC on my headless desktop server that's running lucid, but I can only use SSH because a pop asking me to unlock the keyring shows up every time I try to use VNC. I don't have a monitor for that desktop, so I was wondering, is there any way to remove the keyring/to automatically unlock it during autologin?

Resolution:
I have found a workaround for this issue on 10.04.
Open up Applications->Accessories->Passwords and Encryption Keys
Right click Passwords:login and unlock it.
You should be able to expand the tree and find a listing for vino. Right click and delete it.
Close Passwords and Encryption Keys.
Open gconf-editor as and navigate to /desktop/gnome/remote_access
Enter in your BASE64 encoded password into the vnc_password key.
Save the config and close the editor.
Reboot and you can now use your VNC client to connect to your machine without being first prompted with the keyring.
you can generate the base64 password at the command line;
echo -n "your password" | base64

Find and delete files recursively

find ./ -name '*.html' -print0 | xargs -0 rm -rf

Setting up liferay/tomcat as service on suse linux

1. Copy the attached file to /etc/init.d
2. Modify the paths
3. Run the following command to add the script as service
chkconfig --add liferay
---------------------------------
Filename: liferay



#!/bin/sh
#
# /etc/init.d/tomcat
#
# This is the init script for starting up the
#  Jakarta Tomcat server
#
# description: Starts and stops the Tomcat daemon.
#


tomcat=/media/Resources/data/www/liferay-portal-6.0.6/tomcat-6.0.29
startup=$tomcat/bin/startup.sh
shutdown=$tomcat/bin/shutdown.sh


start() {
  echo -n $"Starting Tomcat service: "
  sh $startup
  echo $?
}


stop() {
  echo -n $"Stopping Tomcat service: "
  sh $shutdown
  echo $?
}


restart() {
  stop
  start
}


status() {
  #ps -aef | grep liferay | grep -v tomcat6 | grep -v grep
  numproc=`ps -ef | grep liferay | grep -v "grep liferay" | wc -l`
  if [ $numproc -gt 0 ]; then
    echo "Liferay is running..."
  else
    echo "Liferay is stopped..."
  fi
}


# Handle the different input options
case "$1" in
start)
  start
  ;;
stop)
  stop
  ;;
status)
  status
  ;;
restart)
  restart
  ;;
*)
  echo $"Usage: $0 {start|stop|restart|status}"
  exit 1
esac


exit 0

Add a new user to SVN for UKSS

Login as root via SSH on UKSS

Here we are adding a new user with the username: user1

Add new user: useradd user1
Add Password for the new user: passwd user1
Add user to groups: 
gpasswd -a user1 svn
gpasswd -a user1 apache

How to get list of files greater than 512MB in linux


find / -type f -size +512000k -exec du -hs {} \;