jason

Dec 062011
 

Here is a bash script that I use to do simple and transparent backups of all sorts of data.
I use it primarily to backup to multiple external hard drives, plugged in via USB. It uses regular mount or gnome volume manager. It also sends logs via email using “mail” and a local MTA like postfix. Please modify to fit your needs. Leave a comment if you want. Its also here http://jasonschaefer.com/stuff/jsbk.sh.txt

#!/bin/bash
##jsbk.sh 12-07-11
##email: jason [at] schaeferconsulting [dot] com
##505.570.1114
 
########################## USER EDIT BEGINS #############################
## Email to, comma separated list for multiple recipients. host needs to be able to relay local mail. postfix recommended.
to=""
## Set "yes" to rely on gnome volume manager (/media/[drivename]). Set to "no" for manual mount/umount (requires root priv. and will mount to /mnt)
automount="yes"
## Name of drive. If you have multiple backup drives, they should be named the same.
drivename="mybackupdrive"
## Name of directory to write backups in. Leave blank to write to the root of backup drive.
bkdir="mybackups"
## Cleanup backup files when drive reaches this percent
cleanafter="99" #percent
## When backup is full, delete how many days of backups?
deletedaysold="30" #days
## If you are in need of assistance, please contact [the following string]
support="Schaefer Consulting at 505.570.1114"
## To bypass the backup commands, for debug purposes. yes/no
bypassbk="no"
backup_commands () {
########################## START BACKUP COMMANDS ########################
echo "Running backup commands now..."   >> $log 2>&1
## Enter backup line's here i.e., cp, ssh, rsync ####
## append "||check" to the end of the command to verify if the command ran successfully
## exmpl:    /bin/tar zcvf $bklocation/`date +%F`.tar.gz --exclude media/* /home ||check 2>> $log
## exmpl:    /bin/cp -rvu /home/ $bklocation/new-n-changed ||check 2>> $log
## exmpl:    /usr/bin/rsync -av --delete --stats --exclude media/* /home/ $bklocation/rsync-mirror ||check 2>> $log
## exmpl:    /usr/bin/pg_dump -Z 9 -p 5432 -h hostname -U username dbname > $bklocation/dbname_`date +%F_%T`.sqldump.gz ||check 2>> $log
##			         postgres auth uses ~/.pgpass containing localhost:5432:db:dbuser:dbpass
## BACKUP over SMB
## exmpl:		 cd $bklocation/backup-destination && /usr/bin/smbget -URq smb://user:password@hostname/share 2>> $log
 
########################### END BACKUP COMMANDS #########################
########################### USER EDIT ENDS ##############################
########################### CRON REFERENCE ##############################
## setup to run on a schedule with cron
## minutes (0-59) | hours (0-23) | day of month (1-31) | month (1-12) | day of week (0-6 or Sun-Sat 0,6) | command
## 0 2 * * * /usr/local/bin/jsbk.sh
## will run at 2:00am every day
## 0 2 1,15 * * /usr/local/bin/jsbk.sh
## will run at 2:00am 1st and 15th of the month
}
#if you want to see the log on your screen, use log="/dev/stdout" instead
log="/tmp/jsbk.backup.log"
#log="/dev/stdout"
subject="Backup Log from `hostname`"
#mountpoint, for easy reference later
if [ "$automount" = "yes" ]; then
  mp="/media/$drivename"
  else
  mp="/mnt"
fi
#mount point plus backup dir, for easy reference in backup commands
bklocation="$mp/$bkdir"
#determine percent that drive is full
percentfull=`df -h |grep $mp |awk '{print $5}' |sed 's:%::g'`
starttime=`date +%s`
trap caughtsig 1 2 3 6
caughtsig () {
  echo "******************** Caught INTERUPT SIG 1,2,3, or 6. **********************" >> $log 2>&1
  exit 1
}
#check if backup is still running or exited without cleanup.
if [ -f $log ]; then
  echo "log ($log) exists, this indicates that $0 may be running or exited uncleanly. verify with ps aux |grep $0 and if not running, delete $log." >> $log 2>&1
  error
  emailend
