Faraday's Law
Ohm's Law
Battery-Resistor Circuit
[ add comment ] ( 6 views ) | [ 0 trackbacks ] | permalink
#!/bin/bash
# program: postfix log checker
# version: 1.2
# purpose: to check logs for mail transport
# usage: $0 from email@domain
# $0 to email@domain
argc=$# # argument count
argv[0]=$0 # argv[0] is a prog name
TEMP1=/tmp/$$.temp1
TEMP2=/tmp/$$.temp2
TEMP3=/tmp/$$.temp3
> $TEMP1
> $TEMP2
> $TEMP3
trap "rm -f $TEMP1 $TEMP2 $TEMP3; echo; echo 'program stopped by user'; exit" INT TERM
[ ! $1 ] && echo "please specify from or to, ie: from tomas" && exit
[ ! $2 ] && echo "please specify recipient email address, or a part of address" && exit
for foo in $( seq $argc )
do
eval "argv[${foo}]=\$${foo}"
done
[ $1 == "from" ] && SEARCH=" from="
[ $1 == "to" ] && SEARCH=" to="
email=${argv[2]}
echo "------------------------------------------------"
echo "search: ($SEARCH)*${email}*"
echo "------------------------------------------------"
for logfile in $( ls -1 /var/log/maillog* )
do
echo "parsing logfile ... $logfile"
if [ $( echo $logfile | grep -i "*gz$" ) ]; then
zcat $logfile | grep -i -E "${SEARCH}.${email}|${SEARCH}${email}" >> $TEMP1
else
cat $logfile | grep -i -E "${SEARCH}.${email}|${SEARCH}${email}" >> $TEMP1
fi
done
cat $TEMP1 | sed -e "s/ / /g" | cut -d" " -f 6 | sed -e "s/://g" | sort | uniq \
>> $TEMP2
EVENTS=$( cat $TEMP2 | wc -l )
echo "we have found $EVENTS records in our logs"
echo "compacting results"
echo "------------------------------------------------"
> $TEMP3
for event in $( cat $TEMP2 )
do
> $TEMP1
echo -n " $event"
for logfile in $( ls -1 /var/log/maillog* )
do
if [ $( echo $logfile | grep -i "*gz$" ) ]; then
zcat $logfile | grep -i $event | tr '\n' ' ' >> $TEMP1
else
cat $logfile | grep -i $event | tr '\n' ' ' >> $TEMP1
fi
echo -n "."
done
# here we have in $TEMP1 all the log events related to mail message"
# we have it as a single long line
# first, check for sender and recipient
sender=""; orig_recipient=""; recipient=""; status=""; datetime=""; timestamp=""
#cat $TEMP1
datetime=$( cat $TEMP1 | sed -e "s/ / /g" | cut -d" " -f1,2,3 ) > /dev/null
timestamp=$( date -d "$datetime" "+%s" )
REGULAR="s/.* \(from=[^ ,]*\).*/\1/p"
sender=$( cat $TEMP1 | sed -n "$REGULAR" ) > /dev/null
REGULAR="s/.* \(to=[^ ,]*\).*/\1/p"
recipient=$( cat $TEMP1 | sed -n "$REGULAR" ) > /dev/null
REGULAR="s/.* \(orig_to=[^ ,]*\).*/\1/p"
orig_recipient=$( cat $TEMP1 | sed -n "$REGULAR" ) > /dev/null
REGULAR="s/.* \(status=[^ ]*\).*/\1/p"
status=$( cat $TEMP1 | sed -n "$REGULAR" ) > /dev/null
if [ $orig_recipient ]; then
echo "$timestamp, $event, $datetime, $sender, $orig_recipient (yet forwarded!), $status" >> $TEMP3
else
echo "$timestamp, $event, $datetime, $sender, $recipient, $status" >> $TEMP3
fi
done
echo
echo "------------------------------------------------"
echo "generating list, please press space to continue"
echo "running more "
echo "q to quit "
echo "------------------------------------------------"
echo
sleep 3
sort -n --key=1,9 $TEMP3 | more
rm $TEMP1
rm $TEMP2
rm $TEMP3
[ add comment ] ( 7 views ) | [ 0 trackbacks ] | permalink
A free series of textbooks on the subjects of electricity and electronics
Copyright (C) 2000-2012, Tony R. Kuphaldt
http://openbookproject.net/electricCircuits/
Units
http://www.knowledgedoor.com/2/units_an ... fixes.html
Circuit Simulation DC only, Java
http://phet.colorado.edu/en/simulation/ ... ion-kit-dc
Calculating an resistor value
http://www.kpsec.freeuk.com/components/led.htm
Kirhoff's Law explained
http://electron9.phys.utk.edu/phys136d/ ... chhoff.htm
http://www.regentsprep.org/Regents/phys ... efault.htm
http://www.physics.uoguelph.ca/applets/ ... index.html
[ add comment ] ( 6 views ) | [ 0 trackbacks ] | permalink
signály jsou softwarová přerušení běhu procesu a slouží ke komunikaci mezi procesy nebo v rámci procesu.
přehled signálů, jak je popisuje standard POSIX.1-1990
------------------------------------------------------
Signal Value Action Comment
------------------------------------------------------
HUP 1 Term Hangup detected on controlling terminal
or death of controlling process
INT 2 Term Interrupt from keyboard
QUIT 3 Core Quit from keyboard
KILL 4 Core Illegal Instruction
ABRT 6 Core Abort signal from abort(3)
FPE 8 Core Floating point exception
KILL 9 Term Kill signal
SEGV 11 Core Invalid memory reference
PIPE 13 Term Broken pipe: write to pipe with no readers
ALRM 14 Term Timer signal from alarm(2)
TERM 15 Term Termination signal
TERM is a default signal sent by kill(1) command
------------------------------------------------------
Signal Value Action Comment
------------------------------------------------------
USR1 30,10,16 Term User-defined signal 1
USR2 31,12,17 Term User-defined signal 2
CHLD 20,17,18 Ign Child stopped or terminated
CONT 19,18,25 Cont Continue if stopped
STOP 17,19,23 Stop Stop process
TSTP 18,20,24 Stop Stop typed at tty
TTIN 21,21,26 Stop tty input for background process
TTOU 22,22,27 Stop tty output for background process
handler zajišťuje mapování signálu na obslužný kód. obsluhu signálů KILL a STOP přebírá vždy operační systém. v jiných případech je možno určit, zda signál je ignorován (SIG_IGN), zpracován v operačním systému definovaným obslužným programovým kódem - default (SIG_DFL), nebo obsloužen pro proces specifickým programovým kódem.
http://www.enderunix.org/docs/signals.pdf
Catching signal in BASH, example 1
#!/bin/bash
trap "echo 'ahoj ahoj, jsem signal USR1'" USR1
echo $$
while true
do
sleep 1
done
Catching signal in BASH, example 2
if [ ! -e $lockfile ]; then
trap "rm -f $lockfile; exit" INT TERM EXIT
touch $lockfile
critical-section
rm $lockfile
trap - INT TERM EXIT
else
echo "critical-section is already running"
fi
[ add comment ] ( 3 views ) | [ 0 trackbacks ] | permalink
http://www.gme.cz/keramicke-kondenzator ... -p120-053/
0.01u je 10nF, 0.022u je 22n
www.mouser.com
http://cz.mouser.com/Home.aspx
skripta
http://elektross.gjn.cz/skripta/
Books
http://www.magsmoke.com/TH-101-Sheboygan-566-VCO.asp
[ add comment ] ( 150 views ) | [ 0 trackbacks ] | permalink
http://www.youtube.com/watch?feature=en ... D-cNc6StVI
http://brightstorm.com/science/
http://www.youtube.com/watch?v=VrNLVQZ-CZo
simple vco
http://www.sentex.ca/~mec1995/gadgets/pll/pll.html
[ add comment ] ( 6 views ) | [ 0 trackbacks ] | permalink
http://www.paia.com/bckit1/simpletheory.asp
Building Synthetizers
http://www.magsmoke.com/thomas_henry_books.asp
Stavebnice Voltik
http://e-shop.voltik.cz/stavebnice-volt ... 50047.html
Rozcestnik - DIY Effect Projects
http://www.squidoo.com/buildASynth
Electronic circuit simulator.
http://www.falstad.com/circuit/
Electronic circuit designer.
http://www.tina.com
Some other electronic cirtuit designers
http://www.electronics-lab.com/download ... index.html
A pad sound with Voyager
http://www.moogmusic.com/forum/viewtopic.php?t=8173
Roland Juno service manual
http://servicerepairmanuals.net/others/ ... ual-notes/
Roland Juno 80 schematics
http://www.fantasyjackpalance.com/fjp/s ... juno6.html
[ add comment ] ( 5 views ) | [ 0 trackbacks ] | permalink
Postfix: mail for root loops back to myself when using transport_maps (or, how make postfix use /etc/aliases BEFORE sending to smart relayhost? )
The aliases(5) file is used only for local(8) deliveries. Whenmail is forwarded, you may be able to get by with the virtual(5)
alias map.
If the transport_maps or smart relay option is used and the server is a mail forwarder for a domain which he itself is a member of, then the root mail is also forwarded to the next hop as is defined in transport_maps or smart relay.
Iif the root mail should be sent to other address which has mailbox elsewhere than on a next hop, then the virtual must be used.
cat /etc/postfix/virtual
root@somedomain.cz log@fsit.cz
root@somedomain.cz log@fsit.cz
localhost.somedomain.cz log@fsit.cz
root@localhost log@fsit.cz
[ add comment ] ( 6 views ) | [ 0 trackbacks ] | permalink
snippets:
cat /sys/class/fc_host/host*/port_name | speed
multipath -v2 -d
http://www.softpanorama.org/Commercial_ ... ager.shtml
http://www.datadisk.co.uk/main/lvm.htm
----------
lvscan <- logical volume scan
lvremove vol1 vol2 <- remove logical vomumes
vgscan <- volume group scan
vgremove raid5 <- remove volume group
pvscan <- physical volume scan
pvremove /dev/cciss/c0d1 <- wipe the device rom lvm2
------------------------------------------------------
physical device to (pvcreate, pvremove, pvscan)
------------------------------------------------------
volume group of physical devices (vgcreate, vgremove, vgscan)
------------------------------------------------------
logical volume (lvcreate, lvremove, lvscan)
------------------------------------------------------
------------------------------------------------------
lvmdiskscan - reads all the partitions
---
pvs -vvvvv
vgs
lvs
[ add comment ] ( 4 views ) | [ 0 trackbacks ] | permalink
Marking a directory sticky (t) directory users can have read and/or write permissions for that directory, but they can only remove or rename files that they own.
Marking a directory setgid (g+s) will make new files inherit the group ownership of the directory
[ add comment ] ( 6 views ) | [ 0 trackbacks ] | permalink