All posts by mydailyhacks

Howto add a Login with Facbook/Google Plus Botton to a Website

Many sites offer Login with Facebook or Google+ features in order to make it easier for new users to connect to members-only features: To get this for your project too you just have to follow some simple steps

Howto get the Facebook Login:

Go to https://developers.facebook.com/apps and create a new application by clicking “Create New App”. Fill out any required fields such as the application name and description. Put your website domain in the Site Url field. Once you have registered, copy and past the created application credentials (App ID and Secret) into the HybridAuth config file.

Howto get the Google+ Login:

Go to https://code.google.com/apis/console/ and create a new project. Go to API Access under API Project. After that click on Create an OAuth 2.0 client ID to create a new application. A pop-up named “Create Client ID” will appear, fill out any required fields such as the application name and description. Click on Next. On the popup set Application type to Web application and switch to advanced settings by clicking on (more options). Provide this URL as the Callback URL for your application: http://mywebsite.com/path_to_hybridauth/?hauth.done=Google Once you have registered, copy and past the created application credentials (Client ID and Secret) into the HybridAuth config file.

Mysql: Allow Access from an IP Address

In order to enable access from a remote client to a mysql server just perform the following steps:

$ mysql -u root -p
Enter password:

mysql> use mysql

mysql> GRANT ALL ON *.* to root@’192.168.1.4′ IDENTIFIED BY ‘root-pw’;

mysql> FLUSH PRIVILEGES

use ” ‘ ” in all four cases above.

Afterwards the remote client should be allowed to communicate the MySQL server you updated the privileges. This receipt usually solves the ERROR:

“Host is not allowed to connect to this MySQL server”

Tipps and Tricks creating a SSL Certificate

In order to create a SSL Certificate one needs a CSR request for the server first. Under Linux it is very easy to create such an request:

openssl req -new -newkey rsa:2048 -nodes -keyout domain.key -out domain.csr

will do the job. Afterwards you have a csr file and a private key in the directory where you executed the command.

If your private key is protected by a password you can remove the password by:

> openssl rsa -in old.key -out new.key

During this process it is necessary to give the password once. The new key will not be protected by a password any more.

Scientillion, the Best Way to Search for Physics and Science Articles

The Internet is a beautiful place. A simple search in Google or any other search engine will yield thousands of results within seconds. Even though major search engines have powerful features, they are designed for general searches. Scientists and researchers who are looking for physics and science articles are often left on their own to find what they are searching for.

There are lots of academic search engines online, but most of them focus on a single field of expertise. There are also search engines that provide citations from multiple fields. But the downside is that some search engines are subscription based. There are only a couple of search engines that are available for free. Researchers, who can’t find what they are looking for with the use of free search engines, will use computers in a college or university that are subscribed to academic search engines of their discipline. School libraries often have a list of the academic search engines they are subscribed to in their websites.

The good news is that there is a search engine that has been designed for the needs of the scientists. And the best thing about it is that it is free to use. Scientillion makes it possible for users to make searches based on formulas or any other scientific term. This is useful for researchers who are required to do a lot of physics and science searches online. The search engine can look through thousands of e-prints of scientific papers from all fields of science that include astronomy, computer science, biology mathematics, and physics, just to name a few. In order to have a successful science project, the researcher needs to read a lot of scientific literature that are relevant to their study. And in order to find the scientific articles, they can use Scientillion.

The search engine maintains an online formula database to make it easier for users who are looking for specific formulas. While Google and other search engines allow users to search for formulas, they are not able to render the mathematical syntax properly. Scientillion utilises a technology that allows the rendering of both code and text in the search results. The scientific search engine also provides interfaces to top scientific publications, such as ArXiv.org. Scientillion also allows real time search of the text within the scientific publications.
Scientillion is a great tool for scientists and researchers. It saves them a lot of time on their research. Even in its Alpha Version, Scientillion is a powerful tool to learn about the publications that are pertinent for your study. It strives to be the go-to source for scientific queries on the Internet. It provides a great service to students, researchers, and the scientific community in general.

The site is available under the following address: Scientillion – The ArXiv and Physics Search Engine<

BOINC: How to Turn your Laptop into a Research Lab

The Berkeley Open Infrastructure for Network Computing, known for short as the BOINC project, is an open source system that focuses on volunteer and grid computing. It was originally created to support the SETI@home project, but has become a useful platform for many other projects as well.

