Complete Guide of Battle.net OAuth API and Login Button


I play Overwatch like crazy and I use sites like overbuff and masteroverwatch.I like their battle.net login buttons and wanted to create a simple site to beat matchmaking system. I didn’t realize that this will be a huge struggle.Here are the official docs:https://dev.battle.net/docs/read/oauthGet this Chrome Extension to try get post requests, amazing extension including authentication features:https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?hl=enSign up first Go to the https://dev.battle.net and create a mashery account. Create your first app You can put localhost as callback url, you MUST put it as https://localhost https is really important let’s keep this in mind. Note your client key and secret and redirect_uri which must be an HTTPS url.Get authorization codeOauth is usually 2-steps. First you authorize the user and then use this authorization to obtain an access token in order to make requests to battle.net on behalf ...

Simplest Raspberry Pi 3 setup as a home server - Jan'17


I’ve just done it and I don’t want to forget this struggle. Buy a super fast 32 gb sd card - keep your adapter because most of the new computers only have sd card slots not micro sd slots. Format sd card as FAT - MSDOS with Disk utility -> Erase on Mac Right click -> Format on Windows Disks on Ubuntu Download NOOBS - easy UI to select which OS should be installed into your pi. Don’t bother flashing yourself with raspbian etc. Extract NOOBS zip and copy all of the files (if it’s extracted into a folder just copy its content, root of the sd card must have a couple of files, not one directory) Put your recently formatted and NOOBs copied sd card into the pi and then wait a little bit Plug your raspberry pi into micro usb Plug your monitor via an HDMI cable Plug your mouse and keyboard (mechanical keyboards take some time though to be recognized, just wait a little bit more) NOOBS UI will show up, for raspberry pi 3 you can connect to wifi. You ca...

Enable SSH access to your fresh Ubuntu install (16.10)


Leaving this here since I should not spend another hour to figure this out in my next fresh ubuntu install.Install ssh server first:sudo apt-get install openssh-server And open the port:sudo ufw allow 22Find your IP addressifconfig

My site is hacked with an interesting method


I have a small Turkish meme site. It’s very simple and easy to maintain.I use cloudflare for caching, SSL and DNS stuff and I love it.However, today I realized that my site started to redirect to some weird site which says some random “Your flash is outdated, please update”. Check chrome network tab - can not see anything because it’s a redirect and all info is gone. Check domain provider - all good Check Cloudflare DNS settings - all goodLast resort I tried to find out the HTTP request call tree.I’m breaking the redirection URL because I don’t want to send them traffic.curl --head guldum.netHTTP/1.1 301 Moved PermanentlyDate: Thu, 19 Jan 2017 17:24:22 GMTConnection: keep-aliveSet-Cookie: __cfduid=d0af6e03ce78a3a99580dc2bbc87c90c31484846662; expires=Fri, 19-Jan-18 17:24:22 GMT; path=/; domain=.guldum.net; HttpOnlyLocation: https://goo.gl/ H41yAyServer: cloudflare-nginxCF-RAY: 323bfadaa6ec3470-LHRIt has a 301 redirection, it immediately popped up in my mind: Page rules. I checked ...

Weekly roundup - 11


Wordpress released .blog extension, get yours with an incredible price. eg. hakan.blog -> 5220 euro, thanks, feeling valued. https://get.blog/ Get Android debug keystore hash (SHA1, SHA256 or MD5) - useful for firebase authentication:keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android Star Citizen 2016 - Gamescom trailer: https://www.youtube.com/watch?v=GucYhhLwIxg Android Nougat 7.0 Official website TheVerge review Yet another betalist clone: http://www.betafy.co/ I needed a Mac’s Preview like image editor to quickly resize/stretch images for Chrome Webstore. I made my logo but it turned out to be 128x127px so I need to make it 128x128px. Spent like 15 minutes. Tried these ones: Geeqie * sudo apt-get install geeqie Gthumb * sudo apt-get install gthumb Shotwell image viewer Nautilus right click context menu resizer * sudo apt-get install p...

Weekly roundup - 10 #pocket #ai #rtos


