Tuesday, February 12, 2013
history configuration enhancements
shopt -s histappend
export HISTSIZE=999999
export HISTTIMEFORMAT='%F %T '
Monday, February 11, 2013
dstat commands
dstat -c --top-cpu -d --top-bio --top-latency
dstat -cndymlp -N total -D 5 25
dstat dstat -s --top-io-adv --top-bio-adv
Source: http://dag.wieers.com/home-made/dstat/
Saturday, February 9, 2013
rrd's not showing up in graphite
rrd's not showing up in graphite?
On the graphite system, check if the rrd's were written on 64-bit or 32-bit system.
rrdtool info filename.rrd
If the graphite system is a different arch, convert them to xml with:
for i in `ls *.rrd`; do rrdtool dump $i > $i.xml; done
Convert back after moving the files:
for i in `find . -name '*.xml'`; do rrdtool restore $i `echo $i |sed s/.xml//g`; don
This article was helpful.
http://slog.carlheaton.co.uk/index.php/2009/10/converting-32bit-rrd-to-64bit-rrd-moving-cacti-between-architectures/
On the graphite system, check if the rrd's were written on 64-bit or 32-bit system.
rrdtool info filename.rrd
If the graphite system is a different arch, convert them to xml with:
for i in `ls *.rrd`; do rrdtool dump $i > $i.xml; done
Convert back after moving the files:
for i in `find . -name '*.xml'`; do rrdtool restore $i `echo $i |sed s/.xml//g`; don
This article was helpful.
http://slog.carlheaton.co.uk/index.php/2009/10/converting-32bit-rrd-to-64bit-rrd-moving-cacti-between-architectures/
mongodb main process terminated with status 100
catch
mongodb does not start
mongodb main process terminated with status 100
try
rm /var/lib/mongodb/mongod.lock
mongodb does not start
mongodb main process terminated with status 100
try
rm /var/lib/mongodb/mongod.lock
Friday, February 8, 2013
mount /proc on openbsd or freebsd
mkdir /proc
mount -t procfs proc /proc
or
echo "proc /proc procfs rw 0 0" > /etc/fstab
Thursday, February 7, 2013
Nagios Stats 07Feb2013
Monitoring Performance
Service Check Execution Time: 0.02 / 18.13 / 0.945 sec
Service Check Latency: 0.00 / 0.97 / 0.382 sec
Host Check Execution Time: 0.02 / 0.29 / 0.050 sec
Host Check Latency: 0.00 / 2.40 / 0.304 sec
# Active Host / Service Checks: 201 / 2429
# Passive Host / Service Checks: 184 / 2787
Wednesday, February 6, 2013
Could not load host key: /etc/ssh/ssh_host_ecdsa_key
on openbsd, u can reload ssh by just running the binary
/usr/sbin/sshd
Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Could not load host key: /etc/ssh/ssh_host_ecdsa_key
If you see this error, create the ecdsa key with the following command:
ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N ""
Tuesday, February 5, 2013
disable/enable nagios via command line
curl -k -d "cmd_mod=2&cmd_typ=11" "https://my_nagios_hostname/nagios/cgi-bin/cmd.cgi" -u "your_username:your_password"
curl -k -d "cmd_mod=2&cmd_typ=12" "https://my_nagios_hostname/nagios/cgi-bin/cmd.cgi" -u "your_username:your_password"
Saturday, February 2, 2013
Warning: Unable to get hardware address for interface
First, this started happening:
Starting Nmap 5.21 ( http://nmap.org ) at 2013-02-02 14:18 MST
Warning: Unable to get hardware address for interface re0 -- skipping it.
Warning: Unable to get hardware address for interface re1 -- skipping it.
WARNING: Unable to find appropriate interface for system route to 192.168.1.254
nexthost: failed to determine route to 192.168.1.1
QUITTING!
root:86#
root:86# pkg_add -u http://mirror.servihoo.net/pub/OpenBSD/5.2/packages/i386/libdnet-1.12p4.tgz
Problem finding http://mirror.servihoo.net/pub/OpenBSD/5.2/packages/i386/libdnet-1.12p4.tgz
But, this resolved both issues.
Starting Nmap 5.21 ( http://nmap.org ) at 2013-02-02 14:18 MST
Warning: Unable to get hardware address for interface re0 -- skipping it.
Warning: Unable to get hardware address for interface re1 -- skipping it.
WARNING: Unable to find appropriate interface for system route to 192.168.1.254
nexthost: failed to determine route to 192.168.1.1
QUITTING!
root:86#
Then I tried this, but it didnt work:
root:86# pkg_add -u http://mirror.servihoo.net/pub/OpenBSD/5.2/packages/i386/libdnet-1.12p4.tgz
Problem finding http://mirror.servihoo.net/pub/OpenBSD/5.2/packages/i386/libdnet-1.12p4.tgz
But, this resolved both issues.
root:91# export PKG_PATH=http://mirrors.syringanetworks.net/pub/OpenBSD/5.2/packages/i386
root:92# pkg_add -ui -D update -D updatedepends
Thursday, January 24, 2013
trim all leading and trailing whitespace with sed
# trim all leading and trailing whitespace
cat ./stuckchannels_Jan24-2013_unformatted.txt | sed 's/^[ \t]*//;s/[ \t]*$//'
Monday, January 21, 2013
"The headers for the current running kernel were not found"
But, my kernel headers are intstalled...and 3D accelleration is turned on in VirtualBox.
So, I installed dkms and that fixed it.
---
hostname@sakti:~$ sudo /media/VBOXADDITIONS_4.2.6_82870/VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.2.6 Guest Additions for Linux..........
VirtualBox Guest Additions installer
Removing installed version 4.2.6 of VirtualBox Guest Additions...
Removing existing VirtualBox non-DKMS kernel modules ...done.
Building the VirtualBox Guest Additions kernel modules
The headers for the current running kernel were not found. If the following
module compilation fails then this could be the reason.
Building the main Guest Additions module ...done.
Building the shared folder support module ...done.
Building the OpenGL support module ...done.
Doing non-kernel setup of the Guest Additions ...done.
You should restart your guest to make sure the new modules are actually used
Installing the Window System drivers
Installing X.Org Server 1.11 modules ...done.
Setting up the Window System to use the Guest Additions ...done.
You may need to restart the hal service and the Window System (or just restart
the guest system) to enable the Guest Additions.
Installing graphics libraries and desktop services components ...done.
hostname@sakti:~$ sudo apt-get install build-essential linux-headers-`uname -r` dkms
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version.
linux-headers-3.2.0-36-generic-pae is already the newest version.
The following NEW packages will be installed:
dkms
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 73.1 kB of archives.
After this operation, 347 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://us.archive.ubuntu.com/ubuntu/ precise/main dkms all 2.2.0.3-1ubuntu3 [73.1 kB]
Fetched 73.1 kB in 0s (103 kB/s)
Selecting previously unselected package dkms.
(Reading database ... 175198 files and directories currently installed.)
Unpacking dkms (from .../dkms_2.2.0.3-1ubuntu3_all.deb) ...
Processing triggers for man-db ...
Setting up dkms (2.2.0.3-1ubuntu3) ...
mdeviveiros@sakti:~$ sudo /media/VBOXADDITIONS_4.2.6_82870/VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.2.6 Guest Additions for Linux..........
VirtualBox Guest Additions installer
Removing installed version 4.2.6 of VirtualBox Guest Additions...
Removing existing VirtualBox DKMS kernel modules ...done.
Removing existing VirtualBox non-DKMS kernel modules ...done.
Building the VirtualBox Guest Additions kernel modules ...done.
Doing non-kernel setup of the Guest Additions ...done.
You should restart your guest to make sure the new modules are actually used
Installing the Window System drivers
Installing X.Org Server 1.11 modules ...done.
Setting up the Window System to use the Guest Additions ...done.
You may need to restart the hal service and the Window System (or just restart
the guest system) to enable the Guest Additions.
Installing graphics libraries and desktop services components ...done.
hostname@sakti:~$
---
Rebooted and wa-la. all fixed.
Ubuntu 12.04 LTS i686 with Unity 3D running in VirtualBox 4.2.6 (with the extention pack installed) on Windows 7 x64
Sunday, January 20, 2013
nginx ossec location directive
location ^~ /ossec/(.*\.php)$ {
auth_basic "Restricted";
auth_basic_user_file /var/www/default/ossec/.htpasswd;
root /var/www/default/ossec;
index index.php;
fastcgi_pass 127.0.0.1:8888;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/default/ossec$fastcgi_script_name;
include fastcgi_params;
}
#
location ~ \.php$ {
root /var/www/default;
fastcgi_pass 127.0.0.1:8888;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/default$fastcgi_script_name;
include fastcgi_params;
}
}
Wednesday, January 16, 2013
limit incoming connections with host firewall
limit incoming connections on ssh to no more than 6 attempts/30seconds:
ufw limit in log 22/tcp
---
also, in netfiler parlance:
/sbin/iptables -N LOGDROP
/sbin/iptables -A LOGDROP -j LOG
/sbin/iptables -A LOGDROP -j DROP
iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent --set
iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent --update --seconds 30 --hitcount 6 -j DROP
ufw limit in log 22/tcp
---
also, in netfiler parlance:
/sbin/iptables -N LOGDROP
/sbin/iptables -A LOGDROP -j LOG
/sbin/iptables -A LOGDROP -j DROP
iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent --set
iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent --update --seconds 30 --hitcount 6 -j DROP
Saturday, January 12, 2013
OpenBSD upgrade: no route to host
Recently I upgraded from OpenBSD 4.8 to 5.2.
I followed the installation guide whereby you burn ISO's and boot off them, choose the Upgrade option.
Anyhow, after stepped into 5.0, I was no longer able to use wget to test connectivity. dig was succeeding but wget was not, claiming "no route to host".
i could ping the gateway, and outside of it. so I deleted the default route, and recreated it. done.
route delete default
route add default [your.default.gw.ip]
also, i had to comment out the following line in /etc/pf.conf
set require-order yes
then reloaded pf
pfctl -f /etc/pf.conf
I followed the installation guide whereby you burn ISO's and boot off them, choose the Upgrade option.
Anyhow, after stepped into 5.0, I was no longer able to use wget to test connectivity. dig was succeeding but wget was not, claiming "no route to host".
i could ping the gateway, and outside of it. so I deleted the default route, and recreated it. done.
route delete default
route add default [your.default.gw.ip]
also, i had to comment out the following line in /etc/pf.conf
set require-order yes
then reloaded pf
pfctl -f /etc/pf.conf
Saturday, December 29, 2012
Lion Upgrade? DNS Issues?
See here:
http://www.eigenspace.org/2011/07/fixing-osx-lion-dns-search-domains/
http://www.eigenspace.org/2011/07/fixing-osx-lion-dns-search-domains/
Tuesday, December 18, 2012
compare directories on two different servers
This is a dry-run check, based on checksums, no changes will be made on the local system:
rsync -avzc -e ssh root@propsmanager1a.sv3:/usr/local/cvsroot /usr/local/cvsroot -n
of course, this compares in the other direction:
rsync -avzc -e ssh /usr/local/cvsroot root@propsmanager1a.sv3:/usr/local/cvsroot -n
rsync -avzc -e ssh root@propsmanager1a.sv3:/usr/local/cvsroot /usr/local/cvsroot -n
of course, this compares in the other direction:
rsync -avzc -e ssh /usr/local/cvsroot root@propsmanager1a.sv3:/usr/local/cvsroot -n
Friday, November 16, 2012
heads up, pt-online-schema-change
http://www.percona.com/doc/percona-toolkit/2.1/pt-online-schema-change.html
Friday, November 9, 2012
nat an internal address:port to the outside address:port
sudo iptables -t nat -A PREROUTING --in-interface virbr+ -d 169.254.169.254 --proto tcp --dport 80 -j DNAT --to-destination 192.168.11.1:8076
Subscribe to:
Posts (Atom)