Monday, July 27, 2015

Find out the uptime of your Samsung SmartTV

Lately I've been playing around with some stuff, among which I've decided to see what's around me in my home network. Today I've stopped by my TV, which is a Samsung 6500 Series from 2013 (45" model). Turns out that it has some open ports...

80/tcp   open  http
443/tcp  open  https
4443/tcp open  pharos
6000/tcp open  X11
7676/tcp open  imqbrokerd

Now, I've only had time to check out port 80... and this is how I've found out the uptime of my TV.

curl -I http://TvIP/

HTTP/1.1 404 Not Found
Content-Type: text/html
Content-Length: 345
Date: Thu, 01 Jan 1970 00:31:52 GMT
Server: Swift1.0

Turns out that the date is set to 0 (Unix timestamp ftw) every time the TV starts and the server starts with that and tadam.. this is how you get your TV uptime :)

In the weekend I plan to dedicate some time to my car, this should be fun :D

Saturday, July 25, 2015

Github is not my CV

The other week I've got a call from a person who said something about being a "professional headhunter", "recruitment professional", something something dark side, and the dialog was like this:

(the person) - hey, my name is "headhunter something something", I work for "dark side inc." and I'd like to tell you about a great opportunity for you. I've seen your github profile and I think you will be a good fit.
(me) - hi, no thanks, I'm happy with my career right now, have a nice day.

I seriously hate this. Really. Github is not my CV and it should never be.

Github, among many others, is a place where people collaborate on projects or release things they'd like others to use or give feedback for. My contributions to the community are done in the spare time that I have, in almost 99% of the cases, or because I encounter a bug while I'm at work so either I file a bug or a bug fix to the project that I'm using (yeah, Tapglue is awesome in this regard, I can actually fix something in the community if we use it and I can do it).

Many people do this in their own spare time as well. Granted, there are companies like Google or others which allow people to work on open-source projects directly and thus they are more visible, but hey, they actually get payed for that, it's not only because they are cool persons and want to give something back to the community (not saying that they aren't cool and al, you get the picture).

But seriously, I have a job, usually 9 to 18 (more often than not 10 to whenever something in the late evening) and sometimes I have enough time to do something useful for a project that I use or for the community so... Yeah, don't hire me based on that. Hire me because I'm a good engineer, hire me because I have quite a few years of experience in what I'm doing, hire me because I enjoy what I'm doing and I always try to best myself and finally, hire me because I've seen sh*t and I'll fix it faster and better than your average ninja superstar cowboy guru hipster that advertises himself/ herself as such. And if you decided that you want to hire me, after seeing my LinkedIn profile, and after I pass whatever tests / recruitment procedure you have, and you say: hey, he's a nice guy, we want him. Oh and look, he's also contributing to the community back, then yeah, that's cool, it's a bonus, not a feature, not a mandatory activity.

Why I rant? Because it's called Software Engineering, not Social Media monkey typing, ok? We are supposed to help the others automate things, making them better, improving their life and quality of life, supporting people that have disabilities with better, smarter, technology and overall do our small part of the contribution for advancing the humankind to the next stage. But because of the myth that "everyone can code", we've got hispsters and all those self-promoted ninjas and cowboys and whatever else they are who are not even related to what a Software Engineer is or should be. Please promote quality not quantity, pretty please.

Fragmentation on Android is hilarious

I was trying to create a new Android app today and using Android Studio (latest canary release, ofc).

Obviously in the process I've got to the platform targeting part. And then the shock came in.

Look at it... Seriously, look at it. There's more than 50% of the people who don't run on 4.4 or later. I mean c'mon, really?

I know forcing users to upgrade on mobile devices is hard, especially since the mobile manufactures don't really seem to care about existing users, security or otherwise getting latest version of the OS to their users (I guess it's not profitable, no?) But I seriously hope that Google can find a way to fix this sooner rather than later because it's getting hilarious at this point. Android M will be out soon-ish (September or close, right?) and by then there will be not two, not three but nine different versions if you want to target 100% of the platform and four versions in order to target about 50% of the users.

And people were moaning about fragmentation on desktop (Windows) just a few years ago when there were like 2-3 different versions only. 

