Solving tech problems

How do you copy entire MongoDB database?

Databases

I faced small problem how to duplicate entire MongoDB database and I tried just to rename folder under data directory. So, instead of having my_database I just renamed it to my_new_database but it didn’t helped and when I used show collections it returned me an empty set. I also tried to rename files inside data/my_database to my_new_database but this didn’t helped me either. So, I finally looked into the documentation and found this command which copies the entire database:

How to submit form in jQueryMobile?

Programming

jQuery Mobile is excellent framework and I was trying to figure out why postback of my web form is not working properly and I finally found out that jQuery Mobile use ajax in passing forms so you need to add parameter data-ajax=”false”. It is better to read documentation sometimes.

Using SQL Server PIVOT feature to transform rows into columns

Databases, Programming

PIVOT queries in SQL Server are useful when we need to transform data from row-level to column-level. Example: Imagine having the table named Invoice (payments per month) – for simplicity let’s say that we have PaidDate and Amount. What we wanted now is to get total money collected from the beginning of the year 2014, and in order to do this we can use this PIVOT query: And we finally get

How to get TimeZone by RemoteIP or for specific city

Programming

The goal: to find out the TimeZone of a visitor. There are few free services that can give you this information. First step is to get the City name by RemoteIP address – there are free services/databases that helps you to achieve this, one of them is MaxMind. When you have a city name you can get its latitude/longitude from the database of the same service or you can use Google API like this: For Berlin, Germany: https://maps.googleapis.com/maps/api/geocode/json?address=Berlin&sensor=false You will get JSON result like this: After getting latitude and longitude…read more

Whom to blame for the poor sale?

Learning

There aren’t many doubts. It is always the Salesman and there are three reasons for the poor sale: Salesman didn’t choose the right customer or the right decision maker in the company This means that your product is maybe ideal fit for certain customers but the customer your salesman is talking to is not in this group. Also, if the customer says “we will think about it” it means that he already know from the beginning of the year where he will spend his budget and your product in not…read more

MS SQL Server 2014 “Hybrid” to attack MongoDB

Databases

On April 1st 2014 MS SQL Server 2014 is internally released for small group of big customers such as bwin and others. The biggest improvement is in-memory OLTP engine to deliver breakthrough performance to their mission critical applications. Company bwin scale its applications to 250K requests a second, a 16x increase from before, and provide an overall faster and smoother customer playing experience. The new In-Memory OLTP engine (formerly code named Hekaton), provides significantly improved OLTP performance by moving selected tables and stored procedures into memory. Hekaton enables you to use both…read more

How to escape parenthesis/brackets ‘{‘, ‘}’ in string.Format?

Programming

Usually you have something like this: string.Format(“Output: {0}”, “A”); This will result as: Output: A What you should do if you want to make an output like this? Output: {A} You need to escape parenthesis/brackets like this: You use {{ to output { You use }} to output } So, you final C# command should look like this: string.Format(“Output: {{{0}}}”, “A”);

Fixing Iconia W700P WI-FI unstable connectivity (losing connection)

System Administration

(source: menspsychology.com) After my laptop died I was forced to work on Acer Iconia W700P tablet which is great piece of hardware (I wrote about it here) and after fresh installation I come to the problem that WI-FI network adapter was losing connectivity every 10 minutes. It was a real frustration so I searched for solution and found in one forum that you should try to do these two things: Control Panel > Network and Sharing Center > Change adapter settings > Find your WI-Fi network adapter > Right click…read more

Protecting your Linux server from Heartbleed bug

System Administration

I have got at least 20 emails from different sources about OpenSSL vulnerability, known as Heartbleed bug It allows anyone on the Internet to read the memory of the systems protected by the vulnerable versions of the OpenSSL software. More details about this (how to reproduce and fix) can be found here. To check if your server is vulnerable use this online tool. At the end, in order to protect your server’s Linux OS you need to do this few steps: Login through SSL (you can use Putty from Windows)…read more