Jun 3 2011

jquery bookmarklet – add jquery on every site you want

javascript:var s=document.createElement('script');s.setAttribute('src','http://jquery.com/src/jquery-latest.js');document.getElementsByTagName('body')[0].appendChild(s);


Jun 3 2011

ein wenig jquery

$("img[src*='picload'],img[src*='direct']").each(function(){ $( $("body").children()[0] ).before("<img src="+$(this).attr("src")+" width=50>");})

check for all imgs with picsload or direct in src and cop them right after body tag with width 50 and remove height value

 


May 27 2011

alsa…. man man man…

vi /etc/asound.conf

pcm.!default {
type plug
slave {
pcm "hw:1,0"
}
}
ctl.!default {
type hw
card 1
}

cat /proc/asound/cards
0 [Webcam ]: USB-Audio - Philips SPC 1030NC Webcam
Philips CE Philips SPC 1030NC Webcam at usb-orion-ehci.0-1.2, high speed
1 [Audio ]: USB-Audio - USB Audio
USB Audio at usb-orion-ehci.0-1.5.7, full speed

sheeva[0][~]# aplay -l
**** Liste der Hardware-Geräte (PLAYBACK) ****
Karte 1: Audio [USB Audio], Gerät 0: USB Audio [USB Audio]
Sub-Geräte: 1/1
Sub-Gerät #0: subdevice #0

aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
sysdefault:CARD=Audio
USB Audio, USB Audio
Default Audio Device
front:CARD=Audio,DEV=0
USB Audio, USB Audio
Front speakers
surround40:CARD=Audio,DEV=0
USB Audio, USB Audio
4.0 Surround output to Front and Rear speakers
surround41:CARD=Audio,DEV=0
USB Audio, USB Audio
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Audio,DEV=0
USB Audio, USB Audio
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Audio,DEV=0
USB Audio, USB Audio
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Audio,DEV=0
USB Audio, USB Audio
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Audio,DEV=0
USB Audio, USB Audio
IEC958 (S/PDIF) Digital Audio Output

also, make sure the sample rate is set correctly in /etc/asound.conf, otherwise you will hear crackling sound like a bad CD:

period_time 0
period_size 4096
buffer_size 131072
rate 22050


depending on the application you are using. In my case I am using espeak and aplay at 22050 hz.

here you can see the default expected sample rate:
sheeva[1][~]# cat /proc/asound/Audio/stream0
USB Audio at usb-orion-ehci.0-1.5.7, full speed : USB Audio

Playback:
Status: Stop
Interface 1
Altset 1
Format: S16_LE
Channels: 2
Endpoint: 1 OUT (ADAPTIVE)
Rates: 48000
Interface 1
Altset 2
Format: S16_LE
Channels: 6
Endpoint: 1 OUT (ADAPTIVE)
Rates: 48000

Capture:
Status: Stop
Interface 2
Altset 1
Format: S16_LE
Channels: 2
Endpoint: 2 IN (ASYNC)
Rates: 48000

so overall my conf is looking like this now:

pcm.!default {
type plug
slave.pcm "dmixer"
}

pcm.dmixer {
type dmix
ipc_key 1024
slave {
pcm "hw:1,0"
period_time 0
period_size 4096
buffer_size 131072
# period_size 1024
# buffer_size 4096
rate 22050
}
bindings {
0 0
1 1
}
}

ctl.dmixer {
type hw
card 1
}

test mic:
arecord -f cd -d 5 -D dsnoop:1,0 -c 1 | aplay -
or record:
arecord -f cd -d 5 -D dsnoop:1,0 -c 1 test.wav
5 sec record, 1 channel, cd quality, device dsnoop:1,0 (can be found with aplay -L)

old – not working for me anymore:
asoundconf set-default-card Audio

to set default f***ing card

also worth to check the settings in:
/etc/modprobe.d/alsa-base.conf


Apr 8 2011

mount jffs2

if required:
apt-get update && apt-get install mtd-utils

mkdir m
modprobe mtdram total_size=24576 erase_size=128
cat /proc/mtd
modprobe mtdblock
dd if=jffs2.img of=/dev/mtdblock0
mount -t jffs2 /dev/mtdblock0 m


Apr 6 2011

Testing wp 4 iphone

20110406-102540.jpg


Mar 19 2011

Linking und so

20110319-015847.jpg


Feb 25 2011

Schwiegereltern – Samsung Fehler – LE40M71B


Jan 24 2011

Für Izzet

Fur izzet


Nov 22 2010

ipad iphone ipod erkennen

The JavaScript
Copy this code to the clipboard
1
var isiPad = navigator.userAgent.match(/iPad/i) != null;
A quick String.match regular expression test can check for the presence of “iPad” in the user agent string.

The PHP
Copy this code to the clipboard
1
$isiPad = (bool) strpos($_SERVER[‘HTTP_USER_AGENT’],’iPad’);
This time we look for the position of “iPad” in the user agent string.

The .htaccess
Copy this code to the clipboard
1
RewriteCond %{HTTP_USER_AGENT} ^.*iPad.*$
2
RewriteRule ^(.*)$ http://ipad.yourdomain.com [R=301]


Apr 19 2010

Windows 7 – unwanted wake up from standby automatically

if you want to know why your win7 pc wakes up automatically then just type in cmd prompt: POWERCFG -LASTWAKE

my output:

Aktivierungsverlaufsanzahl – 1

Aktivierungsverlauf [0]

Aktivierungsquellenanzahl – 1

Aktivierungsquelle [0]

Typ: Aktivierungszeitgeber

Besitzer: [PROCESS] \Device\HarddiskVolume2\Windows\System32\services.exe

Vom Besitzer bereitgestellter Grund: Die geplante Aufgabe “\Microsoft\Windows\Media Center\mcupdate_scheduled” wird ausgeführt. Hierzu muss der Computer reaktiviert werden.

just go to task plannig options (aufgabenplanung) and deactivate in Media Center update.

Damn! what a powerwaste !!!

 

Also check with powercfg -waketimers what timers are active

 

more powercfg:

powercfg.exe /DEVICEQUERY /?

list all devices which can wake up you pc

PowerCfg -DEVICEQUERY wake_armed

 

disables for example my mouse

POWERCFG -DEVICEDISABLEWAKE “Logitech HID-compliant Cordless Mouse (002)”