linux command line date to timestamp
[Thu Mar 31 09:51:50 margusja@IRack date -j -f “%Y-%m-%d %H:%M:%S” “2011-03-31 23:59:59” “+%s”
iPhone4 4.3.1 how to boot in to tethered mode
[Sat Mar 26 16:20:12 root@IRack ./tetheredboot -i /Users/margusja/Desktop/tetheredboot2/iBSS.n90ap.RELEASE.dfu -k /Users/margusja/Desktop/tetheredboot2/kernelcache.release.n90
Initializing libpois0n
No matching processes were found
Waiting for device to enter DFU mode
Device must be in DFU mode to continue
opening device 05ac:1227…
Found device in DFU mode
Checking if device is compatible with this jailbreak
Checking the device type
Identified device as iPhone3,1
Preparing to upload limera1n exploit
Resetting device counters
Sending chunk headers
Sending exploit payload
Sending fake data
libusb:error [darwin_transfer_status] transfer error: timed out
Exploit sent
Reconnecting to device
Waiting 2 seconds for the device to pop up…
opening device 05ac:1227…
Uploading /Users/margusja/Desktop/tetheredboot2/iBSS.n90ap.RELEASE.dfu to device
[==================================================] 100.0%
libusb:error [darwin_reset_device] ResetDevice: device not responding
libusb:error [darwin_close] USBDeviceClose: no connection to an IOService
Waiting 10 seconds for the device to pop up…
opening device 05ac:1281…
Setting to configuration 1
Setting to interface 0:0
Uploading /Users/margusja/Desktop/tetheredboot2/kernelcache.release.n90 to device
[==================================================] 100.0%
libusb:error [darwin_transfer_status] transfer error: device not responding (value = 0xe00002ed)
Exiting libpois0n
Convert latin1 to UTF-8 in MySQL
mysqldump -u root -p –default-character-set=latin1 -c –insert-ignore –skip-set-charset -r dump.sql latin1_dbname
file dump.sql
Non-ISO extended-ASCII HTML document text, with very long lines
iconv -f ISO8859-1 -t UTF-8 dump.sql > dump_utf8.sql
file dump_utf8.sql
UTF-8 Unicode HTML document text, with very long lines
perl -pi -w -e ‘s/CHARSET=latin1/CHARSET=utf8/g;’ dump_utf8.sql
mysqladmin -u user -p –default-character-set=utf8 create utf8_dbname; või mysql käsurealt: CREATE DATABASE `utf8_dbname` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
mysql -u user –max_allowed_packet=16M -p –default-character-set=utf8 utf8dbname < dump_utf8.sql
Icecast stress test
Tükk aega mõtelesin, millega arendatavat icecast serverit testida. Leidsin streamripper nimelist tööriista.
Mul on 7-me kanaliga icecast server.
#!/bin/sh
URL=http://server:8000/channel.m3u
for i in 1 2 3 4 5 6 7 8 9 10
do
streamripper $URL -r &
sleep 5
done
Järgmine kord teen väikese skripti ka.
Eesti IT-maastiku hetkeline olukord
Säästumarket suure loadi all
Käisin lõunal poes.
Säästukas rabas kahe CPU-ga. Samas ikka oli keskmine load ligi 20 per CPU. Masendav oli see, et kaks CPU slotti oli vaba veel.
Keemia põhitõed
Molaarmassi arvutamine
index X elemendi aatomimass + element n
Näiteks M(H2O) e H2O molaarmass on 2×1+16=18g/mol
Õhu molaarmass 29g/mol
F H F H
I I I I
F – B(elektrofiil) + (nukleofiil) N – H <-> F-B (elektrofiil) – (nukleofiil) N-H ehk siin on näha põhjus, miks BF(3)+NH(3)
I I I I
F H F H
How to create huge CPU load e kuidas tekitada suurt CPU koormust
md5sum < /dev/urandom
openssl speed
Kuidas kopeerida root kasutaja all nii, et originaal failiõigused jääks alles kasutades tar käsku
tar cf – * | ( cd /target; tar xfp -)