Wednesday, April 26, 2017

Bitcoin cloud mining: Hashflare vs Genesis

Bitcoin cloud mining

Update: Hashflare announced that they ended lifetime contracts for sha256 and scrypt contracts starting at 1st September 2017 so all new and existing contracts will be valid for one year only. So the comparison below is not valid now because genesis did not make a change yet. At this time it is obvious  that genesis is much better for sha256 contracts. However you can still compare both for other types of mining contracts.


Recently i've been involved in bitcoin/litecoin mining by using cloud miners Hashflare and Genesis mining. Even though some people think cloud mining is generally a scam these companies seem to be the most reliable cloud miners as i searched on the net. I've not invested too much on mining but i'd like to compare these services according to my experience.


Reliability

Both Genesis and Hashflare seem to be legit companies according to some research on the net but of course you're free not to trust these or any other cloud bitcoin miners. I always recommend starting with a reasonable amount of investment that you could risk.

Security

Hashflare and Genesis probably use different software according to their website structures. Both have 2 factor login security option and i think this is a must for any financial investment services. Both use google authenticator for one time security code generation. You can install google authenticator application to your smart phone and use it each time you login to hashflare or genesis mining websites when you enable 2FA for these services.

** Please read the note below wallet settings section for a difference between hashflare and genesis.

Currencies

For both Hashflare and Genesis bitcoin (BTC) and litecoin (LTC) mining are available. There are also other cryptocurrencies like DASH, ETH etc. for different type of investments.

Wallet settings

To get payments for your cryptocurrency mining earnings, you need to have wallets for these currencies. Hashflare and Genesis require you to enter your wallet address in your account settings for currencies you'll get payments for. While hashflare makes BTC and LTC payments to your BTC wallet address, Genesis has different wallet address settings for BTC and LTC.  Hashflare has BTC, LTC, DASH and ZEC wallet address settings while Genesis has many more cryptocurrency wallet address settings for about 15 currency types. I dont know why there are so many wallet settings for genesis for you only see 5 types of mining order sections while making an order.

Security Note: For hashflare accounts, if you change your wallet settings the system blocks your account against payments for 2 weeks for security. And you need to click the link on confirmation email sent to you when you change wallet setting to make this change active. However genesis doesn't block your account in this situation but only send a notification email to you. So hashflare is more secure than genesis in this way.

Mining Contracts (Hashrate Orders)

In Hashflare you buy hashrate according to algorithm (SHA-256, Scrypt, Ethash, X11) while you see hashpower order options on genesis according to currency name. Both Hashflare and Genesis have different sized hashrate order packs but Hashflare has more resolution while Genesis has a selection with larger packs of hasrate orders. You can start with very little hasrate power with Hashflare while you need to spend about 30$ for your first order with Genesis mining. Both services have open-ended mining contract options for BTC but Hashflare also has Scrypt mining besides bitcoin. Hashflare has yearly mining contract options while Genesis has contracts for 2 years. For Genesis 2 year contracts, there is no maintenance fee but i couldn't see this information for hashflare yearly contracts on the order page.

Auto invest 

Hashflare has a nice feature that allows you to reinvest your balance automatically which is a nice for who want to continue investing with their earnings without need to manually order packages. Auto invest options are Sha-256 and Scrypt for hashflare. Genesis has no reinvest feature at the moment.

Payments

Hashflare and Genesis both have minimum payment limits but they differ in the way they do payments for your earnings. As i see Hashflare keeps your balance if you don't request a withdraw but Genesis makes daily payouts as long as your balance is over minimum payment limits. Some people may prefer daily payouts while some would like to control whenever they get payments so this is up to your preference.

Control panel and management

I think Hashflare has a much better control panel and dashboard to see your balance, investments and earning reports. Genesis has reporting features too. Both services have graphs and reports for earnings etc. but hashflare seems to be much more transparent for giving data and control about your investments. Hashflare allows you to select which pools you want your mining will be worked on but genesis has mining allocation which allows you to allocate your hash power among different algorithms (sha/scrypt) and currencies. By selecting pools and allocate mining power as percentage, Hashflare allow you to try different combinations to see which combinations are better for your earnings. The graphs of Hashflare are much better and easily understandable. For example you can easily see your earnings and balance graph on dashboard on the same graph which will make you see your daily earnings at a glance. Genesis have graphs and reports too but Hashflare seems to be much better for this. Hashflare dashboard also gives you some useful information like Revenue per 1 TH/s which makes you see how your pool allocation performs and Revenue forecast data gives you an idea about what you can earn in future periods (day, week, month, 6 months and year).

Conclusion

At the moment i can't say something about ROI or earning potential for both mining services but i think that hashflare has a more transparent system that gives you more control and easy reporting. However Genesis mining makes daily payments so if you prefer automatically get payments Genesis can be your choice. Anyway bitcoin mining has risks and may not return your investment in the period you guess so i advise that you should only be making investments in a reasonable amout. Another point is that hashflare seems to be selling hashrates for cheaper but we can't blame genesis because it makes daily payments and so they need to supply payment costs everyday. However if daily payouts is not important to you and you are ok to request payments manually you can prefer hashflare.

