Tuesday, January 07, 2014
Friday, June 21, 2013
How to Disable SELinux
Temporarily switch off enforcement
You can switch the system into permissive mode with the following command:
echo 0 >/selinux/enforce
more info:
http://www.crypt.gen.nz/selinux/disable_selinux.html#DIS2
You can switch the system into permissive mode with the following command:
echo 0 >/selinux/enforce
more info:
http://www.crypt.gen.nz/selinux/disable_selinux.html#DIS2
Sunday, June 02, 2013
Finding out largest tables on MySQL Server
http://www.mysqlperformanceblog.com/2008/02/04/finding-out-largest-tables-on-mysql-server/
SELECT CONCAT(table_schema, '.', table_name),CONCAT(ROUND(table_rows / 1000000, 2),
'M')rows,CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2),'G')DATA,
CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G')idx,
CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G')
total_size,ROUND(index_length / data_length, 2)idxfrac
FROM information_schema.TABLES
ORDER BY data_length + index_length DESC
LIMIT 10;
Tuesday, May 14, 2013
How to remove GPT partitions
http://d52floats.blogspot.com/2012/07/removing-gpt-information-from-drive.html
http://d52floats.blogspot.com/2012/07/removing-gpt-information-from-drive.html
Thursday, May 02, 2013
Linux disable screen blanking i.e. preventing screen going blank
http://www.cyberciti.biz/tips/linux-disable-screen-blanking-screen-going-blank.html
Saturday, March 10, 2012
Ping sweep with nmap
From nmap man
" -sP (Ping Scan)
This option tells Nmap to only perform a ping scan (host discovery), then print out the available hosts that responded to the scan. No further testing (such as port scanning or OS detection) is performed. This is one step more intrusive than the list scan, and can often be used for the same purposes. It allows light reconnaissance of a target network without attracting much attention. Knowing how many hosts are up is more valuable to attackers than the list provided by list scan of every single IP and host name.
Systems administrators often find this option valuable as well. It can easily be used to count available machines on a network or monitor server availability. This is often called a ping sweep, and is more reliable than pinging the broadcast address because many hosts do not reply to broadcast queries.
The -sP option sends an ICMP echo request and a TCP packet to port 80 by default. When executed by an unprivileged user, a SYN packet is sent (using a connect() call) to port 80 on the target. When a privileged user tries to scan targets on a local ethernet network, ARP requests (-PR) are used unless --send-ip was specified. The -sP option can be combined with any of the discovery probe types (the -P* options, excluding -P0) for greater flexibility. If any of those probe type and port number options are used, the default probes (ACK and echo request) are overridden. When strict firewalls are in place between the source host running Nmap and the target network, using those advanced techniques is recommended. Otherwise hosts could be missed when the firewall drops probes or their responses."
This option tells Nmap to only perform a ping scan (host discovery), then print out the available hosts that responded to the scan. No further testing (such as port scanning or OS detection) is performed. This is one step more intrusive than the list scan, and can often be used for the same purposes. It allows light reconnaissance of a target network without attracting much attention. Knowing how many hosts are up is more valuable to attackers than the list provided by list scan of every single IP and host name.
Systems administrators often find this option valuable as well. It can easily be used to count available machines on a network or monitor server availability. This is often called a ping sweep, and is more reliable than pinging the broadcast address because many hosts do not reply to broadcast queries.
The -sP option sends an ICMP echo request and a TCP packet to port 80 by default. When executed by an unprivileged user, a SYN packet is sent (using a connect() call) to port 80 on the target. When a privileged user tries to scan targets on a local ethernet network, ARP requests (-PR) are used unless --send-ip was specified. The -sP option can be combined with any of the discovery probe types (the -P* options, excluding -P0) for greater flexibility. If any of those probe type and port number options are used, the default probes (ACK and echo request) are overridden. When strict firewalls are in place between the source host running Nmap and the target network, using those advanced techniques is recommended. Otherwise hosts could be missed when the firewall drops probes or their responses."
nmap -sP 192.168.*.*
Monday, December 12, 2011
Linux LVM: Recovering a lost volume.
This is one of the best "How To" to recover an lost LVM, it works forme me ;)
.."NOTE: Do not attempt these steps unless you have a firm understanding of UNIX / LINUX. The concepts here are relatively advanced."....
Tuesday, October 25, 2011
The Perfect Server - CentOS 5.7
http://www.howtoforge.com/perfect-server-centos -5.7-x86_64-ispconfig-2
"This tutorial shows how to set up a CentOS 5.7 server (x86_64) that offers all services needed by ISPs and web hosters: Apache web server (SSL-capable), Postfix mail server with SMTP-AUTH and TLS, BIND DNS server, Proftpd FTP server, MySQL server, Dovecot POP3/IMAP, Quota, Firewall, etc."
http://www.howtoforge.com/perfect-server-centos
"This tutorial shows how to set up a CentOS 5.7 server (x86_64) that offers all services needed by ISPs and web hosters: Apache web server (SSL-capable), Postfix mail server with SMTP-AUTH and TLS, BIND DNS server, Proftpd FTP server, MySQL server, Dovecot POP3/IMAP, Quota, Firewall, etc."
Tuesday, October 11, 2011
DIY: Destroy data on drives via a Linux live distro
http://www.techrepublic.com/blog/doityourself-it-guy/diy-destroy-data-on-drives-via-a-linux-live-distro/835Wednesday, October 05, 2011
How to lock down Linux
"Any operating system can be cracked if you don’t adequately protect it. Yes, even Linux. Here are some security basics on how to protect your Linux systems."
Thursday, August 25, 2011
Dig Howto
Instead using nslookup use dig, in RHEL distro, dig is part of bind-utils package.
http://www.madboa.com/geek/dig/
http://www.madboa.com/geek/dig/
Tuesday, August 02, 2011
How to SMTP Auth in Sendmail (CentOS)
By default sendmail-cf is not installed in CentOS:
yum install sendmail-cf
Then edit /etc/mail/sendmail.mc and add this:
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
compile the new configuration:
make -C /etc/mail/
saslauthd must by running:
/etc/init.d/saslauthd start
and make it available on startup:
chkconfig saslauthd on
then restart sendmail:
/etc/init.d/sendmail restartand it's ready to use
For a powerful mail server, you can combine this configuration with MailScanner, clamav and grey-list.
Tuesday, June 21, 2011
Risk Management Strategy for the Provide Domain Name Resolution Services Critical Function
http://www.dhs.gov/xlibrary/assets/it-sector-risk-management-strategy-domain-name-resolution-services-june2011.pdf
Tuesday, June 14, 2011
Unix file compression utilities
to compress and zip:
tar -czvf archive.tgz files/
more info
http://www.fluidthoughts.com/howto/tar-gzip/
Virtualization in Linux, KVM way by IBM
Well documented information at:
http://publib.boulder.ibm.com/infocenter/lnxinfo/v3r0m0/index.jsp?topic=/liaat/liaatkvm.htm&sf1617284=1
http://publib.boulder.ibm.com/infocenter/lnxinfo/v3r0m0/index.jsp?topic=/liaat/liaatkvm.htm&sf1617284=1
Wednesday, May 18, 2011
vi intro -- the cheat sheet method by Daniel Robbins
vi, useful cheat sheet
http://www.ibm.com/developerworks/linux/tutorials/l-vi/
http://www.ibm.com/developerworks/linux/tutorials/l-vi/
Tuesday, April 05, 2011
How to add rpmforge repo to CentOS 5.5
x86_64 version
wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
rpm -ivh rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
You can disable the rpmforge repo in /etc/yum.repos.d/rpmforge.repo
and changed enabled = 1 to enabled = 0
and changed enabled = 1 to enabled = 0
Source
http://blog.bloke.com/2010/05/enable-rpmforge-for-centos-5-5-for-subversion-1-6/
Sunday, March 13, 2011
Updating time on Linux
First install NTP
yum install ntp
then update by a remote NTP server
ntpdate my.server.xx
or set manually
date mmddHHMM[YYyy]
yum install ntp
then update by a remote NTP server
ntpdate my.server.xx
or set manually
date mmddHHMM[YYyy]
Subscribe to:
Posts (Atom)