fi
check () {
  echo "ERROR: A command FAILED!" >> $log 2>&1
  failed="failed"
}
error () {
  echo >> $log 2>&1
  echo -e "\t\t * Backup is NOT working!" >> $log 2>&1
  echo -e "\t\t * Contact technician for service." >> $log 2>&1
  echo -e "\t\t * Keep this message for diagnoses" >> $log 2>&1
  echo -e "\t\t * Backup Failed on `date +%c`"   >> $log 2>&1
  echo -e "\t Diagnoses:" >> $log 2>&1
  #mount >> $log 2>&1
  echo >> $log 2>&1
  df -h >> $log 2>&1
  echo >> $log 2>&1
  echo Mount Point: $mp   >> $log 2>&1
}
emailend () {
  echo >> $log 2>&1
  #calculate running time of backup
  endtime=`date +%s`
  elapsed=$(($endtime - $starttime))
  printf "Running time: "%dh:%dm:%ds"\n" $(($elapsed/3600)) $(($elapsed%3600/60)) $(($elapsed%60)) >> $log 2>&1
  echo "---" >> $log 2>&1
  echo "If you are in need of assistance, please contact $support" >> $log 2>&1
  echo >> $log 2>&1
  if [ "$automount" = no ]; then
    umount $mp >> $log 2>&1 || { echo -e "Error: Removing hard drive failed\n";} >> $log 2>&1
  fi
  echo "Emailing logs..." >> $log 2>&1
  if [ ! -z "$to" ];then
    /bin/cat $log | /usr/bin/mail -v -s "$subject" $to
    else
    /bin/mv $log $log/last.log
    fi
  exit
}
[ "$automount" != yes ] && [ "$automount" != no ] && echo ERROR: automount=\"$automount\" is not valid. choose [yes] or [no] >> $log 2>&1 && error && emailend
[ -z "$drivename" ] && echo ERROR: drivename is not declared >> $log 2>&1 && error && emailend
[ -z "$bkdir" ] && echo fyi, bkdir is not declared
[ -z "$support" ] && echo fyi, support string is empty
#begin
echo "BACKUP LOG"   >> $log 2>&1
echo "server: `hostname`" >> $log 2>&1
echo -e "Backup BEGAN on `date +%c` \n"   >> $log 2>&1
if [ ! -d "$mp" ];then
  echo "Mount point $mp does not exist!" >> $log 2>&1
if [ "$automount" = "yes" ]; then echo "be sure drivename=\"$drivename\" is correct and gnome volume mounting is working. Or switch to automount=\"no\"" >> $log 2>&1; fi
if [ "$automount" = "no" ]; then echo "check that $mp exists" >> $log 2>&1; fi
echo "Also, be sure the drive is plugged in or turned on." >> $log 2>&1
error
emailend
fi
if [ "$automount" = "no" ]; then
  #mount drive manually at /mnt
  mount -L $drivename $mp >> $log 2>&1 || { echo "ERROR: mounting hard drive failed. Be sure drivename=\"\" is correct and drive is plugged in or turned on.";error;emailend;} >> $log 2>&1
fi
echo -e "\n +++ START LOG +++ \n" >> $log 2>&1
echo "\$bklocation= $bklocation"
if [ -d "$bklocation" ];then
  echo bklocation=\"$bklocation\" exists, moving on
  else
  echo bklocation=\"$bklocation\" is not a directory. stripping bkdir, will write files to root of $mp
  bkdir=""
fi
if [ "$bypassbk" = "yes" ]; then
  touch $bklocation/bypassbk.test
  echo "Bypassing all backup commands for debug purposes" >> $log 2>&1
  emailend