*** UPDATE: I've realized that that term "payout" is given differently for genesis and hashflare. Genesis names the net BTC/LTC revenue for user after maintenance fee reduction as "payout" which is how you should expect, but hashflare shows payout values without maintenance fees taken into account so when you look at the graphs on dashboard you see much higher BTC payouts and revenue forecast values according to genesis. I think this kind of reporting is not fair and its like cheating users so that they think the numbers they see are net payouts on graphs and reports. After this difference taken into account when i compared net BTC payouts for both services for a few days history, i saw that genesis payouts were higher than hashflare after maintenance fee reduction. So if this is important to you you can prefer genesis over hashflare.


If you'd like to try bitcoin mining by using Hashflare or Genesis mining, you can use the following codes to get a discount for all your hashrate orders.

Hashflare coupon code: FB0E39B7

Genesis coupon code: zqWh60

Wednesday, March 15, 2017

How to get latest images from an instagram account easily

In a web project i've recently been involved in, i needed to get latest images from the instagram account of website owner. As i haven't made this before i've searched and visited many web pages and seen many examples mostly using the instagram api to get latest images of a given instagram account. However i didn't need users login using their own instagram account and show their own images on the website so i thought there must be another way to get publicly shared images from an instagram account. Finally i've seen that despite its not mentioned in instagram api docs there is another simple way without using any api and external code to get latest images from an instagram account.

I've found that you can get latest media of an instagram account as json by getting content of an url in this format:

https://www.instagram.com/[user_id]/media/

Instead of [user_id] you must use the user id of instagram account. The result is a json data which includes many information about latest media from that user on instagram. As i see this url returns latest 20 media publicly shared from the instagram account.

You can use CURL to get contents of this url and parse using json_decode() function in php easily and get information you need from latest images. In my case i only needed image and links so i parsed only these information. Below is the php code i used to show latest instagram images on a web page:

$instagram = new Plugin_Instagram('instagram_account_user_id');
$images = $instagram->getMedia(3); // get only latest 3 images
foreach($images as $p){
// some html code here }

And here is the content of the class Plugin_Instagram i've written to get latest images from an instagram account:

class Plugin_Instagram {
public $user_id = '';
public function __construct($user_id) {
$this->user_id = $user_id;
}
public function getMedia($count=20){
$url = 'https://www.instagram.com/'.$this->user_id.'/media/';
$json = $this->fetchData($url);
$data = json_decode($json);
if(!isset($data->items)){
return array();
}
$return = array(); $i=0;
foreach($data->items as $post){
$return[] = array(
'link'=>$post->link,
'type'=>$post->type, 'img'=>$post->images->thumbnail->url,
'img2'=>$post->images->low_resolution->url,
'img3'=>$post->images->standard_resolution->url,
);
$i++;
if($i>=$count){
break;
}
}
return $return;
}
private function fetchData($url){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 20); $result = curl_exec($ch);
curl_close($ch);
return $result;
}
}

You can change the return array if you need more information about the latest images from instagram account.


Monday, March 6, 2017

Replace php short tags in all php files with netbeans

I've needed to replace short php tags (<?) in my old php files to standart php tags (<?php) for compatibility on most servers. I've found a regular expression which you can use in netbeans or another IDE/editor to make this change quickly in all your project files. To apply replace first open your netbeans project and click the project name on side menu as a selection of scope. You can select a subfolder too if you want to apply replace limited to scripts in a directory. Then type Ctrl + H to open replace tool window. Enter Containing Text and Replace With values as following:

Containing Text: <\?( )*(?!php)(?!=)(?!xml)(?!mso)
Replace With: <?php

Note that the replace text should contain a space at the end to avoid problems. Also make sure match option is selected as Regular Expression. You can enter File Name Patterns value as *.php if you need.




When ready click Continue to let netbeans find all replaces. If it finds any you should see the results like that:




You can select which results will be replaced by using the checkbox for each file. When ready click the replace button at the bottom to replace php short tags in files.

By applying this replace on netbeans or another IDE which has this feature, you can update short tags to standart php tags which is a better usage. However the usage of <?= ?> style expressions don't need to be replaced as you may have noticed in the regular expression rule we've used.

Sunday, March 5, 2017

Upgrade to Linux Mint 18

I've upgraded one of my computers to Linux Mint 18 from 17 using the steps on this page:

https://community.linuxmint.com/tutorial/view/2316

First i've upgraded to version 17.3 by using the menu on update manager. Than i've started upgrade process to version 18 by using the steps on previous url which took me a long time to complete (possibly bacause of internet connection problems).

I'd like to write some of the changes i see during my usage.

First of all i've noticed that PHP version has been updated to PHP 7 which was something i wanted and that was actually the main reason to upgrade Mint for me. However i'll need to make some changes to my framework to make it compatible for PHP 7.

Another change i've found is about scrolling behaviour which has been reversed in direction. When i scroll down the page content goes up as opposite to the classical behaviour of scroll on pages. But i have changed this to the normal direction by disabling the setting "Natural scrolling" on touchpad settings of control panel.

I've also discovered that there has been a change with text fonts on google chrome which may be caused by default font definitions of Linux Mint on the new version. I can also feel that the terminal font seems to have changed.

On desktop i can't actually notice a change except that texts of icons on desktop have changed color to black so that i cant see them on my previous solid black background. Text color changes to white when i set theme but this happened again the next session so i have changed the background. Let me remind that as in every new version of Linux Mint there are many more desktop images you can select from for your desktop.

You can also realize that some apps have been renamed in Linux Mint. For example Pluma has been replaced by Xed.

---
I'll continue updating this post as i experience new changes or problems i may have so that users who have the same problems may found it useful.