Tuesday, September 6, 2016

Hotmail account in Android

As the date of writing this post, this was the solution that worked:

  • POP server: pop3.live.com (Port 995).
  • POP SSL : Yes.
  • Username : your Windows Live ID, e.g yourname@hotmail.com .
  • Password: your Hotmail or Windows Live password.
  • SMTP server : smtp.live.com (Port 587 or 25).
  • Authentification: oui (same login and password used for the POP3).
  • Select TLS (if possible).

Saturday, August 27, 2016

Headphones

[This is for my own notes]

My headphones (the ones that come with my HTC one) keep dying while exercising. I buy new ones but last not more than a year. I actually don't think it has to do with the sweat but with the connection to the jack or the mic. So, decided to look for something better and after some research:
  1. My friend recommended these: JayBird - X2 Wireless Earbud Headphones. Good reviews, sound great, and he said he has had them for years. Some review talks about them breaking, but at the same time, as these are wireless, I think if they break for some other reason (like sweat) I should be fine... Found offer in BestBuy for 1/2 price ($70)  and they also seem to have a very strong warranty, should anything fail, so I am getting them today. 
  2. A cheaper wireless option ($26!) which a lot of folks rave about is the TaoTronics. I feel I should get a pair too! Maybe present for my sister... I would go for these if it wasn't because #1 is half price.
  3. There are more expensive options like Bose or Beats, but they don't seem more durable based on the reviews, so, will try the above.
  4. For wired type, which I need for airplane (not only because wireless rules for take-off/landing, but because how otherwise am I going to plug to the entertainment system?), the sturdier one recommended by a website was the RHA MA750 ($120). Not buying yet.
  5. The other wired alternative which seems pretty nice (but hard to get) is the JVC HA-FXT90. The have about the same price.
Let's see if I am lucky with my choice!

Friday, July 29, 2016

Cable WLAN / home network connectivity debug

