Monday, December 20, 2010

Tuesday, December 07, 2010

linux detach screen

to exit a session created by screen command without stopping what is going on in the session do a
CTRL+a then d

Friday, November 19, 2010

awk dmidecode output

dmidecode | awk 'BEGIN {RS = "\n\n"} /System Information/'
thanks to http://aixhealthcheck.com/index.php?id=246

Wednesday, October 27, 2010

duplicate lines in vim

yy (copy) or dd (cut) a line and then do a p (paste)

NOHUP

start applications with nohup so they will not be closed once the terminal session is closed.

Tuesday, October 26, 2010

copy and backup

find /tmp/test/ -name '*.csv' -exec cp --backup=numbered {} /tmp/test2/ \;

if a file exists in the destination cp will create a copy first like filename.~1~

Thanks to RAMIN the RAMPALO

Sunday, October 24, 2010

monitoring software

the best product I have seen yet: http://www.manageengine.com

Saturday, October 23, 2010

linux iptables SNAT

you do not have to have the ip address of a machine behind iptables set on the gateway machine before you can SNAT with the ipaddress of the machine behind the firewall. In other words you can keep your valid ip address on the machine behind the gateway and still ask your gateway to SNAT with that IP.

iphone phonebook problem

Caller ID format Fix

Wednesday, October 20, 2010

Linux Directory Entry condition

to be able to enter a directory it needs to be +x enabled, you ass!

Visio add text to shape with yellow dot

In detail, it goes something like this:

1. Create or select a shape (duh!)
2. Open the ShapeSheet via Window > Show ShapeSheet
Go to: Insert > Section and check Controls and Text Transform (if it isn’t grayed out)
You should now see both the Controls section and the Text Transform section in the ShapeSheet.
3. In the Text Transform section, set the TxtPin cells as follows:
TxtPinX = Controls.Row_1.X
TxtPinY = Controls.Row_1.Y
4. In the drawing window, reposition the control handle to a suitable default position. The text should follow along!

Taken from: http://www.visguy.com/2009/05/06/top-twelve-text-tips/

Wednesday, August 25, 2010

rsync from windows to linux

1.
vi /etc/xinetd.d/rsync
set disabled = no

2.
cat /etc/rsyncd.conf
max connections = 2
log file = /var/log/rsync.log
timeout = 300

[pub]
comment = Random things available for download
path = /home/oracle/work
read only = yes
list = yes
uid = oracle
gid = oinstall
auth users = pub
secrets file = /etc/rsyncd.secrets

[share2]
comment = t2
path = /home/oracle/work2
read only = yes
list = yes
uid = oracle
gid = oinstall
auth users = pub2
secrets file = /etc/rsyncd.secrets

3.
cat /etc/rsyncd.secrets
pub:pub
pub2:pub2

4.
chmod 600 /etc/rsyncd.secrets

5.
download http://www.brentnorris.net/rsync.zip

6. rsync like this:
rsync -aPv rsync://pub@192.168.0.213/pub .

Saturday, August 14, 2010

Windows XP enable AHCI mode after IDE Install

1. download the corresponding Intel Matrix Storage driver for your Motherboard (ICHX)

2. c:\iata_enu.exe -a

3. copy c:\Program Files\Intel\Intel Matrix Storage Manager\IaStor.sys c:\windows\system32\drivers

4. find the corresponding AHCI.reg file from the internet for your motherboard (ICHX)

5. load the reg file into you registry

6. reboot and enable AHCI mode

7. When windows started cancel automatic hard disk detection and install Intel Matrix Storage and reboot

taken from http://forums.hexus.net/hexus-hardware/112584-how-enable-ahci-raid-mode-without-reinstalling-windows-p35-ich9-ich9r-4.html

Wednesday, August 11, 2010

exporting files from a specific user

/var/www/html/mp3 *(ro,sync,all_squash,anonuid=100,anongid=101)

This will answer request from nfs clients as if the request has come from the specific use anonuid:anongid

Monday, August 09, 2010

terminal services and iptables

for terminal services to work behind an iptables firewall, if the terminal server does not have a valid IP address, a full cone nat is required, which in iptables terms means that you need both a PREROUTING and a POSTROUTING statement.

Saturday, July 31, 2010

Friday, July 30, 2010

cpanel multiple forwarder

just create multiple lines of forwarders
info@x --> me@x
info@x--> you@x

Thursday, July 29, 2010

windows check listening ports

netstat -an |find /i "listening"

THANKS A MIL to PETRI

