You will get 3000 xp first time your friend opens gifts, after 7 days of opening present you get 10000 xps, 30 days 50000 xps and 90 days 100000 xps.
Wednesday, November 25, 2020
Pokemon Go: Networking - get to level 40 in 90 days!
You will get 3000 xp first time your friend opens gifts, after 7 days of opening present you get 10000 xps, 30 days 50000 xps and 90 days 100000 xps.
Posted by
Ivica Ceraj
at
7:29 AM
0
comments
Labels: pokemon go friends, pokemon go level up, pokemongo
Tuesday, March 10, 2015
Facebook: All time ranges must be midnights - Not every day is like another, some days are 23h and some are 25h long
Facebook has funny thing about their API. They require timestamps used in their report to be on midnight boundary in your local timezone.
Originally I wrote this code:
facebook_time = DateTime.parse(@run_date.to_s).utc.in_time_zone('America/Los_Angeles').midnight.to_i
time_interval="{time_start:#{facebook_time}, time_stop:#{facebook_time+24*3600}}"
That worked great until daylight savings kicked in, and failed with "All time ranges must be midnights", so after a bit of debugging I changed it to this one:
facebook_time = DateTime.parse(@run_date.to_s).utc.in_time_zone('US/Pacific-New').midnight.to_i
facebook_time_end = DateTime.parse((@run_date+1).to_s).utc.in_time_zone('US/Pacific-New').midnight.to_i
time_interval="{time_start:#{facebook_time}, time_stop:#{facebook_time_end}}"
I hope this will help someone spend less time debugging.
Posted by
Ivica Ceraj
at
7:18 PM
0
comments
Labels: facebook, facebook ads api, ranges must be midnights, ruby
Friday, February 20, 2015
Creating Users and Databases
It is tedious to create database. Well, not really hard, just annoying.
While 3 lines of code to create database, create user and grant user privileges to the database are not hard to write, one needs to remember correct syntax and to place same text 2-3 times.
To mitigate this issue, I created a tiny template to help me with it. It is available at:
Sunday, January 4, 2015
Did you ever wanted to know when a webpage changed?
There is a new web service - WebFollower - what it does is a simple simple, but still important task.
Here is how it works - you sign-up with your Facebook account and go to the dashboard.
On the dashboard you add URLs you'd like to monitor and web follower crawler checks if page has changed. If it didn't than nothing happens and WebFollower's crawler checks it again later. If it did change WebFollower sends you an email notifying you that page changed. If you want to be notified of change when page changes again, you'll need to re-enable it on the dashboard.
That's it - a simple and hopefully useful service.
Monday, August 25, 2014
Setting up ghost on the Openshift
In past few days I decided that I would like to keep track on my progress in how I learn new stuff. After some consideration I hope a good way to organize my work would be to use Ghost: is just a blogging platform funded on Kickstarter last year. I have heard all the hype when Ghost got funded and tried to use it early on, but it was disaster to when it was first released. Also, I didn't have a good use case to keep working at it, but now... here is an opportunity.
Quick googling ghost resulted in number of links as a community seem to be sprouting around it. I read a good introduction on setting it up and on its current features on "Ghost for Beginners". The site covers how to set Ghost on Ghost(PRO), AWS and DigitalOcean, but there was nothing about my favorite hosting solution - OpenShift. So I figured I can write a post on setting Ghost on OpenShift.
At first I tried to set it up using OpenShift's console, but that yielded in an error:
Attempting to install through web interface failed twice, I was a bit discouraged, so finally I attempted to try running rhc command from terminal. That worked like a charm:
rhc app create ghost nodejs-0.10 --env NODE_ENV=production --from-code https://github.com/openshift-quickstart/openshift-ghost-quickstart.git
And here is terminal output:
Application Options
-------------------
Domain: _MY_DOMAIN_
Cartridges: nodejs-0.10
Source Code: https://github.com/openshift-quickstart/openshift-ghost-quickstart.git
Gear Size: default
Scaling: no
Environment Variables: NODE_ENV=production
Creating application 'ghost' ... done
Waiting for your DNS name to be available ... done
Cloning into 'ghost'...
The authenticity of host 'ghost-_MY_DOMAIN_.rhcloud.com (54.82.127.129)' can't be established.
RSA key fingerprint is cf:ee:77:cb:0e:fc:02:d7:72:7e:ae:80:c0:90:88:a7.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'ghost-_MYDOMAIN_.rhcloud.com,54.82.127.129' (RSA) to the list of known hosts.
Your application 'ghost' is now available.
URL: http://ghost-_MY_DOMAIN_.rhcloud.com/
SSH to: 53fba91d5004466ac7000306@ghost-_MY_DOMAIN_.rhcloud.com
Git remote: ssh://53fba91d5004466ac7000306@ghost-_MY_DOMAIN_.rhcloud.com/~/git/ghost.git/
Cloned to: /Users/_MY_USER_/Source/ghost
Run 'rhc show-app ghost' for more details about your app.
Ghost correctly appears in the console after that:
Here is a snapshot of Ghost homepage:
I added the user, and published test post:
Thursday, May 22, 2014
FIX: Django, uwsgi, Apache, ProxyPass, host is localhost and using ProxyPreserveHost
I just spent some time trying to figure out how to set our Django application.
Our setup is:
Apache (handles HTTPS and client certificates) is front-end proxy to uwsgi
uwsgi is used to run Django application in the backend.
The problem we faced is that our redirects were broken as links build by django used 'localhost' instead of name of the virtual host. After looking through solutions, and finding some of the issues like:
- Redirect is broken when HTTP_X_FORWARDED_HOST contains multiple hosts
- django.http.get_host() breaks reverse proxying on apache
Posted by
Ivica Ceraj
at
8:23 AM
0
comments
Labels: apache, django, proxypass, ProxyPreserveHost, reverse proxy, uwsgi
Tuesday, March 11, 2014
MacOSX & Chrome: How to make scrollbars ALWAYS visible in your web application
If you are, like me, annoyed that overflow: scroll does not display scrollbars on all MacOSX computers in chrome; you can actually force Chrome to behave by just adding this to your CSS:
::-webkit-scrollbar {
-webkit-appearance: none;
width: 7px;
}
::-webkit-scrollbar-thumb {
border-radius: 4px;
background-color: rgba(192,192,192,.3);
-webkit-box-shadow: 0 0 1px rgba(255,255,255,.5);
}
Friday, February 28, 2014
How to calculate MD5 and SHA1 fingerprints using web browser?
Downloads and fingerprints
MD5 and SHA1 fingerprints often listed next to the large files one can downloads from files are there to ensure that data downloaded is the same as the data on the server. It is a good policy to always check if downloaded file has the same fingerprint as the one provided from the trusted source.How to perform MD5 or SHA1 check using web browser?
Monday, February 7, 2011
Dropbox (Error code -36)
Today, I was faced with Dropbox 'Error 36' on MacOS.
So, let's start from beginning... Dropbox has file name limitations, and those limitations are a bit different than operating system limitations (MacOSX).
I am convinced that there are good reasons for these, as they have special meaning on the command line level or would look really weird in the browser.
Let's start with the issues:
- Issue 1: File names can not start or end with blank character
- Issue 2: File names should not contain slashes
Where issue 2 is easy to spot, finder does not make it easy to spot issue 1. Thus I have created a short script that fixes blank characters in file names.
You can download dropbox_fix_script.pl. You need to navigate to the folder you are trying to copy, unzip and run this script from terminal.
Before you run this script, make sure to backup your data.
If there are enough interested readers, I may wrap this into application that you can drop a folder on.
--- script content is:
#!/usr/bin/env perl
#
sub fix()
{
my @list = `find .` ;
chomp(@list);
for my $file (@list)
{
print "." ;
my $base = `basename "$file"` ;
my $dir = `dirname "$file"` ;
chomp($base);
chomp($dir);
if( ($base =~ /\s+$/) || ($base =~ /^\s+/) || ($base =~ /\// )
{
print "match $file\n" ;
$base =~ s/\s+$//mig ;
$base =~ s/^\s+//mig ;
$base =~ s/\//_/mig ;
print "\n" ;
return ( $file, "$dir/$base");
}
}
return undef;
}
while( 1 )
{
my ($file, $new_file) = &fix();
if( defined( $file ) )
{
print "rename '$file' '$new_file'\n" ;
if( -f $new_file )
{
print "file already exists $new_file -- fix $file \n" ;
exit ;
}
if( -d $new_file )
{
print "dir already exists $new_file -- fix $file \n" ;
exit ;
}
rename $file , $new_file ;
}
else
{
last;
}
}
Wednesday, January 26, 2011
DNA reverse complement
Just published simple DNA reverse complement tool. It features reverse sequence generation, complementary RNA and DNA generation and of course reverse complement for both DNA and RNA. Check it out.
Posted by
Ivica Ceraj
at
8:06 PM
0
comments
Labels: complement, dna, reverse complement, reverse sequence, rna
Wednesday, January 19, 2011
Click-o-mania and cyclick-o-mania in pure HTML
Last time I wrote click-o-mania clone was in summer of 1999. I wrote it in an MIT Athena cluster one summer day with the idea that it would help me with, than fresh Java skills.
Now the time has come, and I wanted to work on my GWT skills - thus - new HTML only, Flash-free, Java-free version of Click-o-mania and cyclick-o-mania are available. This simple games are written in using GWT/Java and compiled and tested on Mac and Windows, in variety of browsers and also adapted to work on iPhone. If they work well on Android, I would be interested to hear.
I hope you will enjoy these games as much as I enjoyed writing them.
Wednesday, September 8, 2010
Punnett Square at Bugaco.com
I just started writing Punnett Square calculator. It seems to be a nice tool for understanding inheritance relationships. Check it out at: http://www.bugaco.com/calculators/punnett_square.php
Posted by
Ivica Ceraj
at
8:23 AM
0
comments
Labels: bioinformatics, calculator, on-line calculator, punnett square
Wednesday, March 31, 2010
Eclipse - Linux - Unable to connect to repository
I just moved to new Ubuntu 10.4, and downloading Eclipse or Aptana Studio suddenly stopped working with repositories. This is very very annoying as I'm unable to install pydev and continue working on my improvements of Analytics@bugaco. So, what I had to do something to fix it. It seems that I am not the only one with this problem.
The problem seems to be related to Java's preference to use IPv6 stack over IPv4 stack that causes some systems to be unable to connect to web sites.
Fix for it is documented at debian's bug report's list. The reading is quite verbose, so I'll document cookbook solution that just works for me.
Open your eclipse.ini file, at some stage it has -vmargs line, after that line add following define:
-Djava.net.preferIPv4Stack=true
Original file
-startup plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar --launcher.library plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.200.v20090520 -product org.eclipse.epp.package.cpp.product -showsplash org.eclipse.platform --launcher.XXMaxPermSize 256m -vmargs -Dosgi.requiredJavaVersion=1.5 -XX:MaxPermSize=256m -Xms40m -Xmx256m
New file
-startup plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar --launcher.library plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.200.v20090520 -product org.eclipse.epp.package.cpp.product -showsplash org.eclipse.platform --launcher.XXMaxPermSize 256m -vmargs -Djava.net.preferIPv4Stack=true -Dosgi.requiredJavaVersion=1.5 -XX:MaxPermSize=256m -Xms40m -Xmx256m
Good luck! Let me know if this fixes your problem...
Posted by
Ivica Ceraj
at
7:26 PM
Labels: eclipse, unable to connect to repository eclipse, update site
Sunday, November 15, 2009
Windows 7 on Acer TravelMate C110
Posted by
Ivica Ceraj
at
7:07 PM
31
comments
Labels: windows 7 acer c110 travelmate graphics networking sleep
Friday, November 13, 2009
Setting Putty with Kerberos on Windows (including Windows 7)
UPDATE: Putty now supports Kerberos out of the box - see comment below
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
Dual Boot USB stick with Windows 7 and Ubuntu 9.10 (Karmic Koala)
introduction
I setup on doing a dual boot (or hopefully dual boot + dual install) of Windows and Ubuntu on USB stick. This proved to be more challenging than I would expect, so I'll try to outline what my conclusions are and how to make dual boot stick.
Let's start with the basics, unlike Vista, Windows 7 optimizes driver installation when it boots, preventing it from booting from USB stick on different machine (or different type of the machine) than it was installed on. This yields a simple result that one probably does not want to install Windows 7 on USB drive, but only to have bootable install partition.
Ubuntu's option to make bootalbe USB drive asks for amount of persistent space that you can use to keep your data on USB drive, thereby really making USB drive a full install without a need to additional partition with "full install".
This leads us to needing only bootable Ubuntu and bootable Windows 7 install. While it may be possible to boot Ubuntu from windows bcd bootloader, I opted for opposite direction thus booting into Ubuntu boot screen that has an option to start Windows 7 installer.
My first few attempts to get syslinux (Ubuntu installer to boot Windows from same partitino were unsuccessful). My next few attempts to get windows to boot from second USB partition were as well unsuccessful and at the end I found this prescription that works.
the prescription
1. Boot into Ubuntu Live CD
2. Start GParted and create two primary partitions (first at least 2.5Gb, and second at least 1.1Gb)
3. Format both partitions as FAT32
4. Boot into Windows
5. Note drive letter of your USB drive's first partiton (example Q:)
6. Go to Windows 7 installer DVD (or folder where you extracted ISO using 7-zip)
7. Go to boot folder and from command line (with Administrative privilegies) run:
bootsect /nt60 Q: /mbr
8. Extract Windows 7 DVD files to your USB drive (example Q: drive)
9. Boot back into Ubuntu
10. Make bootable usb drive (option from Administration menu)
11. Get chain.c32 from syslinux and copy to /isolinux folder
12. Get ldlinux.sys from syslinux and copy to / folder [this may be optional step]
13. Edit text.cfg and add at the end:
MENU LABEL Windows 7
COM32 /syslinux/chain.c32
APPEND hd0 1 ntldr=/BOOTMGR
14. Dual boot your Windows 7 Installation
Happy dual booting...
Friday, October 23, 2009
Analyics @ Bugaco allows embedding analytics data in web pages
Analytics @ Bugaco is updated with a new feature - stored reports.
Currently only google maps report can be stored. When report is stored, user is given URL that can be embedded or shared with friends.
Analytis @ Bugaco is collection of freely available reports that utilize Google Analytics data to produce additional report. The tool was originally announced in this blog post.
Here is an example of stored report.
Wednesday, October 7, 2009
Seagate Date Calculator for iPhone
In previous blog post I talked about seagate date code calculator. It seems to be useful tool for the people out there, and I decided to revamp it. It has better user interface, and I now created off-spin that works well on touch devices like iPhone.
Wednesday, September 23, 2009
Reports that were missing from Google Analytics are being developed at analytics.bugaco.com
Did you ever feel like Google Analytics is somewhat constrained in reports it has?
If the answer to this question is NO - that stop here and go do something else.
If on the other hand you wanted to do more with google analytics, but it was almost impossible to get a report you wanted, you may be interested in a new effort at Analytics @ Bugaco.
It starts as a modest effort that created two custom reports that use Google Analyics API to provide different reports than ones provided by Google Analytics itself.
It is in early stages of development, and any comments that would make it better are welcomed by development team. All comments you do send will be seriously evaluated and prioritized.
So, what is Analytics@Bugaco at this early stage of development?
At this time Analytics@Bugaco has two reports - one is oriented toward developers - it allows you to determine what kind of screens your users have, and thus it will help you design better software/website layouts that will fit your real users.
Another report available is mapping visitors on google map. This is cool for a few reasons, and where we intend to go with it is to allow you to include generated map into your website. For an example of how this would work visit Software Tools for Academics and Researchers site. They have a map that displays visitors from last 30 days - it's an cool and impresive map, and what's really cool, you can zoom in and see your city!
At this stage, through map is not embeddable, but with sufficient interest (read comments) it will be put ahead of other priorities.
Thanks, and enjoy Analytics@Bugaco site
Posted by
Ivica Ceraj
at
7:16 PM
0
comments
Labels: analytics api, custom, custom reports, free, google analytics, google map, reports, website
Monday, September 14, 2009
Sequence conversion tool
There is new sequence conversion tool at Bioinf @ Bugaco.com. It allows conversion between 16 most popular sequence formats.
Here is direct link to sequence conversion utility
What is really cool is that it supports:
- ace
- embl
- fasta
- fastq
- fastq-solexa
- fastq-illumina
- genbank
- ig
- nexus
- phd
- phylip
- pir
- stockholm
- swiss
- tab
- qual
Posted by
Ivica Ceraj
at
8:47 PM
0
comments
Labels: ace, conversion, embl, fasta, fastq, fastq-illumina, fastq-solexa, genbank, ig, nexus, phd, phylip, pir, qual, sequence, stockholm, swiss, tab