else
#determine percent that drive is full
percentfull=`df -h |grep $mp |awk '{print $5}' |sed 's:%::g'`
echo "Checking if drive has reached $cleanafter% full" >> $log 2>&1
if [ $percentfull -gt $cleanafter ];then
echo "Drive has exceeded $cleanafter% and all backups older than $deletedaysold will be deleted" >> $log 2>&1
/usr/bin/find $bklocation/* -mtime +$deletedaysold -exec rm -fr {} \;  >> $log 2>&1
else
echo "backup drive storage has not exceeded $cleanafter%, proceeding as usual. Drive currently has $percentfull% used" >> $log 2>&1
fi
  #user backup commands function
  backup_commands
fi
echo -e "\n +++ END LOG +++ \n" >> $log 2>&1
#check to see if $failed equals zero, if it is then all commands were successfull. If not, something failed.
if [ "$failed" = failed ]; then
  echo "ERROR: A problem was detected!" >> $log 2>&1
  error
  emailend
else
  echo -e "\t SUCCESS: Backup Complete!" >> $log 2>&1
  echo -e "\t\t " >> $log 2>&1
  emailend
fi

Here is my batch script I use for MS Windows boxen. Batch scripting is nasty but surprisingly this script has come in handy many a time. Here is a direct link http://jasonschaefer.com/stuff/jsbkwin.bat.txt

@echo off
echo jsbkwin 12-07-11
:: INSTRUCTIONS:
:: Save this file to it. Remove the .txt from the name.
:: Download blat http://www.blat.net/ and copy the 3 files (blat.exe, blat.dll, blat.lib) into c:\winnt or c:\windows
:: Ideally, blat will just send the mail. But more and more ISP's are blocking this. You can request that your ISP allow smtp or send on another port or use a remote mail server.
:: Use http://www.stunnel.org/ to make secure (tls) connections for sending mail. See example stunnel.conf at bottom
:: Also, http://www.cygwin.com/ for rsync, ssh and unix2dos on windows.
 
:: Edit file according to your needs and run.
:: This can be run automatically with "at" or "scheduled tasks",
:: You can uncomment the pause's for debugging.
 
::uncomment options as needed (connecting to outside MTA, for example)
set to=""
set from=""
set smtp_server="127.0.0.1"
::set smtp_port="4465"
::set username=""
::set password=""
set subject="Backup logs from %computername%"
set log="jsbkwin_log.txt"
 
::File extensions to be excluded, uncomment and modify as needed.
::echo .avi >> exclude.txt
::echo .mp3 >> exclude.txt
echo exclude.txt >> exclude.txt
 
::XCOPY help
:: /s   copied recursively except empty dirs
:: /e   copies empty dirs
:: /v   verifies file writes
:: /y   answers yes with out prompt
:: /i   assumes dirs are dirs (duhh)
:: /h   copies hidden and system files
:: /d   copies new or changed files
:: /EXCLUDE:[file]    files or strings to exclude
::  >> %log% 2>&1     redirects standard out and error and appends to log
 
echo.
echo Press "X" at top right of window to cancel.
echo backup screen will be blank throughout backup process. Check log for
echo activity and results.
echo log location: %log%
::uncomment "pause" for running manual or troubleshooting
::pause
echo.
 
echo ----------BEGIN---------- >> %log%
echo Version: %version% >> %log%
date /t >> %log% 2>&1
time /t >> %log% 2>&1
echo.
echo Backed up files:
echo.
 
echo running rsync-mirror backup now >> %log% 2>&1
::example
:: C:\cygwin\bin\rsync -rut --delete --stats "/cygdrive/c/DATA" "/cygdrive/e/daily/rsync-mirror" >> %log% 2>&1
:: C:\cygwin\bin\rsync -rut --delete --stats "/cygdrive/c/MT0" "/cygdrive/e/daily/MT0" >> %log% 2>&1
::echo. >> %log% 2>&1
::echo. >> %log% 2>&1
::echo running new-n-changed backup now >> %log% 2>&1
::echo. >> %log% 2>&1
:: xcopy /s/e/v/y/i/h/d/EXCLUDE:exclude.txt "c:\DATA" "e:\daily\new-n-changed" >> %log% 2>&1
 
echo.
date /t >> %log% 2>&1
time /t >> %log% 2>&1
echo ----------END---------- >> %log%
echo.
 
C:\cygwin\bin\unix2dos.exe %log%
 
echo mail log
blat %log% -to %to% -subject %subject% -hostname %computername% -server %smtp_server% -f %from% -port %smtp_port% -u %username% -pw %password%
 
del exclude.txt
del %log%
echo.
echo BACKUP COMPLETE
::uncomment "pause" for troubleshooting
::pause
 
::stunnel.conf example:
::client = yes
::debug = debug
::[pop3s]
::accept = 127.0.0.1:9995
::connect = pop3s.myisp.com:995
::[imaps]
::accept = 127.0.0.1:9993
::delay = yes
::connect = imaps.myisp.com:993
::[smtps]
::accept = 127.0.0.1:4465
::connect = smtps.myisp.com:465
Mar 042011
 

Here are some random notes that I find useful. I also tend to forget and use as reference.

[] Vim reference

:e filename (open filename)
:q! (quit, don’t save)
:x (write if changed, otherwise exit)
a (insert after)
A (insert after line)
h j k l (left, down, up, right)
$ (move to end of line)
^ or 0 (move to beginning of line)
G (move to end of file)
:n (move to “n” line, n=number)
x (delete to the right)
X (delete to the left)
D (delete to the end of line)
dd (delete current line)
yy (yank/copy current line)
V (begin highlight, up and down to select “y” to yank selection)
vn (yank “n” lines below cursor, n=number)
p (put/paste)
u (undo)
/string (search for “string”)
n (search for next string match)
:s/yellow/green/gc (replace yellow with green, g is for global, each match is replaced in a line, instead of the first match in a line. c is for confirm/ask)
:%s/yellow/green/g (replaces yellow with green on the entire page)
:s:/usr/local/bin:/opt/users/bin:g (use something other than / as delineation so you don’t have to escape “/”. Like this nasty example: :s/\/usr\/local\/bin/\/usr\/loca\/bin)

[] find command
find . -name “name” -exec [command goes here] {} \;
find . -type d -exec chmod 750 {} \;
find . -type f -exec chmod 760 {} \;
find /home/BACKUP -mtime +14 -exec rm -fr {} \;
-mtime options:
n exactly n days
+n more than n days
-n less than n days

to convert all backslash \ to forward slash /
find . -type f -iname *.xml -exec sed -i ‘s:\\:/:g’ {} \;

[] Rename multiple files

remove space from all files ending in .mp3
rename ‘s/ //’g *.mp3

rename all files ending in .ZIP to .zip
rename ‘s:\.ZIP:\.zip:’ *.ZIP

[] Sending mail with telnet:
telnet hostname 25
helo me
mail from:myaddress@mydom.com
rcpt to:youraddress@yourdom.com
data
This is a test
.
(thats a newline [enter] – period – and another newline [enter])

[] Fix MBR for windows

http://ms-sys-free.sourceforge.net/

from gnulinux:
ms-sys -m /dev/hda

from msdos or nt recovery console:
fdisk /mbr

[] Batch and snippets (yuck)

http://www.allenware.com/icsw/icswidx.htm

echo Cleanup .bak files older than 7 days
forfiles /p d:\backup /m *.bak /d -7 /c “cmd /c del /q @path”

echo Set variable date as yyyymmdd
set date=%date:~-4,4%%date:~4,2%%date:~-7,2%
echo %date%

[] Filesystem stuff

make image of sda
dd if=/dev/sda of =sda.img bs=1M
backup mbr
dd if=/dev/sda of=mbr.backup bs=512 count=1
mount image
losetup /dev/loop0 sda.img
mount /dev/loop0 /mnt

xfs filesystem and xfsprogs
Determine the amount of fragmentation on sda2
xfs_db -c frag -r /dev/sda2

Filesystem re-organizer, by default, with no arguments. It re-organizes files in mounted partitions for 2 hours. Use -t to change the time.)
xfs_fsr

[] Recover Files
testdisk (recover lost partitions)
photorec (part of the testdisk suite)
foremost sda.img
-t (type doc,jpg,exe etc. all is default)
-a (no error detection, recovers partial files)
-d (indirect block, use for nix filesystems)
-o (output dir)
-T (timestamp output dir)

[] KVM Virtualization

Interface config for bridging to virtualized client /etc/network/interfaces
auto eth0
iface eth0 inet dhcp
auto br0
iface br0 inet dhcp
bridge_ports eth0
bridge_stp off
bridge_maxwait 5

[] KVM with Windows

The best way to get virtio is on install. Download the block driver floppy image and attach it, I use virt-manager. Set your hard drive to type virtio and start your windows install. It will will prompt you to press f6 to install third party drivers. Then press S (you have a disk from a third party manufacturer, your floppy image)

If you already have a disk type IDE and want it to be virtio (better). Then do this:
1. Create a temporary image
kvm-img create -f qcow2 temp-virtio.img 1G
2. Shutdown your virtual machine and attach temp-virtio.img as a hard drive, as type virtio.
3. Attach the virtio-win-x.x.x.vfd (i used the one from fedoraproject.org, see below) to you virtual machine
4. Boot up and install the drivers
5. Shutdown, remove the old hard drive image and re-add it as type virtio
6. Boot up and since you already installed the drivers it will boot. Otherwise, you get BSOD..
(You can remove the temp-virtio.img and floppy image).. All done.

For network drivers.. Shutdown, set the “device model” to virtio. Attach the NETKVM-xxxx.iso as a cdrom. Bootup and install drivers. yay!

virtio network drivers, quamranet

http://sourceforge.net/projects/kvm/files/kvm-driver-disc/

virtio block device drivers (aka, hard drive)
http://alt.fedoraproject.org/pub/alt/virtio-win/latest/images/bin/ or

http://sourceforge.net/projects/kvm/files/kvm-guest-drivers-windows/

[] Windows Policy

run gpedit.msc to edit policy

to backup or move to new host, copy the following
%systemroot%\system32\GroupPolicy\Machine and User dirs

to apply changed policy’s
gpupdate /force

[] RDP tricks

SeamlessRDP http://www.cendio.com/seamlessrdp/
rdesktop -A -s “c:\seamlessrdp\seamlessrdpshell.exe c:\program files\internet explorer\iexplore.exe” -u username -p password hostname

[] Self Signed certificate on debian, the easiest way possible

make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/ssl/private/hostcert.crt
This script will ask for a domain and write the certificate.

Apr 082010
 

I wanted a larger wordlist than the default /usr/share/john/password.lst, with only 3115 words. Openwall sells a really great wordlist, but if you don’t need anything that fancy you can follow these instructions. The apt-get bit is debian specific. I will install dictionaries and then concatenate them all into one file, remove duplicates, lower case and configure john to use the new list.

apt-get install john wamerican-huge wamerican-insane wamerican-large wamerican-small wamerican aspell
aspell dump master > custom-wordlist
cat /usr/share/john/password.lst >> custom-wordlist
cat /usr/share/dict/american-english* >> custom-wordlist

You can concatenate more wordlists into the custom-wordlist file as you find them. Debian has lots more dictionary type packages. For instance, apt-cache search wordlists. Use dpkg -L [installed-package-name] to find where the actual word list file is installed.
Lets count how many lines (words) are in our wordlist so far:

wc -l custom-wordlist

I got 1484152, There must be tons of duplicates. Lets get rid of them. We can also lowercase everything, since john toggles case automatically for us.

tr A-Z a-z < custom-wordlist.txt > custom-wordlist_lowercase

Now we remove the duplicates

sort -u custom-wordlist_lowercase > custom-wordlist_lowercase_nodups

How many lines do we have now?

wc -l custom-wordlist_lowercase_nodups
613517

Now we can set john up to use our custom wordlist file.

Edit the file /etc/john/john.conf
Wordlist = [path to custom-wordlist_lowercase_nodups]

Now we are ready to crack some passwords! First, combine the passwd and shadow files. This will allow john to use the GECOS information from the passwd file. GECOS is the user information fields such as first, last and phone. These fields will be used by john to make a more educated guess as to what that users password might be.

unshadow passwd shadow > unshadow.txt

run john against the resulting unshadow.txt file

john unshadow.txt
Loaded 15 password hashes with 15 different salts (FreeBSD MD5 [32/64 X2])
Mar 122010
 

The wonderful world of motherboard BIOS updates, is still old fashioned. Updates are often still built for Microsoft Windows environments. Often requiring MS DOS. Those of us who don’t have DOS, a floppy drive, an install of Windows 98 to create a bootable floppy, cheesy Pâté, or MS Windows for that matter ….. Here is a way one can flash that BIOS of your mobo using, our favorite free software licensed, operating systems and tools.

DISCLAIMER: Don’t attempt this unless you know what you are doing. I have never had problems doing this, BUT many things can go wrong and you CAN easily “brick” your hardware. Proceed at your own risk!!

We will be using FreeDOS, a wonderfully free and royalty exempt Microsoft DOS compatible operating system. Licensed under the General Public License (GPL).
Note: As usual, my posts require some knowledge of the command line.

wget http://www.fdos.org/bootdisks/autogen/FDOEM.144.gz
gunzip FDOEM.144.gz
mkdir floppy
sudo mount -o loop FDOEM.144 floppy/
ls floppy

you should see these files:
AUTOEXEC.BAT COMMAND.COM CONFIG.SYS KERNEL.SYS README sys.com

Download your BIOS update file from the manufacturer or vendor.
Note: Sometimes, the update will be distributed as a .exe (Windows Executable) file. Most likely it will actually be a compressed zip archive. You can use unzip to extract the .exe file.

Download the update using wget, then unzip the resulting image file “FDOEM.144″ into the mounted folder: “floppy/”

wget http://path-to-your-bios-update/BIOS_UPDATE.zip
sudo unzip BIOS_UPDATE.zip -d floppy/

In this case, the following files are extracted from the BIOS_UPDATE.zip file:
inflating: BIOS.WPH
inflating: OEMPHL.EXE
inflating: OPTIONS.BAT
inflating: PHLASH16.EXE
inflating: releasenotes.txt
inflating: 1.BAT

now, move to the previous directory (cd ..), and un-mount the FDOEM.144 image:

cd ..
sudo umount floppy/

generate the iso image:

genisoimage -o flashboot.iso -b FDOEM.144 FDOEM.144

Now burn flashboot.iso to CD using wodim:

wodim flashboot.iso

Now you can boot from that cd and run your flash utility!! Read the BIOS update instructions on how to do this..

Feb 182010
 

Recently, I was installing debian on a new server and grub2 would not install gave me this error:

“This GPT partition label has no BIOS Boot Partition; embedding won’t be possible! grub-setup: error: Embedding is not possible, but this is required when the root device is on a RAID array or LVM volume.”

Of course, it being grub2, I jumped to the conclusion that grub2 was the problem. I installed legacy grub and got nowhere.
Doing the usual
grub> root (hd0,0)
grub> setup (hd0)
produces this error:
“file /boot/grub/stage1 not read correctly”

No matter what I did, it would not install. So, I went back to the original message and gave grub2 its due process. Turns out this Dell T410 uses GPT (GUID Partition Table) which is an extension of EFI. The “BIOS Boot Partition” is an actual partition on the hard drive. Grub2 embeds the core.img (multiboot boot kernel) into this BIOS boot partition instead of the MBR.
Here are two great resources on this subject:
http://www.rodsbooks.com/gdisk/index.html and
http://grub.enbug.org/BIOS_Boot_Partition

So, the solution:
I had to re-install Debian with a small partition. Apparently it can be under a few hundred KiB. Space is cheap and I didn’t want to have more problems, so I made mine 5MB and put it at the beginning of the disk. In the Debian partitioner, set the partition under “use as:” to “Reserved BIOS boot area“. Then continue with the rest of your partitions and install. Grub2 installed with no problems this time!

If using an older version of Debian, lenny (v5) or older. The “use as:” does not have an option for Reserved BIOS boot area. So, I booted into expert install mode, when you get to “Load installed components from CD” select parted. This will install parted in the install environment. Before you get to detect disks, do ctrl+alt+f2. On the command line you can manually create a bios boot area.

The following parted commands.

parted -a optimal /dev/sda mkpart 1 1 6

The above command creates the first (1) partition from 1MB of the drive to 6MB. -a optimal sets the block alignment for best performance. If you start the partition at 0 the alignment is wrong and parted will Warn: “The resulting partition is not properly aligned for best performance. Ignore/Cancel?”

parted /dev/sda set 1 bios_grub on

This sets /dev/sda1 as GPT grub bios partition. This partition will be found and used by grub on install.

Now, ctrl+alt+f1, and continue the install. Select manual partitioning and be sure not to delete the primary partition (gpt, grub bios) when creating your new partitions.

Do this to all drives in a raid!

After you boot into the fresh install, you can manually install to the other disks.

grub-install /dev/sdb

Now its installed on sda and sdb. In case sda fails, it should be able to boot from sdb.

 

Oct 132009
 

start -> run -> regedit
make a backup, if you want.
goto:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}

look through the list of subkeys (0000, 0001, etc)
DriverDesc keyword will tell you which network adapter. For example, “NVIDIA nForce Networking Controller”
when you find it, right click and add -> new -> string value

new keyword:

Value Name: = NetworkAddress
Value Data: = your new MAC, with no space or : For example, 0019DB71C830

then type:

ipconfig /release
ipconfig /renew
ipconfig /all   (to verify the new mac took)

Now your a l33t Winblows H4|<3r! If you want to go back to your hardware MAC, remove the NetworkAddress key and restart the interface.

FYI, in gnu/linux follow these simple steps to change your MAC address

ifconfig eth0 hw ether 00:19:DB:71:C8:30

if you get this error

SIOCSIFHWADDR: Device or resource busy - you may need to down the interface

do this

ifconfig eth0 down

and try to change the MAC again.

Oct 122009
 
 Posted by at 11:13 am wireless ,  No Responses »

Here is a list of free wireless spots in Santa Fe. I’m sure I will miss some or make errors, please let me know. I don’t list locations that use a password, as it irritates me when people inconvenience patrons for some ignorant reason.

* Santa Fe Baking Company (one of the first and best wireless spots in town, lots of seating and ample power, food and kitchen smell can be harsh)
* Pyramid Cafe (VERY fast internet, Amazing Mediterranean food)
* Second Street Brewery (very solid reliable connection, inside or out. great beer too!)
* Counter Culture Cafe (the qwest connection goes down a lot, the ap is too far from the seating area, but great place to hang, eat and work)
* Teahouse (The best selection of teas and generally good internet, very relaxing place. great food too)
* Aztec Cafe (small but friendly environment, good coffee and sandwiches)
* Blue Corn (the bar downtown has it, ask the bar tender for password (indiapaleale). The southside is open AP and I think the essid is jaguar)
* Flying Star Cafe (the wireless is always slow, food is overpriced and not very good. They use sputnik as a captive portal, its annoying to ask users to sign up for internet. I login with user: free pass: wireless There is a lot of space and the air is fresh)
* Santa Fe Brewing Company (its awesome they provide internet so far out of town)
* Backroad Pizza (south side location has it, not sure about the 2nd street location)
* Joe’s Good food, friendly staff, good internet
* Body (great healthy food, limited seating in front cafe area, back dining area reserved for no computers and no cell phones :-)

Oct 112009
 

I wanted to share some notes on patching the Linux Libre kernel with realtime capabilities. The Linux-Libre project pulls out all the un-free bits from standard Linux. Contrary to popular belief, Linux has many non-free parts, small binary or obfuscated pieces of code for various hardware. I have a Lenovo T61 laptop. I removed the Intel wireless pci express card and put in a Atheros AR5008 wifi card using ath9k completely free wireless driver. Now my system (as far as I can tell:-) is completely free.

I make music and the realtime patch makes the latency of my system and soundcard very low. This is a unique advantage that the gnu/linux operating system gives its users. I highly recommend a realtime patch for anyone working with audio and video on gnu/linux.

Start by getting the rt patch http://www.kernel.org/pub/linux/kernel/projects/rt/ for the kernel version you want to compile.
Then get the corresponding Linux-Libre version http://www.linux-libre.fsfla.org/pub/linux-libre/releases/

tar xfvj linux-2.6.29.6-libre1.tar.bz2
cd linux-2.6.29.6
bzcat ../patch-2.6.29.6-rt23.bz2 | patch -p1

Now Linux is patched with realtime
now its time for

make menuconfig

from the RT How to:
* enable CONFIG_PREEMPT_RT
* activated the High-Resolution-Timer Option (Attention, the amount of supported platforms by the HR timer is still very limited. Right now the option is only supported on x86 systems, PowerPC and ARM Support are however in queue.)
* disabled all Power Management Options like ACPI or APM (not all ACPI functions are “bad”, but you will have to check very carefully to find out which function will affect your real time system. Thus it’s better to simply disable them all if you don’t need them. APM, however, is a no-go.) NOTE: Since rt patch 2.6.18-rt6 you will probably have to activate ACPI option to activate high resolution timer. Since the TSC timer on PC platforms, as used in the previous versions, are now marked as unsuitable for hrt mode due to many lacks of functionalities and reliabilties, you will need i.E. pm_timer as provided by ACPI to use as clock source. To activate the pm_timer, you can just activate the ACPI_SUPPORT in menuconfig and deactivate all other sub modules like “fan”, “processor” or “button”. If you have an old pc, which lacks ACPI support, you migh have problems using the high resolution timer.

I personally have not removed my power management options, as I use a laptop and want these features. I don’t notice any problems but have not tried it without them to know what I’m missing.

then compile the kernel, the debian way

fakeroot make-kpkg kernel_image
sudo dpkg -i linux-image-2.6.29.6-libre1-lapkah_2.6.29.6-libre1-lapkah-10.00.Custom_i386.deb

Here is my latest config and the debian package for libre realtime for lenovo t61

~ May your kernel build and your modules have your back ~