I came across xrdp
this is a RDP server for linux.
The install goes fairly easy, but they leave out that you need to link the init script (located in /etc/xrdpd/xrdp.sh) to a link in /etc/init.d
other than that it works pretty well. you standard windows terminal server client works to connect and access the server, just like connecting to any windows server.
Rsync from windows to a linux server
I spent way too long trying to figure out why I couldn’t get windows (using cygwin) to rsync to my linux server using a key exchange (so I can automate it). In the event anyone else is wanting to try this, I’ll post it here (assuming cygwin is already installed):
1. on the windows server run “ssh-keygen -t dsa” this will generate your key pair
2. make sure your rights are set correctly on the linux server for the .ssh directory and the files within it (this is what got me)
the .ssh directory should be 700 (ex. chmod 700 .ssh)
the files within it should be 600
3. copy your id_dsa.pub to the linux server from your windows server, then rename it authorized_keys, and move it into the .ssh directory (verify rights again)
that should be all, from there you should be able to ssh or rsync from the windows host to the linux one without need for a password.
Symantec Antivirus for SuSE Linux install / remove / build kernel modules script
I had run into issues getting consistency installing Symantec AV on all of the Linux servers. Because all of ours are SuSE, I wrote this specifically for SuSE, but it should be easy to modify for redhat or other distributions (ex. instead of using yast, use yum).
This script is designed to make antivirus install, removal and kernel module updates quick and easy, while keeping your install on a central server that is easy to get to.
If you use it, let me know if it works well, or you run into issues…
—- here it is—-
#!/bin/bash
#Version *** update if you make a change!!
VER=1.3
#install locations (this uses wget and must have http:// or ftp://)
#RPM PATH
RPMPATH=”ftp://server.fqdn.or.ip/symantec/rpm/*”
#Kernel Mod source Path
KMPATH=”ftp://server.fqdn.or.ip/symantec/ap-kernelmodule-1.0.10-26.tar.gz”
# ******************** verify we are using a root account
if [ $UID != 0 ]
then
echo “You need to run this as root! exiting…”
exit 1;
fi
# ******************* check if this is a 32-bit or 64-bit system
ARCH=`uname -m`
# ****************** Generate a random key
# generate a random key
RANDOM=`date ‘+%s’`
RAND1=$[($RANDOM % 999) + 1]
# **–**–: End of startup variables / starting menus :–**–**
_info () {
dialog –title “Installer $VER Info” –msgbox “Contact <your name here> for updates or questions \n your conatct info here ” 6 50
_main
}
_rmav () {
exec 3>&1
# Stop all AV services
/etc/init.d/autoprotect stop 2>$1 ; dialog –infobox “Stopping autoprotect” 3 45
/etc/init.d/symcfgd stop 2>$1 ; dialog –infobox “Stopping symcfgd” 3 45
/etc/init.d/rtvscand stop 2>$1 ; dialog –infobox “Stopping rtvscand” 3 45
# Remove RPM’s
rpm -ev savui ; dialog –infobox “removing RPMs [savui]” 3 45
rpm -ev savjlu ; dialog –infobox “removing RPMs [savjlu]” 3 45
rpm -ev savap ; dialog –infobox “removing RPMs [savap]” 3 45
rpm -ev sav ; dialog –infobox “removing RPMs [sav]” 3 45
# remove symantec av files
rm -f /etc/init.d/autoprotect ; dialog –infobox “removing files .” 3 45
rm -f /etc/init.d/symcfgd ; dialog –infobox “removing files ..” 3 45
rm -f /etc/init.d/rtvscand ; dialog –infobox “removing files …” 3 45
rm -f /etc/symantec/VPREG*.* ; dialog –infobox “removing files ….” 3 45
rm -f /etc/ld.so.conf.d/symav.conf ; dialog –infobox “removing files …..” 3 45
rm -rf /etc/symantec/NLS ; dialog –infobox “removing files ……” 3 45
rm -rf /opt/Symantec/symantec_antivirus ; dialog –infobox “removing files …….” 3 45
rm -rf /opt/Symantec/autoprotect ; dialog –infobox “removing files ……” 3 45
rm -rf /root/sav*install.log* ; dialog –infobox “removing files . …..” 3 45
rm -f /var/lock/subsys/symcfgd ; dialog –infobox “removing files .. ….” 3 45
rm -f /var/lock/subsys/rtvscand ; dialog –infobox “removing files … …” 3 45
rm -rf /var/symantec/Quarantine ; dialog –infobox “removing files …. ..” 3 45
rm -rf /var/symantec/Logs ; dialog –infobox “removing files ….. .” 3 45
rm -rf /var/tmp/I2_LDVP.TMP ; dialog –infobox “removing files …… ” 3 45
rm -rf /var/symantec ; dialog –infobox “removing files ……” 3 45
rm -f /etc/Symantec.conf ; dialog –infobox “removing files . …..” 3 45
rm -rf /etc/symantec ; dialog –infobox “removing files .. ….” 3 45
rm -rf /opt/Symantec ; dialog –infobox “removing files … …” 3 45
dialog –title “Uninstall Complete” –msgbox “AV removal has completed” 6 50
_main
}
_instav () {
#Get credentials to login and get the files needed
exec 3>&1
UNAME=$(dialog –title “AD Account credentials” –inputbox “Username:” 10 40 2>&1 1>&3)
PASS=$(dialog –title “AD Account Credentials” –insecure –passwordbox “Password:” 10 40 2>&1 1>&3)
# Download the files we need
wget -q -P /tmp/$RAND1 –ftp-user=$UNAME –ftp-password=”$PASS” $RPMPATH ; dialog –infobox “Downloading RPMs” 3 34
wget -q -P /tmp/$RAND1 –ftp-user=$UNAME –ftp-password=”$PASS” $KMPATH ; dialog –infobox “Downloading Kernel patch” 3 34
if [ -d /opt/Symantec/autoprotect ]
then
dialog –infobox “Detected AV a reboot will be needed to apply kernel modules” 3 45
else
mkdir /opt/Symantec
mkdir /opt/Symantec/autoprotect
fi
cd /tmp/$RAND1
tar -zxf ap-kernelmodule-1.0.10-26.tar.gz
cd ap-kernelmodule-1.0.10-26
./build.sh –kernel-dir /lib/modules/$(uname -r)/build > /tmp/$RAND1/mod.log 2>&1 ; dialog –infobox “Building Kernel Modules” 3 34
cd bin.ira
mv ./* /opt/Symantec/autoprotect
#Install the AV RPMs
if [ $ARCH = x86_64 ]; then
cd /tmp/$RAND1
rpm -i sav-*.i386.rpm savap-x64-*.x86_64.rpm savjlu-*.i386.rpm savui-*.i386.rpm ; dialog –infobox “intalling Symantec AV” 3 34
echo “$ARCH”
else
cd /tmp/$RAND1
rpm -i sav-*.i386.rpm savap-*.i386.rpm savjlu-*.i386.rpm savui-*.i386.rpm ; dialog –infobox “intalling Symantec AV” 3 34
echo “$ARCH”
fi
dialog –title “Install Complete” –msgbox “AV and Kernel Modules have been installed” 6 50
rm -R /tmp/$RAND1
_main
}
_upmods () {
#Get credentials to login and get the files needed
exec 3>&1
UNAME=$(dialog –title “AD Account credentials” –inputbox “Username:” 10 40 2>&1 1>&3)
PASS=$(dialog –title “AD Account Credentials” –insecure –passwordbox “Password:” 10 40 2>&1 1>&3)
# Download the files we need
wget -q -P /tmp/$RAND1 –ftp-user=$UNAME –ftp-password=”$PASS” $KMPATH ; dialog –infobox “Downloading Kernel patch” 3 34
if [ -d /opt/Symantec/autoprotect ]
then
dialog –infobox “Detected AV a reboot will be needed to apply kernel modules” 3 45
else
mkdir /opt/Symantec
mkdir /opt/Symantec/autoprotect
fi
cd /tmp/$RAND1
tar -zxf ap-kernelmodule-1.0.10-26.tar.gz
cd ap-kernelmodule-1.0.10-26
./build.sh –kernel-dir /lib/modules/$(uname -r)/build > /tmp/$RAND1/mod.log 2>&1 ; dialog –infobox “Building Kernel Modules” 3 34
cd bin.ira
mv ./* /opt/Symantec/autoprotect
dialog –title “Install Complete” –msgbox “Kernel Modules have been installed \n You will need to reboot for them to ” 6 50
rm -R /tmp/$RAND1
_main
}
_main () {
exec 3>&1
M1=$(dialog –title “Symantec AV installer $VER” \
–menu “Choose from one of the following options:” 15 55 5 \
1 “Install Symantec AV” \
2 “Update Kernel Modules” \
3 “Remove Symantec AV” \
4 “Info” 2>&1 1>&3)
#retv=$?
#[ $retv -eq 1 -o $retv -eq 255 ] && exit
case $M1 in
1) _instav ;;
2) _upmods ;;
3) _rmav ;;
4) _info ;;
esac
}
_gcc () {
GCC=`rpm -qa |grep ^gcc-[0-9] |awk -F “-[0-9]” ‘{print $1}’` ; dialog –infobox “Checking gcc and installing if needed” 3 45
if [ “$GCC” != “gcc” ] ; then
#echo “gcc is not installed”
yast -i gcc
fi
_pkg-test
}
_kernel () {
KSOURCE=`rpm -qa |grep kernel-source |awk -F “-[0-9]” ‘{print $1}’` ; dialog –infobox “Checking kernel source and installing if needed” 3 45
if [ “$KSOURCE” != “kernel-source” ] ; then
# echo “kernel-source is not installed”
yast -i kernel-source
fi
_pkg-test
}
_pkg-test () {
GCC=`rpm -qa |grep ^gcc-[0-9] |awk -F “-[0-9]” ‘{print $1}’` ; dialog –infobox “Checking if gcc is installed” 3 45
if [ “$GCC” != “gcc” ] ; then
_gcc
fi
KSOURCE=`rpm -qa |grep kernel-source |awk -F “-[0-9]” ‘{print $1}’` ; dialog –infobox “Checking if kernel source is installed” 3 45
if [ “$KSOURCE” != “kernel-source” ] ; then
_kernel
fi
_main
}
_pkg-test
exit
—–end —
Property Management and Tenants
If only I knew what I know now, I would have never bought in to rental property the way I did. A few years ago I had bought a few houses around the area I live in. Some I think I did well on the purchase, others, though I don’t think the price was bad, I think I should have gone with my gut.. not feeling on them. In the end, I wish I had talked to some people who had owned rental property for a few years or longer first before getting into it. Here are the things I wish I knew before hand:
1. There are a lot of tenants that are not like you where when you rented (honest and always on time with the rent). Many once falling behind a little on the rent will try to string you along with stories and lies about how they will have money soon.
stories and trends I have heard:
1. I’ve heard this in both good and bad area’s and now unless I see proof do not trust tenants to tell this:
a. the tenant falls a little bit behind in the rent
b. about a month in, sometimes 2 you get a call asking if they can prepay a few months of rent (1-6mo is what I’ve heard)
c. 2 days to a week after the call about prepaying they call and claim that they have been robbed (100% of the time there is no damage or indication of a break in)
d. at this point they either call and claim they can’t live there anymore, or abandon the property.
*** past experience has been that at times there is some damage, but always has only been damage caused by the tenant.
2. Tenants will lie about all kinds of things to put off paying the rent.
a. “I can’t pay all of this because I had to pay for the power/gas/water/etc”
b. “something happened with my paycheck…”
c. “I was robbed and they stole the check” (as a note, this person gave me a cashiers check from the bank that predated the date he claimed he was robbed and they stole the check)
3. Tenants rarely leave the house/ apartment as clean as they got it. I’ve seen some that were so bad that I had to run outside to throw up.
4. If you replace flooring, do install carpet. I wish I learned this early on! If you install carpet, you will just end up replacing it every year, your better off with pergo flooring or some soft of tile or stick down tile. it’s cheaper and easier to install and will last much longer!
5. After evicting someone it is up to you to keep track of where they went, and dragging them back to court to try to get paid… Also, of the people that owe you money, only a small minority will pay you back (all the more reason to be fast to evict).
a. as a note people who depend on programs like section 8 usually will pay you back quickly, their ability to stay on the program depends on it!
b. Section 8 is a good program to get tenants from, though you NEED TO DROP BY THE PROPERTY OFTEN! if they do not keep the apartment clean or are dirty and cause an infestation it can cause them to be moved from your apartment!