How it works is that people from around the world will volunteer their computers to provide processing power to these projects in order to help them continue running. These projects are quite expansive, and any donation of a computer’s processor will help the project to function better. Many of these projects are based in the sciences, such as mathematics, climatology, astrophysics and environmental science. They require the collection of a lot of data and need a lot of processing power in order to make sense of this collected data.

It was developed by a team based at the Space Sciences Laboratory at the University of Berkeley when they started the SETI@home project. Since its creation, the BOINC project has amassed over one million active computers all over the world, with over 400, 00 active participants. This is because the BOINC projects are all based on open source software, so just about anyone can contribute the processing power of their computer just by downloading a program for the project of their choice. This allows users with Windows, Mac OS, Android, Linux and FreeBSD operating systems to participate.

What makes the BOINC projects even more enticing is that volunteers can earn credits for the number of work units they’ve contributed to the project of their choice. People can work separately as individuals, or they can pool together as groups in order to earn more credits. The ranking of these credits is maintained, providing a means of friendly competition between users all over the world to try and beat each other in credit numbers. Some users have even invested more of their own money to purchase more processors, just to increase their credits.

One of the pioneering BOINC projects is SETI@home, which stands for Search for Extraterrestrial Intelligence. This is a scientific experiment that collects and analyses telescope data in order to find narrow-bandwidth radio signals from space. Since they don’t naturally occur in space, any detection of them would provide evidence of alien technology.

Another project is Asteroids@home, which seeks to discover the presence of as many asteroids in space as is possible for the computer to process, as well as analysing them, since very little is known about them. A third project is ClimatePrediction.net, where climate models are run on the computers of volunteers in order to answer the questions on how climate change affects the current state of the world, as well as in the future.

Make a Difference and Switch to Green Webhosting

The Internet itself is a very large place, and it can be quite difficult to determine just how much power is being used to keep it going. With the state of green house gas emissions as they are, it’s about time someone started taking the initiative combining the Internet with greener sources of energy.

According to The New York Times, there are at least 30 billion watts of electricity that are used, just to power the Internet. That’s a lot of fossil fuels that are being used. One would think that with the forward thinking of those who use the Internet, there would be more sources of green energy available. Sadly, that doesn’t seem to be the case. In fact, the energy consumption is actually increasing, with more and more people gaining access to the Internet from their homes as well as taking it with them on the go on their smartphones and mobile devices. This is a steadily growing problem that needs to be taken care of.

annotated_earth-moon_from_saturn
The earth photographed from the cassini space craft. Such a fragile jewel in the big void of the universe. Take care of it. (Foto: NASA)
Climate change is a serious concern that has been slowly altering the normal temperatures of the planet throughout the year. The greenhouse effect is making summers a lot hotter and winters a lot colder, which further increases the use of fossil fuels. Consumers are likely to turn the settings of their HVAC systems up even higher, which uses even more energy. Coupled with the increased use of the Internet during these times when people want to stay inside, it ends up being a circular problem with no end in sight.

That’s why we need to start reducing the energy consumption of the Internet by seeking alternative sources. There are several web hosting service providers who have started to use sources of green energy for just this reason. They are capable of still providing the same quality service while still saving the environment in the process. If you want to see changes being made, consider switching to and supporting green hosting in any way you can. It could soon become the standard by which we use the Internet and save the environment even further.

Web hosting services offering green hosting:

Some of the web hosting services out there that use green energy include Ecological Hosting, Green Geeks, and Hetzner. Ecological Hosting has been in the business of web hosting since 1999, and have made it their mission to provide services that interfere with the environment as little as possible. They rely on solar energy and other renewable resources in the services that they provide to the world. Green Geeks has been in the business for over forty years and has always made it their goal to have a positive energy footprint on the environment, through the use of wind power. Hetzner Online has provided many web hosting services through their choice of green energy, allowing more users to feel better about not harming the environment further.

CSS: How to create a three column layout without tables

In modern web design the use of tables got a bit outdated recently since they render slow and therefore do not contribute to a positive user experience. To everybody who is used to design his web projects with tables this might be annoying. However, CSS shows an easy way out here. You simply can mimic the behaviour of a table using division elements which contain each other in combination with CSS style sheets. The following example illustrates how this works. We want to reach the following requirements.

  • The page shall be divided in three colums
  • The central colum will have a fixed width
  • The remaining columns adapt their width dynamically

