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#





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]*$//'

kill zombies

ps -el | grep 'Z' | awk '{ print $5}' | grep -v PID | xargs -I{} kill -9 {}

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

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


Saturday, December 29, 2012

Lion Upgrade? DNS Issues?

See here:

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

Flush DNS cache in Linux


dnscacheutil -flushcache

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

Friday, September 7, 2012

excel cell formatting for KB MB GB

cell formatting for excel

[<1000000]0.00," KB";[<1000000000]0.00,," MB";0.00,,," GB"

Saturday, September 1, 2012

annoyance deferred until 10am


*/15 * * * * root /opt/dell/srvadmin/bin/omconfig system esmlog action=clear
0 10 3 9 * root /bin/sed -i -e '/esmlog/d' /etc/crontab

Wednesday, August 22, 2012

mail getting sent as wrong user from script or command line


install postfix


specify only one of the following:

in /etc/postfix/main.cf:
        mydomain = techops.thedomainhere.com

...

        myorigin = $mydomain



Error: Missing Dependency: librac4.so.[4\|6]



If you get either of the following messages:
--> Finished Dependency Resolution
dell_ie_rac_4-6.5.0-1.9.25.el5.x86_64 from installed has depsolving problems
--> Missing Dependency: librac4.so.6()(64bit) is needed by package dell_ie_rac_4-6.5.0-1.9.25.el5.x86_64 (installed)
Error: Missing Dependency: librac4.so.6()(64bit) is needed by package dell_ie_rac_4-6.5.0-1.9.25.el5.x86_64 (installed)
--> Finished Dependency Resolution
dell_ie_rac_4-6.3.0-1.22.15.el5.x86_64 from installed has depsolving problems
--> Missing Dependency: librac4.so.4()(64bit) is needed by package dell_ie_rac_4-6.3.0-1.22.15.el5.x86_64 (installed)
Error: Missing Dependency: librac4.so.4()(64bit) is needed by package dell_ie_rac_4-6.3.0-1.22.15.el5.x86_64 (installed)




do the following:
yum remove dell_ie_rac_4
yum udpate srvadmin* dell*

Tuesday, August 21, 2012

Tuesday, August 14, 2012

Upgrade your Jailbroken iPhone 4 from iOS 5.0.1 to 5.1.1

This was absolutely painless...

Download latest version of redsn0w.
Upgrade to latest version of iTunes.
Connect phone to Computer while running.
Accept offer:
- from iTunes to upgrade your jailbroken phone.
- to back up your iPhone.

Turn off iPhone while connected to computer, do not unplug.
Start redsn0w, click on Jailbreak button, next, follow iPhone power-on instructions
Wait while iPhone is jailbroken and reboots.

When iPhone has restarted, swipe the Springboard to the right and type in Cydia. Its on there, but its not got its filesystem configured, and it has a transparent icon when its not been configured yet. So, once you see that transparent icon, activate it and it should show you as message saying something about configuring the file system. For me, this message went away after about 60 seconds. The phone rebooted twice and then I had the normal Cydia icon and I was able to install Mail Enhancer Pro and it found my previous configuration (essential for techops email filtering) ....done!


Tuesday, July 17, 2012

atomic repo for centos - upgrade php from 5.1.6 to 5.2.x

http://wiki.centos.org/HowTos/PHP_5.1_To_5.2

How to restore a missing RCS-managed file
# co -p ./RCS/missing_filename,v >> ./missing_filename


How to view current locks on RCS-managed files
# rlog -L -R RCS/*

How remove current locks on RCS-managed files
# rcs -u ./filename_of_locked_file