Whatsapp online tracking

Simple devtools script to track when User is coming online/offline with privacy options on (whatsapp is not showing last seen)

function getElementByXpath(path) {
   return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
 var online = false;
 setInterval(function() {
  if (getElementByXpath('//*[@id="main"]/header/div[2]/div[1]/div/span').textContent == "User to track") {   var lastSeen = getElementByXpath('//*[@id="main"]/header/div[2]/div[2]/span');
   if (lastSeen != null) {
     var today = new Date();
     var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
     var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
       console.log(date + " "+ time + ", " + lastSeen.textContent);
     if (online == false) {
         new Notification(date + " "+ time + ", " + lastSeen.textContent);
         online = true;
   } else {
      if (online == true) {
         var today = new Date();
         var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
         var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
         new Notification(date + " "+ time + " Offline");
         online = false;
 }, 1000); 
Posted in General | Leave a comment

Firefox Android proxy pac

Reminder to myself on how to enable proxy autoconfig on android firefox in about:config:

Set network.proxy.autoconfig_url to a proxy.pac url

Set network.proxy.type = 2


Posted in General | Leave a comment

mysql upgrade error – start failed

Was upgrading today and got this:

Setting up mysql-server-5.5 (5.5.28-0ubuntu0.12.10.1) ...
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
 subprocess installed post-installation script returned error exit status 1

yay, so it can’t start for some reason..
#tail -n 20 /var/log/mysql/error.log:

121211 20:37:00 [Note] Plugin 'FEDERATED' is disabled.
121211 20:37:00 InnoDB: The InnoDB memory heap is disabled
121211 20:37:00 InnoDB: Mutexes and rw_locks use GCC atomic builtins
121211 20:37:00 InnoDB: Compressed tables use zlib 1.2.7
121211 20:37:00 InnoDB: Using Linux native AIO
121211 20:37:00 InnoDB: Initializing buffer pool, size = 128.0M
121211 20:37:00 InnoDB: Completed initialization of buffer pool
121211 20:37:00 InnoDB: highest supported file format is Barracuda.
121211 20:37:00  InnoDB: Operating system error number 22 in a file operation.
InnoDB: Error number 22 means 'Invalid argument'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/operating-system-error-codes.html
InnoDB: File name ./ib_logfile0
InnoDB: File operation call: 'aio write'.
InnoDB: Cannot continue operation.

Google says aio on tmpfs doesn’t work. I don’t want mysql to store it’s crap on my disk – it is just my desktop db and I don’t need it to be blazing fast and contribute to ssd wear.

Solution in my case is innodb_use_native_aio = 0 in my.cnf

Posted in Linux | Tagged , , , | Leave a comment

Photoshop online

Was looking for a tool to quickly edit some picture at work – http://pixlr.com/editor/ is all you need.

Posted in General | Leave a comment

Notify on cbr.ru rates change

script for cron:

TOMMOROW=$(date +"%d.%m.%Y" --date="next day")
touch /var/tmp/cbr.log # just so that it exist
curl http://cbr.ru/currency_base/D_print.aspx?date_req=01.01.2099 |\
sed 's/Курсы валют за 01.01.2099 не зарегистрированы\.//' |\
sed '/<!--/,/-->/d' |\
sed '/<script/,/<\/script>/d' > /tmp/cbr.html

if [ -z `cat /var/tmp/cbr.log | grep "$TOMMOROW"` ]
   if [ -n `cat /tmp/cbr.html | grep "$TOMMOROW"` ]
      echo "$TOMMOROW" > /var/tmp/cbr.log
      echo "Курсы во вложении"| mutt me@example.com -s "ЦБР обновил курс!" -a /tmp/cbr.html
Posted in Linux | Leave a comment

zip individual files recursively

Zip up every fb2 file in a book collection to save some space since reader can read them from zip files anyway:

find . -type f -execdir zip -m '{}'.zip '{}' \;
Posted in Linux | Leave a comment

The surprising truth about what motivates us

Posted in General | Leave a comment

Range check 3.3.5 Proof of concept code – AVR style.


– Range setting taken from DBM /range – need to set it first.
– Friendly nameplates and overlapping nameplates has to be enabled for this to work, however there is a code that tries to hide everything, but name.

For those who will QQ that blizz will now break something else because of this – I believe that having an opportunity for the addon to exist only means that someone will eventually use it and keep it private to gain advantage over those who can’t make their own version, therefore releasing this to keep the balance of the force.

Everyone is free to to improve it and add some boss mods.

I’d be happy if someone would just write functions to determine Camera position from 2+ friendly nameplates on screen and make AVR work again.
I realized I don’t remember math that well anymore and it might take me few days to get back on track with those matrix transformations >:(

p.s. Code is a quick hack, so it is probably messy. There is no OnUpdate throttling – it doesn’t seem to affect my fps even in raids, cba.

Posted in Addons, World of Warcraft | Tagged | Leave a comment

Wii Sex

Posted in General | Leave a comment

Win7 Activation

Looks like MS deployed some patch today (KB971033 it seems) that fixed windows activation with loader. This gets you back in action:

Posted in General | Leave a comment