This layout can be very usefull if you want to see your content centred on the screen while the remaining white space is used for ads. The following code sample does exactly what has been required above:

[sourcecode language=”html”]
<html>
<head>
<style type="text/css">
.container {
float: left;
width: 100%;
}

.columnLeft{
width: calc(50% – 490px);
float:left;
}

.columnCenter{
width: 980px;
float:left;
}

.columnRight{
width: calc(50% – 490px);
float:left;
}
</style>
</head>
<body>
<div class="container">
<div class="columnLeft">
&nbsp;
</div>
<div class="columnCenter">
Central Column
</div>
<div class="columnRight">
Right Column
</div>
</body>
</html>
[/sourcecode]


To calculate the width in CSS dynamically the calc() function is used. It allows also to subtract a width in pixels from a width in percent. In case you want to have a empty column you should add a space like in the example, otherwise it will not render properly in some web browsers.

Help, My Server Reboots Randomly! What Could Be the Causes?

There are times when misfortune strikes when you least expect it. Server reboots can make your life a living hell. At first you might panic a bit as you try to find out what causes the server to reboot on its own. It is hard to keep calm when your system has become unstable. There are many reasons why a server reboots randomly. When it happens to your server, check out the tips below and find out the real cause of the reboots.

Check Wattage of Power Supply

One of the reasons why servers become unstable is the lack of juice that flows in the system. The power supply is one of the most important components in the server because it delivers the needed power for the other parts of the system to work. A defective or inadequate PSU can cause random reboots or hangs. Common issues with a power supply include stopping to work; output is not the specified wattage, or overheating. There are also times when the output is less than the total energy consumption of the components.

176129_warna-warni-server-google_663_382

Picture of a Google Data Center (Foto: Google)

Look at the Bios Settings

There are times when problems with the BIOS can cause random reboots. That’s why it is vital that you check the BIOS setting to rule out the BIOS as the root of your server’s problems. There are instances when an empty BIOS battery has made a system instable. You can also program the boots and shutdowns of the server through the BIOS settings. Sometimes a problem with the server can be solved by updating the BIOS.

Monitor Temperature of the Server

Another issue that you should consider when your server reboots randomly is overheating. When your system overheats, the server will crash or reboot on its own. You should monitor the temperature of your system and find out whether it is overheating or not.

Check Power Connections

There are times when the connection of the server to the electricity supply is the problem. Make sure that it is plugged in properly into the outlet. You should also check if the mains lead is plugged completely into the back of the system. If the server is plugged into a UPS, make sure that the UPS is not the problem. Try to plug the system directly into an outlet and see if the reboots still occur.

Check Transistors of the Motherboard

Random reboots can be caused by bad hardware. Check whether all the transistors of the motherboard are okay or if they are burnt. If you find burnt transistors, you can either replace them or replace the motherboard as a whole.

Check the RAM

The server might be rebooting because it lacks RAM. You might not have noticed, but one of your RAMs might not be functioning anymore. Test your RAMs to find out if they are still in good working condition.

If you have gone through all the above and still experience random reboots, then the last resort is to remove all the components and connections, and rebuild the server. This is to ensure that the cause of the reboots is not loose connections.

Linux: How to clone and split screens using Xrandr

XRandr is a very handsome tool to deal with multiple screens in Linux. It allows to clone split, clone and re-arrange the output. It has been developed as official user-interface for the RandR protocol which serves to configure the X11 server. It is a bit difficult to use. However, if you know some magic commands and create aliases the tool may still do some magic as will shown below. For the too trick we assume that you are using a laptop with a VGA port where an external screen is plugged in.

In the first exercise we just want to clone this external screen:
[sourcecode language=”bash”]
xrandr –output LVDS-0 –auto –output VGA-0 –auto –same-as LVDS-0
[/sourcecode]
After executing that line you should just have a exact copy of your screen on the external one connected by VGA.

I the second exercise we want to split the screen between the Laptop screen and the external one.
[sourcecode language=”bash”]
xrandr –output LVDS-0 –primary
xrandr –auto –output VGA-0 –mode 1920×1080 –right-of LVDS-0
[/sourcecode]
This example adds the external screen right of your laptop screen. With the –left-of option you can add it at the opposite site.Make sure that you have to choose a resolution which is supported by both screens.