Tuesday, July 20, 2010

linux sendmail delete outgoing mails

delete in files in /var/spool/mqueue

also you can see the queue using mailq

Saturday, June 19, 2010

linux install i2o raid

to install linux on servers like supermicro X6DH8-G you should install the i2o driver, to install the i2o driver do a
"linux noprobe text" and when "add device" is displayed, load the i2o block driver and things will be LA LA LA LA

Tuesday, June 15, 2010

mikrotik load balancing

Load balancing, connection aggregation, multi-homing, miltiple internet connections teaming

http://wiki.mikrotik.com/wiki/NTH_load_balancing_with_masquerade

LOVE IT!

Sunday, June 13, 2010

Saturday, June 12, 2010

EASEUS FREE Partition Manager

EASEUS FREE Partition Manager (epm.zip)

http://www.partition-tool.com/download.htm

Terminal server has exceeded maximum number of allowed connection

Simply do an

mstsc /admin

Tuesday, June 01, 2010

FTP server behind iptables firewall

To enable firewall access behind firewall other than opening port 21 on the firewall one needs to
Add
IPTABLES_MODULES="ip_nat_ftp"
to
/etc/sysconfig/iptables-config

BIG Thanks to RAMPALO

Saturday, May 29, 2010

mount iso in /etc/fstab

add the below to /etc/fstab
/mnt/centos.iso /media/iso iso9660 loop 0 0

Thursday, May 13, 2010

windows delete share and connect to the same share with another username

windows delete share and connect to the same share with another username

net use \\servername\sharename /delete

WEEHA

Friday, May 07, 2010

mikrotik select gateway based on source address

ip firewall mange
prerouting, mark packets from a special source with a routing mark (any name you like) and add the 0.0.0.0/0 route again and choose the routing mark you specified before with a desired gatway which can be different from the original 0.0.0.0/0 route gatway

Tuesday, April 13, 2010

change timezone in centos

yum -y install tzdata
cp /usr/share/zoneinfo/Asia/Tehran /etc/localtime

BIG thanks to: http://blog.connexeon.com/sysadmin/linux/change-timezone-on-centos/

mikrotik data connections with other types of interfaces

there are 2 interfaces that seem to work ethernet/ip and ip/ip both need for the two end points to have accessible valid ip addresses.
In case you use mikrotik to do PPPOE, you need to put the host OS nic in PROMISC=yes mode so that the PPPOE ack packets can be received by the gust OS.

Monday, April 05, 2010

linux enable NTSF mount in read/write mode

yum -y install dkms-fuse fuse fuse-ntfs-3g

Sunday, March 14, 2010

httpd.conf and the Aliases

When the alias reads like below
Alias /cacti/ /var/www/cacti/

DirectoryIndex index.php
Options -Indexes
AllowOverride all
order deny,allow
deny from all
allow from 127.0.0.1
AddType application/x-httpd-php .php
php_flag magic_quotes_gpc on
php_flag track_vars on


to display the alias successfully in the browser do not forget the terminating slash at the end, so
http://localhost/cacti/ is right.

Tuesday, February 23, 2010

Persistent SSH SOCKS5 tunnel in Linux

ssh -c arcfour -o TCPKeepAlive=yes -N -f -D localhost:1080 user@remoteserver.com

instead of -c arcfour one can use -c blowfish-cbc as well. The performance of the tunnel gets better with a more lightweight cipher.

Monday, January 25, 2010

dbca logs

here you can find dbca logs $ORACLE_HOME/cfgtoollogs/dbca
thanks to OTN

Oracle dbca press finish nothing happens

If you press finish at the end of database creation of dbca and nothing happens, it is (in my case) an X problem. What I did was not to use the X server on windows instead I installed X11 on linux and used that one and it went smoothly.

Saturday, January 23, 2010

Sunday, January 03, 2010

Linksys WAP54GS to act as router with dd-wrt

to make WAP54GS a router
1. Install dd-wrt
2. change the assignment of WAN port from vlan1 to vlan0
3. TADA!!!!!

/etc/sysconfig/desktop

/etc/sysconfig/desktop to choose the window manager permanently

Friday, January 01, 2010

vmware change MAC

in the virtual machine (config) vmx file:

# ethernet0.addressType = "generated"
# RANGE ALLOWED: 00:50:56:00:00:00-00:50:56:3F:FF:FF
ethernet0.addressType = "static"
# ethernet0.generatedAddress = "00:0c:29:94:43:71"
ethernet0.Address = "00:0c:29:94:43:70"