Category Archives: Unix - Page 3

Clean up CTRL-M ( ^M ) chars

using VI while the file is open :  :%s/^M$//g
using sed :   cat file | |sed 's/^M$//' > newfile
using dos2unix :  http://www.linuxcommand.org/man_pages/dos2unix1.html
using tr :   tr -d "\015" < filename > newfile

Run VNCserver on CentOS

Short notes on how to run VNCserver under CentOS 5  

 1. install the app
  #> sudo yum install vnc-server

2. create a password file
  #> vncpasswd password

3. edit vnc config file
  #> sudo vi /etc/sysconfig/vncserver
  VNCSERVERS="1:yourusername"
- uncomment this if you want to force VNC connections only via SSH tunnel
  #VNCSERVERARGS[1]="-geometry 800×600 -nolisten tcp -nohttpd -localhost"

4.
start vncserver
  #> sudo service vncserver start

Tweaks : what ever vnc start for you is in $HOME/.vnc/xstartup,uncomment the following two lines to have your default desktop
  #unset SESSION_MANAGER # exec /etc/X11/xinit/xinitrc  

Apache SSL

Notes on creating an apache SSL cert

Read more »

FreeBSD – Configure sendmail masquerading

Notes on masquerading your domain name , I needed that since one SMS gateway will not accept my nagios@server.domain.com emails , this setting allowed nagios to send the email as nagios@domain.com

Read more »

Perl maintenance tips

Some perl module notes

upgrade modules :

#perl -MCPAN -e ‘CPAN::Shell->install(CPAN::Shell->r)’

create bundle:

#perl -MCPAN -e shell
cpan>autobundle

Install bundle:

cpan>install Bundle::Snapshot_2003_10_01_00