2010
05.11

EDIT: Sep-28-2010 : as of a while ago 1x.com changed how their random images are served so this script no longer works. i’ll see if i can use a different site as pointed out in the comments.

so after creating the evilwm random wallpaper script i decided that i wanted to use the fixed resolution images from 1x.com.

here is the script i made up with an explanation below:

#!/bin/bash

if [ -d /tmp/jpg/ ];
then
    echo dir exists
else
    mkdir /tmp/jpg/
fi

if [ -f /tmp/jpg/1x.txt ];
then
    echo file exists
else
    touch /tmp/jpg/1x.txt
fi

while :;do
    FILENAME=`cat /tmp/jpg/1x.txt | egrep random | egrep main | egrep jpg | cut -d\" -f32 | cut -d= -f2 | cut -d\& -f1`
    curl --silent http://1x.com/photo/random/ > /tmp/jpg/1x.txt
    wget http://imghost.1x.com/${FILENAME} -O /tmp/jpg/${FILENAME} > /dev/null 2>&1
    #/usr/bin/feh --bg-center /tmp/jpg/${FILENAME}
    #xv -quit -root -rmode 5 -max /tmp/jpg/${FILENAME}
    sleep 60
done

all this script does is gets the html from http://1x.com/photo/random/, cuts it accordingly to grab the jpg name and then wget’s the proper jpg.
make sure to uncomment either the feh line or xv line according to tastes.

you can also change the sleep interval if you want to make it shorter or longer.

2010
05.11

adhoc tomfoolery

so a couple of days ago i was trying to set up an adhoc connection on my
laptop to my phone to tether an internet connection when i realized that it
was all wonky.

example:

porta-sendai ~ # iwconfig wlan0 mode Ad-Hoc
Error for wireless request "Set Mode" (8B06) :
    SET failed on device wlan0 ; Device or resource busy.

now i realize that some of you will probably say “you are probably connected
to wifi right now..”…

well, i am not.

so i came up with this work around:

## make sure wifi is down
ifconfig wlan0 down

## this is to add a VAP named ath0 since my wifi is wlan0
iw dev wlan0 interface add ath0 type adhoc

## bring new VAP up
ifconfig ath0 up

## now we connect to the essid of the adhoc machine
iwconfig ath0 essid "xxxx"

## and we get our address
dhcpcd ath0

VOILA!!.
this was a temp fix until i find what is really the issue.
here is some info on my machine:

OS: gentoo 2.6.30-gentoo-r6
i686 Intel(R) Core(TM)2 Duo CPU T7300 @ 2.00GHz GenuineIntel GNU/Linux 
Network controller: Intel Corporation PRO/Wireless 4965 AG or AGN Network Connection (rev 61)