‘Pink + Purple == Fuchsia (a new Operating System).’ HN discussion They say it’s an OS for augmented reality with predictable latency times like a RTOS. Let’s see. https://fuchsia.googlesource.com/magenta/+show/master/docs/mg_and_lk.md https://github.com/fuchsia-mirror/escher https://fuchsia.googlesource.com/ What we learned from running Fuchsia, the mysterious new OS from Google This week I was sooo annoyed with Pocket so I decided to start a new project. Stay tuned! Meanwhile I tried these ones: Basket Raindrop Flynx’s reader UI Instapaper Problem is that Pocket and these ones have problem with really simple sites like Medium, wikipedia and my favorite eksisozluk.com For the people with lack of color abilities while doing the web design: http://jxnblk.com/hello-color Play MS-Dos games in the browser for free without DosBox https://archi...

Weekly roundup - 9 #sqlite #python #bash


SQLite dump a table as csv: sqlite3 -header -csv mydb.db "select * from my_table;" > monthly.csv See the schema * cat .schema | sqlite3 mydb.db Redirect output to txt file from sqlite cli. * $ sqlite3 mydb.db * `.output my.txt` * `select * from my_table;` * OR just dump the whole db * `$ sqlite3 mydb.db` * `.output my.txt` * `.dump` Bash - check if a command is installed in the machine:command_exists (){ type "$1" &> /dev/null ;}# Install csvtojson if not exists.if command_exists csvtojson ; then echo "csvtojson exists"else echo "Installing csvtojson" sudo npm install -g csvtojsonfi Python multi threading: Pass parameters to the threadimport threadingdef F(): threading.Thread(target=Foo, args=(my_param,)).start()def Foo(my_param): print 'This is a long running process' Jekyll multiline code blocks for github pages (kramdown):```language_namesome_code_here(...

Useful BeautifulSoup Tips #bs #python #scraper


Poor man’s scraper…Yes it works like a charm even on the unvalidated html. That’s my biggest problem with python libraries like lxml etc, they don’t really work well with the unvalidated html/xml trees. However BeautifulSoup does everything it can.Here are some handy commands I use every day: Install: sudo easy_install beautifulsoup4from bs4 import BeautifulSoupsoup = BeautifulSoup(html_doc, 'html.parser')# Prettify your html. Works amazingly well.print soup.prettify()# Find one element in the html by tag name.soup.find('a')# Find all elements in the html by tag name.soup.find_all('a')# Find one element in the html by having a class name (multiple classes will be found as well):soup.find('a', {'class': 'some-css-class'})# Find one element in the html by having a class name (multiple classes will be found as well):for s in soup.find_all('a', {'class': 'some-css-class'}): print s # Get element's text within the tags:soup.find('a', {'class': 'some-css-class'}).get_text()# Get ele...

Weekly roundup 8 - #css #oneplus


Oneplus 3 is awesome, the best phone I’ve ever used so far. And it’s amazingly fast after Nexus 6p. Full review will come. Pokemon Go still going strong, here is the map created by consuming information from directly Niantic’s servers: https://github.com/AHAAAAAAA/PokemonGo-Map Duckduckgo thinks Telegram is not secure Postgres team discussed the Uber’s migration from Postgres to MySQL https://www.postgresql.org/message-id/5797D5A1.5030009%40agliodbs.com This was Uber’s original post Cool discussion in Hacker News about how postgres acted mature instead of replying back each claim. By the way, TIL: postgres is the successor of Ingress which is the core developer’s first rdbms. So it’s name is coming from post-ingress. This week I dedicated some time reading Language Translation with Machine Learning by using Natural Language Processing. Rough chart Weird Jekyll update My blog was down for a couple of ...

Weekly roundup - 7 #domain #parse #pokemon


There was a coup attempt in Turkey so I skipped writing new posts. Here I go again. Openshift is incredibly easy to set up ghost and wordpress for free. Free tier’s response times are amazing, you can even uploada images. I really like ghost, I’d definitely go back if I didn’t move my blog to gh-pages. You can even set up phpMyAdmin for free without spending any of your gears. I mean literally free! Namecheap has added catch-all filter for incoming emails. So no need to use mailgun filters any more. Started to play Overwatch, no more side projects :/ Successfully migrated one of my apps from Parse.com to my self-hosted parse server in heroku free tier which is backed by MongoLab (mLab). So it’s still free but of course not as performant as before. MLab puts some latency and heroku free tier apps sleep 6 hours per day. Let’s how it will go. However, this was a tricky process. May write something about it later. Become level 20 at pokemon Found this very...


subscribe via RSS