As a last fun thing, HTC HD2 launched in ~2009 can run: Windows XP, Ubuntu MeeGo, Windows Phone 7, Android 5.0 (last I've checked) and I'm almost willing to bet it will run Android M as well. That's a six years phone who can run most of the OSes from out there proving that's in fact possible to have an updated phone if manufacturers would only care (oh and HD2 was meant for Windows 6.5, the community managed to do all the wonderful things I've just mentioned).

Sunday, July 19, 2015

Poor horse

Aside from developing some really awesome things at Tapglue, I also have to make sure that the infrastructure purrs as happy kitten and all things run as smooth as possible.
This means from time to time, I have to have a look on what's going on our servers, get some alerts about things running and, my favorite so far, get alerts when we detect new user agents.

The winner for this week is this one:
Someone is clearly in the very dark side of the Internet but hey, I'm not judging. Also, this horse appears to be just another attack on the cookies...
I hope someday people will stop trying to hack around things and contribute to the greater good of the humanity instead. That would be so much better.

Oh and yes, that's our server replying in 45 microseconds. It's fun, no?

IDEs, large code bases and speed

People often fear IDEs because they are heavy and bloated and slow. Turns out that if you at least give some of the good ones a try those reasons suddenly don't don't make any sense.

For example, I've been working for the past two years with Go and the Go Plugin for IntelliJ Platform and I keep hearing other Go developers that they don't want IDEs to be slow and bloated... So today I decided to have a look in my GOPATH and see what's the status there.
cloc $GOPATH/src

   82632 text files.
   60097 unique files.                                          
   64918 files ignored. v 1.60  T=147.84 s (139.7 files/s, 104402.4 lines/s)
Language                      files          blank        comment           code
Go                             8059         284504         421962        1676304
Javascript                     9136         255587         402064        1647059
HTML                            863          13471            639         193480
XML                             244           3343           1658         106258
C++                              95          15362           2627          80513
CSS                             504           7217           2036          71332
YAML                            206            412            458          66475
SASS                            434       10003298           2829          43960
C/C++ Header                    148           3805           3771          29219
ActionScript                    112           1231           2593          16451
LESS                            168           1098            425           9209
Java                             15            642           1809           6947
Bourne Shell                    141           1237           1267           5707
Objective C                      46           1571           1261           5596
Python                           23            957           1029           4785
Assembly                         49            351            342           4665
C                                19            558            217           3178
Bourne Again Shell               65            515            401           2791
QML                              33            330            757           2269
CoffeeScript                     71            350            284           2024
Perl                             14            283            382           1823
make                             84            563            752           1618
Ruby                             53            312            293           1547
C#                               19            255            285           1372
DTD                               2            192            182            551
Lisp                              4             45             86            252
SQL                               5             64            103            237
Maven                             2             11              0            203
CMake                             3             29             31            150
MSBuild scripts                   2              0             14            132
JavaServer Faces                  3              3              0            109
vim script                        4             24             45             93
D                                 9              0              0             87
Smarty                            6             17             30             86
m4                                1             17              0             76
DOS Batch                         2             27             16             68
XSLT                              1              5              0             32
IDL                               1              8              0             25
ASP.Net                           2              5              0             23
SUM:                          20648       10597699         850648        3986706

And you know what? Turns out that the plugin handles this just fine. It takes about 30 seconds to do the initial indexing, which is one time only and then that's it (it took cloc almost five times more just to count the lines).

Auto-completion works like it would have only two-three files to get the data from, which is astonishing fast when you consider the numbers.

So yeah, definitely a nice one so far.

My system:
- CPU Intel Core i7 4720HQ
- RAM 16GB
- SSD Samsung 850 Evo 120GB
- OS Kubuntu 15.04
- Java 1.8.0_45
- IntelliJ IDEA Ultimate 15 EAP
- Go plugin compiled from master (you can use nightly or alpha just fine)

Oh and get this, it helps you save key presses, cool no?

Friday, July 17, 2015

Debian goodies, literally

Today I've learned about a nice little package called debian-goodies,

Once installed it will add a few commands to the system of which I've found "checkrestart" to be amazing useful. It will tell you which running processes need a restart so that you don't need to restart your whole machine. Here's the man page for it

Speaking of restarting the machine, if you want to know if you should restart it because of an upgrade or something, you should perform a "ls /var/run/reboot-required". If output is 0 well, restart time :)

Back on debian-goodies, there's also the dpigs command which will tell you who uses the most space of the installed packages (it doesn't include the files that the app(s) from that package will generate but still useful)