Somehow my cable connection is quite bad, gets lost, takes long time to connect, when streaming videos these are really choppy. So, I decided to dive in the home networking to try to solve this once and for all!
  1. When streaming in Youtube, I can see with the System Monitor the download speeds dropping to almost zero and the video failing to keep loading...
  2. Speedtest actually comes to about 1Mbps and works even when the video is not loading.
  3. Modem (Motorola Surfboard SB6141) to router (either Netgear WGR614 v6 or Fry's FR-300RTR) light shows orange blinking, which indicates less than 100Mbps connection (is this normal?)
  4. Connecting directly with wire to the modem shows 0 packets lost and pings (http://www.pingtest.net/) of 14ms with jitter of 4ms, consistently. For the test to be reliable, stop any other network activity. Youtube seems to interfere sometimes and speedtest.net interferes a lot (which makes sense).
  5. Checking the ports for security on this mode (connected directly to modem), many ports are easy to find (visible or closed) but somehow they change with the scan (like something is adapting!?). The PC firewall (vino) is on.
  6. We then disconnect our home PC and switch to the laptop, the laptop does not connect, even after 20 minutes and several repair (Windows) attempts. It did have an IP (169.254.177.150).
  7. Plug back into the home computer and flies back. Modem IP is 192.168.100.1. Connecting to it and checking "addresses" one can see that the CPE MAC address is D0:50:99:3B:5F:6C (the one on my PC).
  8. Connect back the laptop and again, does not work. 
  9. Reboot the modem and sure enough, the laptop works now! New CPE MAC is E8:E0:B7:EE:B3:E5.
  10. Our theory is that the modem needs to renew the new computer address after that is plugged (Max of 1) and do to so, the easiest way is to restart the modem. To prove it, we plug the home PC back and sure enough, now that is the one not working. But if I clone (spoof) the MAC address of the Linux box to E8:E0:B7:EE:B3:E5 it connects flawlessly right away!
  11. Unfortunately the Intel adapter on my Windows laptop does not allow for that, at least through the Device Manager (this other link may work). So, I am going to leave my Linux box like this which will make transparent the switch of the cable, if I ever need to.
So, one mystery down, but still haven't solved the streaming. It probably has to do with the router. So, let's debug that...
  1. We plug now the Fry's router to the linux PC (not to the modem!). And connect to the router by typing 192.168.0.1. 
  2. Then try cloning the MAC of the modem (the WAN, under Status, on Device Info) to be the same as that of the Linux PC (which is now also the same as the laptop xxE5). Nevertheless, we have a familiar issue with the router refusing to accept that as a valid MAC address. Found solution here. Basically there is an error on a java function that validates the address (in public.js). You got to open the console and overwrite it by typing: check_mac = function check_mac(mac){ var error = true; return error; }. There is a 2nd function that you got to overwrite too: check_mac_00 with the same.
  3. So, to recap, now we got laptop, PC and router with the same MAC. We should be able to plug the router onto the modem and go, but somehow, even before that, after cloning, the PC can't connect to the router. If I change the MAC of my PC, then I can, no problem. Actually the laptop has also the same issue. This happens already without connecting to the WAN, so, got to be something related to the router. Maybe related to the DHCP?
  4. Found out that the MAC filtering was enabled and E8:E0:B7:EE:B3:E5 was not in there. Wondering if I ever got my laptop connected through wire to the Fry's router. Wonder also if when I did step 2, my Linux PC had still its MAC, not the cloned, and that is why I could connect. And only when I switched to E8:E0:B7:EE:B3:E5 failed... A mystery but after adding E8:E0:B7:EE:B3:E5 to the list of addresses, now it is working.
  5. Tested the speed of the net and looks good. Also with video streaming.
Wireless
  1. This was straightforward as I had already configure it. Using the Fry's router, connecting my cell phone through WiFi and testing the speed, had no issues. Same for the laptop, in the sense that it looked the same as through the wired connection on the PC, although the upload speed on both cases was pretty poor (0.5Mbps).
VPN:
  1. The final test was to connect my laptop wirelessly and see if all works fine as it used to fail too sometimes. Nevertheless, now I got no issues. Ping and speed was a bit slower but no big deal, likely due to the VPN itself. 
So, hopefully this is it. I'll revisit if any future issues.

Update: about 1 year later, things continue to work solid. Actually I had to unplug everything because of some remodeling at the apartment and plugging it back, without changing any configuration (but in the right order, as above, although I can't think of why I have to, as all the MACs still the same) and it is working great.

Other links of interest:

Saturday, July 9, 2016

Head tracking off-the-shelf solutions

So had a quick look at how to track the head position, just to see what is out there. Some quick findings:

Through face tracking:
Besides the theta/phi that helps present the image from the right angle, we can probably find out the R from the size of the face. Not trivial, will have to see how the effect works out.
  1. Of course, we can use OpenCV and all the stuff presented in this blog (only for the position, not so much for rotation).
  2. FaceTracknoIR Open source face tracking for Windows. It tracks rotation too...
With markers in the head: Either passive (reflective) or active (LED as light source):
  • Tutorials:
    1. This guy talks too much too but the slides he shows makes everything funnier...
    2. I feel this guy talks too much.
  • Solutions: 
    1. FreeTrack (software)
    2. OpenTrack (software)
    3. LinuxTrack (software)
    4. TrackIR (both software and hardware, ~$150)
    5. Sony Playstation Move (I include here as it is cheaper than the Vive or Occulus systems...) and the Playstation Camera. Probably these would give you anything beyond position.
    6. TrackHat buy the hardware, use the free software (spin from OpenTrack).
    7. DIY hardware Mostly about the mechanical part... The electronics is basic if you know anything about it (the LEDs are just DC, not pulsed or anything fancy...)
    8. These guys did something very similar to what I had in mind (kind of a virtual window). It was probably inspired in both cases on the great and open job of Johnny Chung Lee
    Comparison of both methods (not a good one...)

    Wednesday, July 6, 2016

    Saving space in Outlook and other utilities

    Managing Outlook manually can be quite painful. Files grow to take a lot of your hard drive (I have an old 74GB SSD and probably 40GB of mail total), and once you have created a lot of folders, it is not going to be easy to clean it if you intend to do that, again, manually :).

    Obviously moving folders you don't use out (saving the pst somewhere else) is the easiest way. But can we do more, easily? Sure! Actually searching, I found that Outlook is quite awesome on this!

    1. To remove emails from the same conversation It does allow you to do this for folder and sub-folders, but not at the top of the PST level. Wonder why, so, that will force you to do this one by one inside the level, but ok... The other thing to watch out is that it may remove the flagged emails (for instance, if you flag them to remember them or easily find them), if they are the beginning of some conversation, although sure, they will be part of another email. You probably can avoid that with some setting or by recovering them from the Delete Folder. Anyhow, this alone did already pretty good (maybe 20%) but to see the effects you may have to force Outlook to clean up the PST. Bottom line, this is good to avoid storing duplicates and can have significant savings, but it does have some minor drawbacks (a bit time consuming, potential loss of some organization...). So, if you don't care much about that space, as anyhow you plan to move/store things away you may do only #2.
    2. The second great thing is to be able to store mails that are old in a different PST, but replicating the PST, with the file trees inside. Then you can store away those PSTs... The cool thing also is that if you have marked the file with a flag it won't move it (unless you tell him so...). 
    I am assuming that you know how to load/unload from outlook the PST: File >> Account Settings >> Data Files tab and the Remove. Don't worry, that doesn't delete the file from your SSD/HDD, just takes out the access from Outlook and frees it, so that you can move it somewhere else for storage.

    Outside Outlook, there are also other useful utilities for saving space and doing other interesting stuff:
    1. Cleanup the system install files (this was 10GB in my drive!!)
    2. Stat viewer and attachment removal
    3. Outlook reporting tools and utilities Get reports on how much you spent on every given topic, how much email you sent/receive, how many times you read the same email, email traffic/time of the day...
    4. Others along the same lines
    Cheers!

    Monday, July 4, 2016

    Fixing audio choppy playback in Linux Mint - Pandora, Youtube...

    This is just for my reference, nothing fancy... Sorry the way is explained but was what I tried on this order. At the end I solved both.

    Basically audio in Pandora was choppy. Same used to happen with Youtube videos... Firefox or Chrome didn't make a difference. I just fixed the Pandora problem reinstalling alsa and pulse-audio.
    Also this one actually really helped me.

    By the way, after this my Desktop Environment (Cinnamon) was replaced by Gnome. Even the display manager was not giving me the option for Cinnamon. Looks like Cinnamon installation basically gets corrupted and doing sudo apt-get install cinnamon will fix it.

    Anyhow, this did not solve the Youtube issue. VERY weird, the issue goes away with the volume control of Youtube (if I use lower volume settings). I also did this, but no luck, nevertheless this may be because my audio is not the same as described in the post (Intel chipset Z97).  Doing a lshw -short shows C610/X99 series chipset HD Audio Controller

    So, let's apply the same fix but replacing  snd-hda-intel vid=8086 pid=8ca0 snoop=0 by the right parameters. Something tells me that the 8086-8d20-1028-0618 is a clue. Used then 8d20 instead of the 8ca0 but that didn't do it :(.

    Next I found this and that gave me the clue!! It looked related to the volume, so, I installed pavucontrol. Executing saw the playback bar hitting the max some times! If I increased the volume, it was totally saturated! So, there you go, lowered the controls to 100% (works without getting there) and that did it!! DUH!!!! By the way, you don't need pavucontrol. I found it also on the standard Sound controller (type sound on the start bar...). Posted the answer here.

    Sunday, April 17, 2016

    ESPP

    When one sells stock purchased through the Employee Stock Purchase Plan (ESPP), there are couple of things to take into account. The main one is that folks usually forget is that there are two part to the benefit/loss, the discount portion and the earnings/losses portion beyond that. How are these taxed depends on how long one held the stock.

    From the TaxAct help:

    "Qualifying vs. Disqualifying Disposition


    A qualifying disposition means both of the following are true regarding your sale:
    • It is more than a year after the purchase of the stock.
    • It is more than two years after the grant date. This would be the first day of the offering period, sometimes referred to as the enrollment date
    The compensation income for a qualifying disposition is the lesser of two amounts. The first amount is the discount allowed on the purchase of the stock. This would be the difference between the fair market value (FMV) of the stock on the grant date and the actual amount you paid for the shares. The second amount is the difference between the FMV of the stock when you disposed of it and the actual amount you paid for the shares.

    For a disqualifying disposition, the compensation income is calculated as the value of those shares on the date of purchase minus the amount you paid for them. Generally, this would be the discount you received on the stock purchase."
    Although seems common sense, it is actually quite more tricky than it looks. See Fidelity's detailed explanation
    Actually I took guidance from the UBS document that had an example. I can't go here through all the combinations but just let me highlight the major difference. On non-qualifying disposition, the whole discount goes into income. In qualifying, truth is that it is not much different. The income ends-up being in many cases 15% of the FMV at start of offering. If the stock went up during the contribution period, then that 15% is better (lower). In my case the discount is always on the exercise date, so, if it goes down in price during the contribution period, then you end up paying the same as non-qualifying... In the case of losses, I believe there is an advantage for qualifying (see links...).
    Cheers!

    Monday, April 4, 2016

    Taxing mutual funds

    Man, one more year where my mutual fund barely moves but I get a letter from the fund company telling me that I made $3k!?! So, pay tax for that... Anyhow, to understand how to account for this, read this good explanation.

    Basically, when the fund manager sells a winning stock, you pay tax for that. As long as he/she doesn't sell the losing ones, you can see the fund lower with a bunch of unrealized losses (same as would happen if you held the basket of stocks).

    So, sure, pay year by year, but keep track of that, so, that in the end, the earnings that you pay tax for become part of the investment capital (!). So, when you finally sell it and realize the losses, your investment is higher than it was, and your losses are higher than they look like if you just looking at the price you paid for the mutual fund at the very beginning.

    Basically, avoid double taxation... The link above gives an example where you actually made money overall, but it is the same concept...

    Cheers!

    Wednesday, March 2, 2016

    Installing Tenda W522U in Linux Mint

    Installing this in Linux was not straightforward. FYI, if you haven't bought your Wifi adapter yet, check the internet and find something that folks recommend.

    I'll go through all what I did. It may be random (really it was more a historical record for whatever clue it may give) than a reasoned one...

    In my case, checking Networking in the System Settings or clicking on the connectivity icon in the status bar actually shows my access point SSID, which makes me think that it actually works. ifconfig was showing it too. Nevertheless, I can't connect. It tries but fails...

    Although for a different chipset (RT3572 instead of RT3572), this is a good forum post. Or is it 5572? That is what I got compiling... Checking for that info, looks like 3572 and 5572 may be the same (or one a superset of the other).

    Some useful commands:
    1. ifconfig
    2. lsusb list all what is connected to the USB ports.
      Bus 002 Device 002: ID 8087:8002 Intel Corp.
      Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
      Bus 001 Device 002: ID 8087:800a Intel Corp.
      Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
      Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
      Bus 003 Device 011: ID 1c4f:0002 SiGma Micro Keyboard TRACER Gamma Ivory
      Bus 003 Device 010: ID 045e:0040 Microsoft Corp. Wheel Mouse Optical
      Bus 003 Device 009: ID 058f:6254 Alcor Micro Corp. USB Hub
      Bus 003 Device 002: ID 093a:2468 Pixart Imaging, Inc. SoC PC-Camera
      Bus 003 Device 013: ID 148f:3572 Ralink Technology, Corp. RT3572 Wireless Adapter
      Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    3. modprobe -c | grep 3572 not sure for what it is. It will list something like this:
      alias usb:v148Fp3572d*dc*dsc*dp*ic*isc*ip*in* rt2800usb
      alias usb:v8516p3572d*dc*dsc*dp*ic*isc*ip*in* rt2800usb
      but if we do something similar (modprobe -c | grep 5372) for a different chipset we get:
      alias pci:v00001106d00005372sv*sd*bc*sc*i* sata_via
      alias spi:ad5372 ad5360
      alias usb:v148Fp5372d*dc*dsc*dp*ic*isc*ip*in* rt2800usb
      alias usb:v5372p2303d*dc*dsc*dp*ic*isc*ip*in* pl2303
      So, both show up...
    4. lsmod | grep rt2800usb
      rt2800usb 27034  0
      rt2x00usb 20742  1 rt2800usb
      rt2800lib 89076  1 rt2800usb
      rt2x00lib 55307  3 rt2x00usb,rt2800lib,rt2800usb
    It seems like the rt2800 should work but it doesn't (properly) so:
    $sudo pico /etc/modprobe.d/blacklist.conf

    add the following lines:
    blacklist rt2x00usb
    blacklist rt2x00lib
    blacklist rt2800usb
    close and save.

    $sudo rmmod rt2x00usb (just in case)
    $sudo rmmod rt2x00lib (just in case)
    $sudo rmmod rt2800usb (just in case)

    Now lsmod won't show the rt2x... and my wireless stop working completely...
    lsusb still shows it.


    Went to Tenda's website and dowloaded their linux driver. That is basically the pure source, so, once untar, followed the instructions in the readme. Basically:
    1. Add the 2 "y" instead of "n" to config.mk (all the other stuff was done already). 
    2. Also had to patch the rt_linux as described here and here (make wasn't working). To apply the patch all what we did was to copy it in the directory where the file we want to patch (rt_linux.h) is (/include/os) and apply patch < rt_linux.h.patch as described here
    3. Then did the make and worked. Generated rt5572sta.o
    4. Do make install
    5. modprobe rt5572sta . This will not work if the install wasn't done. Also, remember that some of these need su privileges.
    6. Notice that if we do modprobe -c | grep rt5 we can get a long list of alias with one line that says:
      alias usb:v148Fp3572d*dc*dsc*dp*ic*isc*ip*in* rt5572sta
      where the highlighted in red is the same we get with the lsusb. I.e., it seems that is saying that for that adapter the rt5572 is the right file.
    7. lsmod will list now the rt5572sta. By the way, if we want to remove it we can use rmmod rt5572sta (or modprobe -r rt5572sta)
    8. ifconfig now is very slow but eventually returns without showing the wireless interface.
    9. I rebooted as the whole thing was dying out... Now with lsusb we can't see the adapter. I guess that is related to the fact that we hide the rt2800usb and has not found the other. lsmod does not see the driver either but we do #5 and now is visible. Still not in lsusb. ifconfig returns also fast but without the adapter.
    10. I unplugged and plug the adapter and sure enough, it shows up in lsusb.
    11. Then it shows up with ifconfig -a
    12. So, now we can even see it in our wireless window (with SSID...) but still never manages to connect to router (like what was happening when using the rt2800...). We can see the LED light up, but nothing...
    13. Also doing lsmod shows cfg80211 which I am not sure was there before...
    14. iwlist scan does show my network with details on encryption type... 
    15. So, we started messing with the NetworkManager.conf file, making ifupdown managed, and somehow that made the service stop after reboot... Then we made managed "false", restart the service (service network-manager restart) and it came back, not only it, but also the wireless!!! Now is connected although I still can not surf the network through wireless ?!? I have no clue what I have done but at least got one step further... Note: eventually, this stopped working but it does work without security or just WEP. So, that points to the WPA... No time to debug now...
    16. Internal ping (192.168.0.1) works but not ping to Google (8.8.8.8)  
    17. Finally got it... I had my router blocking connections by MAC addresses. (0o)". I know... My doubt is at what point some of the errors above where coming from this. Still, I thought I would leave all as is, for anybody's reference...
    Notes:
    1. Found this http://ubuntuforums.org/showthread.php?t=1285828
    2. How to see  your IP, change it and few more useful solutions at http://whatismyipaddress.com/
    3. A lot of info on the topic of setting and controlling the network adapter.  

    Monday, January 18, 2016

    Know your plastics

    #1 BAD       polyethylene terephthalate, PET or PETE. Water bottles
    #2 GOOD    HDPE - detergent/oil containers
    #3 BAD       polyvinyl chloride/PVC - Pipes
    #4 GOOD    low-density polyethylene, LDPE - Grocery bags
    #5 GOOD    polypropylene, PP - Plastic cups/food containers
    #6 BAD       polystyrene/PS (styrofoam)
    #7 BAD       Lexan and others unclassified
     
    Source 

    For more properties on plastics see this...