czwartek, 28 sierpnia 2014

Where to find Skype for Business (MSI package), nowadays?

I'm always wasting time while looking for MSI package download link on Skype status. Skype Microsoft makes it harder and harder to find. On community forum I've found this useful link:

http://www.skype.com/go/getskype-msi

File downloads as "SkypeSetup.msi". To find what exact version is this, you may check file properties.

Properties > Details > Comment (like on image below; sorry PL version)


środa, 23 lipca 2014

Convert SVN repo to GIT repos. Ready-to-use scripts.

Finally..

Finally, I managed move all my micro-projects from one huge SVN repo to multiple GIT repos. My micro-projects (about 100+) are generally SQL/Crystal reports, SQL procedures and triggers, ad-hoc SQL queries (maybe useful in future) and some of C# and MVC3 projects also.

I have spent a lot of time to make my mind how should all those micro-projects be organized as a GIT repo or repos.

There were arguments to have all of those projects in one monolith GIT repo (as it was in SVN):
  • When I clone my monolith GIT repo I have all my micro-projects cloned (and backed up this way);
  • It's easier to track my past activity reading one log than hundred of them;
  • Some of micro-projects depends on other (they were linked in SVN using externals).
And there were arguments not to have those project in one monolith GIT repo:
  • Some of projects should be moved to an attic (I like CVS idea of having an attic);
  • SVN repo was not a regular structure (some of micro-projects had trunk/tags/branches structure, some of them had not, some of them was organized into common folder which had trunk/tags/branches structure) - converting this irregular may be a headache ass-ache.
Finally, I decided to have multiple GIT repositories. And also to break sets of micro-projects with common trunk/tags/branches structure into individual GIT repos. Then I moved all GIT bare repos to company shared folder where I clone from. Shared folder is backed onto Ultrium tape everyday.

So I have following cases in one monolith SVN repo:

Case 1 - SVN structure per project

https://svn.mycompany.local/svn/main/client1/project1/trunk --> project1.git
https://svn.mycompany.local/svn/main/client1/project2/trunk --> project2.git

Case 2 - common SVN structure for set of projects

https://svn.mycompany.local/svn/main/client1/set-of-projects1/trunk/project3 --> project3.git
https://svn.mycompany.local/svn/main/client2/set-of-projects2/trunk/project4 --> project4.git

Case 3 - no SVN structure

https://svn.mycompany.local/svn/main/client1/project5 --> project5.git
https://svn.mycompany.local/svn/main/client1/project6 --> project6.git

I did succeed to convert all above cases using linux scripts I want to share you with.

Download / clone the tool

You may download / clone them from my GitHub: https://github.com/htrzewik/svn-repos-to-git-repos

Description of the tool

There are two scripts. They are converting one project at once.
rebuild-repos-svn-layout.sh is for projects with SVN trunk/tags/branches structure (like case 1 described earlier)
rebuild-repos-flat-layout.sh is for projects with no SVN trunk/tags/branches structure (like case 3 and case 2 also)

and three config files:

authors - it's dictionary of developers who worked over SVN repos. IT'S VERY IMPORTANT THAT AUTHORS DICTIONARY IS COMPLETE. Other case history of project may be truncated - you will lost most recent commits, not the oldest. Ask uncle Google for SVN trick to list all authors in SVN repo.

default_svnbase - put there an URL of your repo with subdirs (or put that URL into argument 2 every time you run script)

default_workir - put there a path to workdir created for this script (temporary repos will be stored there)

Examples of use


Example for case 1

Put https://svn.mycompany.local/svn/main/client1 into default_svnbase

Run ./rebuild-repos-svn-layout.sh project1

If script succeeded move svn2git_workdir/git-bare/project1.git to your GIT server / GIT shared folder.
BE CAREFUL OF WARNING: You appear to have cloned an empty repository. Review you URL, project name, authors list.

Run ./rebuild-repos-svn-layout.sh project2

Move svn2git_workdir/git-bare/project2.git

Example of case 2

Put https://svn.mycompany.local/svn/main/client1/set-of-projects1/trunk into default_svnbase. Notice: tags and branches will be lost (not converted).

Run ./rebuild-repos-flat-layout.sh project3
Move svn2git_workdir/git-bare/project3.git
Run ./rebuild-repos-flat-layout.sh project4
Move svn2git_workdir/git-bare/project4.git

Example of case 3

Put https://svn.mycompany.local/svn/main/client1 into default_svnbase.

Run ./rebuild-repos-flat-layout.sh project5
Move svn2git_workdir/git-bare/project5.git
Run ./rebuild-repos-flat-layout.sh project6
Move svn2git_workdir/git-bare/project6.git

How it works

What scripts exactly do?

1. Script clones SVN repo into local GIT repo using git svn clone command.
2. Creates target GIT bare repo and does refs trick.
3. Configures local GIT repo where SVN was cloned into and add target GIT bare repo as remote.
4. Pushes SVN cloned repo into target GIT bare repo.
5. Renames trunk branch into master trunk (only script for SVN style repo).
6. It does a test clone into temporary GIT repo.

After script complete you may check svn2git_workdir/git-test-workdir/project.git if project files exists and if commit log seems complete. 

Now, you have no excuse for not switching to GIT.

sobota, 15 marca 2014

(Don't waste time for) Cisco QuickVPN Client and Windows 8.1 compatibility issue

Today, I've lost many, many hours fighting with Cisco/Linksys VPN software called Cisco QuickVPN Client, which is dedicated VPN client to small business line of Cisco/Linksys routers (RVxxx family).




The newest version of Cisco QuickVPN is 1.4.2.1, dated on 2011-08-09 (http://www.cisco.com/c/en/us/products/routers/quick_vpn.html) and it's not compatible with Windows 8/8.1.


The problem with Cisco QuickVPN and Windows 8/8.1 is ... it does not work ;) It always ends with following dialog.



Did read a lot of posts today, finding a lot help requests but not finding 100% guarantee solution nor proof that it really can work with W8.

Some of tips were:
  • Enable Windows 7 compatibility while installing and running client
  • Enable ICMP on Windows Firewall
  • Enable 60443 port on Windows Firewall
  • etc.
None of them worked for me. Hours of trying and trying. Always the same message and always the same log:


2014/03/15 17:00:19 [STATUS]OS Version: Unknown
2014/03/15 17:00:19 [STATUS]One network interface detected with IP address 192.168.1.101
2014/03/15 17:00:19 [STATUS]Connecting...
2014/03/15 17:00:19 [DEBUG]Input VPN Server Address = XXX.XXX.XXX.XXX
2014/03/15 17:00:19 [STATUS]Connecting to remote gateway with IP address: XXX.XXX.XXX.XXX
2014/03/15 17:00:24 [STATUS]Remote gateway was reached by https ...
2014/03/15 17:00:24 [STATUS]Provisioning...
2014/03/15 17:00:27 [STATUS]Success to connect.
2014/03/15 17:00:27 [STATUS]Tunnel is configured. Ping test is about to start.
2014/03/15 17:00:27 [STATUS]Verifying Network...
2014/03/15 17:00:33 [WARNING]Failed to ping remote VPN Router!
2014/03/15 17:00:36 [WARNING]Failed to ping remote VPN Router!
2014/03/15 17:00:39 [WARNING]Failed to ping remote VPN Router!
2014/03/15 17:00:42 [WARNING]Failed to ping remote VPN Router!
2014/03/15 17:00:45 [WARNING]Failed to ping remote VPN Router!
2014/03/15 17:00:47 [WARNING]Ping was blocked, which can be caused by an unexpected disconnect.
2014/03/15 17:00:50 [STATUS]Disconnecting...
2014/03/15 17:00:57 [STATUS]Success to disconnect.

Hopefully my stubbornness was bigger then my frustration today. And I went onto creative path.

I've sent Cisco QuickVPN to the hell and started processing this instruction: https://www.shrew.net/support/Howto_Linksys - which is complete instruction how to prepare Linksys RV router to work with Shrew Soft VPN Client which is free.



Doc above gives complete example. I did manage to set up remote router and Shrew client in minutes (succeed on first try!). What's more - Shrew Soft client brings up VPN tunnel with light speed comparing to native Cisco/Linksys - which needs few seconds for that.



Also I did test services availability via VPN tunnel:
  • RDP (to visualized Windows 8.1) - works..
  • HTTP (to local web server) - works..
  • DNS queries (to Active Directory server) - works.. 
  • PING - works.. (it didn't with Cisco QuickVPN)..
  • teleportation.. failed, additional license required ;)
So my tip is - don't waste time on getting Cisco software works. Download Shrew Soft VPN Client and complete the HOWTO. It's not as complicated nor time consuming as it may appear.

Good luck!

środa, 12 marca 2014

Konfiguracja usługi Orange Neofon (VoIP) na urządzeniu Sagem F@st 3764

Mógłbym snuć wiele opowieści o różnych moich przejściach z firmą Orange, ale nie temu poświęcony jest ten blog.

Poniżej notatka jak skutecznie skonfigurować usługę VOiP o marketingowej nazwie Neofon na francuskim gównie Sagem F@st 3764 od Orange.



Wskazówka. Nawet jeśli jesteś doktorem informatyki, wykonuj wszystko jak opisano - w przypadku tych urządzeń nic nie działa tak jak powinno, żadne przyzwyczajenia użytkowników nie zostały uszanowane.

Zaczynamy od ustalenia login i hasła.

Login trzeba wygrzebać z papierów. Ogólnie powinien być zgodny z szablonem 48xxyyyyyyy@neofon.tp.pl, gdzie xxyyyyyyy to numer telefonu stacjonarnego z numerem kierunkowym.


Hasło otrzymuje się na maila. Szukaj w skrzynce wiadomości od info@orange.com lub szukaj po frazie "Telefonia".

Aby otrzymać hasło na maila trzeba się o nie upomnieć (już po wejściu aneksu w życie). Najlepiej zrobić to pod bezpłatnym numerem 800500555.


Zalogować się do strony zarządzania ruterem. Wskazówka: Po wypełnieniu loginu i hasła, kliknąć w przycisk OK. Naciśnięcie klawisza ENTER spowoduje przeładowanie strony i wyczyszczenie hasła, co może silnie sugerować brak jego poprawności. Zatem - nie ENTER, tylko klikać w OK.


W menu z lewej, sekcja Konfiguracja, klikamy w VOiP.

Zakładkę Ogólne ustawiamy jak na ilustracji.


Zakładkę Linia 0 ustawiamy jak na ilustracji.
W przypadku, gdy zaznaczyłem opcję CLIR obserwowałem taki efekt, że mogłem odbierać rozmowy przychodzące, ale nie mogłem nawiązywać połączeń (zawsze otrzymywałem sygnał zajętości).


Dla porządku umieszczam ilustrację zakładki Linii 1, chociaż w tym przypadku Linia 1 nie była używana.


Teraz magiczna sekwencja przekazana przez konsultanta.

  1. Przechodzimy na zakładkę Linia 0.
  2. Klikamy w przycisk Potwierdź. Nie będzie żadnego wizualnego potwierdzenia akcji użytkownika poza tym, że w pasku adresu przeglądarki coś się zadzieje.
  3. Przechodzimy na zakładkę Ogólne.
  4. Klikamy w przycisk Potwierdź. Nie będzie żadnego wizualnego potwierdzenia akcji użytkownika poza tym, że w pasku adresu przeglądarki coś się zadzieje.
  5. Przechodzimy Narzędzi zaawansowanych (menu z lewej).
  6. Przechodzimy do Restart i potwierdzamy restart. Warto sobie zapuścić ping-a na ruter i coś w internecie, żeby zorientować się kiedy można powrócić do strony zarządzania.
  7. Powracamy do głównej strony zarządzania i obserwujemy status telefonu. Niczego nie dotykamy! Stan będzie odświeżał się samoczynnie. Najpierw Internet/VDSL, potem telefon. Nie klikamy w Włącz usługę - po prostu cierpliwie czekamy.
  8. Sprawdzamy telefon - rozmowa przychodząca, rozmowa wychodząca. Jeżeli nie działa - przetwarzamy powyższą instrukcję jeszcze raz, nie pomijając żadnego kroku ani wskazówki. Jeżeli nadal nie działa dzwonimy pod 800500555.


Powyższa instrukcja powstała do urządzenia z firmware 4.9.4.TPSA_v805E.


środa, 5 marca 2014

VMware ESXi: Virtual machine Version 10 may be a blind alley

Every wisdom needs time to come..

This time was no different.

I set a conversion of old crappy (physical) server to VMware virtual machine onto VMware ESXi Hypervisor 5.5.

I tooks 12 hours of conversion just to get this message:
"You cannot use the vSphere Client to edit settings of virtual machies of version 10 or higher."


What went wrong?

Default destination virtual machine version was 10, which I left unchanged (screen below).


There was no alerts nor suggestions not to choose it while using ESXi 5.5.

Why? Because VMware ESXi can host Version 10 itself (see: kb.vmware.com/kb/1003746) but it cannot be managed by free version vSphere Client.

This is what vSphere Client is trying to say every time you log in.


And vSphere Web Client is not a free product (as ESXi Hypervisor is)..

Is VMware going to be paid only option?

As for now you may still go with Version 8. But one day brand new OS will come and Version 8 will be no option anymore..

piątek, 28 lutego 2014

Casting INT, BIGINT, SMALLINT, TINYINT to DECIMAL - a cheatsheet (SQL Server)

Type casting.. some are obvious, some are not.. When you're casting to DECIMAL(p,s) type, you've got to stop and think what scale you need and what precision is enough.

Fast replay

On MSDN: http://msdn.microsoft.com/en-us/library/ms187746.aspx (decimal and numeric in T-SQL)

In following example you have to store decimal like this 98'765.4321.

Your precision is 998'765.4321
Your scale is 4: 98'765.4321.

Another approach:
Take your "max value", which is 5 digits: 98'765.4321.
Add your scale, which is 4:  98'765.4321.
And your precision is 5 + 4 = 9.

So your destination type is DECIMAL(9,4).

In case of negative number, like -98'765.4321 DON'T count the sign. Precision is still 9.


Perfect precision

Now, what is safe precision for casting BIGINT to DECIMAL?

Back to MSDN: http://msdn.microsoft.com/en-US/library/ms187745.aspx (int, bigint, smallint and tiny int in T-SQL).

BIGINT is 8-Bytes data type.
Its range is -2^63 (-9'223'372'036'854'775'808) to 2^63-1 (9'223'372'036'854'775'807).
Now, count digits above..
Or..

So.. 2^63 is ~9.22 x 10^18 which is ~0,922 x 10^19. So required precision is 19. As BIGINT cannot have digits after coma scale is 0. Finally, required type is DECIMAL(19,0).

Fast check

DECLARE @dec19 DECIMAL(19,0)

SET @dec19 = -9223372036854775808 -- OK
SET @dec19 = 9223372036854775807 -- OK

DECLARE @dec18 DECIMAL(18,0)
SET @dec18 = -9223372036854775808 -- Error: Arithmetic overflow error converting numeric to data type numeric.
SET @dec18 = 9223372036854775807 -- Error: Arithmetic overflow error converting numeric to data type numeric.

Which means DECIMAL(19,0) is perfect for casting BIGINT and DECIMAL(18,0) is too short.

Divisibility

Did I say "perfect"?
Let's try to divide DECIMAL(19,0) variable by 1000 and store it as DECIMAL(19,3)..
(scale changed, precision is still the same)

DECLARE @dec190 DECIMAL(19,0)
DECLARE @dec193 DECIMAL(19,3)

SET @dec190 = 9223372036854775807 -- BIGINT max value
SET @dec193 = @dec190 / 1000

SELECT @dec190, @dec193

Works! Results are: 9223372036854775807 and 9223372036854775.807.

Let's have another try.. Divide BIGINT variable by 1000 and store it as DECIMAL(19,3)..

DECLARE @big BIGINT
DECLARE @dec193 DECIMAL(19,3)

SET @big = 9223372036854775807 -- BIGINT max value
SET @dec193 = @big / 1000

SELECT @big, @dec193

Is it good? No. Results are: 9223372036854775807 and 9223372036854775.000. We've lost some data.

So how to make it possible?

Like this?
SET @dec193 = CAST(@big AS DECIMAL(19,3)) / 1000
No. Arithmetic overflow error converting bigint to data type numeric.

Like this?
SET @dec193 = CAST(@big / 1000 AS DECIMAL(19,3))
No. Data after coma still lost.

We need to extend scale (and precision) of source variable to prepare it for a division.
We're about to divide by 1000, which is 10^3. So our goal is to cast source BIGINT variable to DECIMAL(19+3,0+3).. let's call WolframAlpha in here.. (joke!) ..which is DECIMAL(22,3).

We've got the winner:
DECLARE @big BIGINT
DECLARE @dec193 DECIMAL(19,3)

SET @big = 9223372036854775807 -- BIGINT max value
SET @dec193 = CAST(@big AS DECIMAL(22,3)) / 1000

SELECT @big, @dec193

or (less spectacular)..

DECLARE @big BIGINT
DECLARE @dec190 DECIMAL(19,0)
DECLARE @dec193 DECIMAL(19,3)

SET @big = 9223372036854775807 -- BIGINT max value
SET @dec190 = @big
SET @dec193 = @dec190 / 1000

SELECT @big, @dec193

..because it worked earlier in article.

Cheatsheet

And now cheatsheet is coming..

int type max value max value - scietific notation cast to decimal type cast to decimal type - divisible by 1000
BIGINT 2^63-1 ~0.922 x 10^19 DECIMAL(19,0) DECIMAL(22,3)
INT 2^31-1 ~0.215 x 10^10 DECIMAL(10,0) DECIMAL(13,3)
SMALLINT 2^15-1 32767 DECIMAL(5,0) DECIMAL(8,3)
TINYINT 2^8-1 255 DECIMAL(3,0) DECIMAL(6,3)

To be sure..

DECLARE @dec190 DECIMAL(19,0) =  9223372036854775807
DECLARE @dec223 DECIMAL(22,3) =  9223372036854775807.123
DECLARE @dec100 DECIMAL(10,0) =  2147483647
DECLARE @dec133 DECIMAL(13,3) =  2147483647.123
DECLARE @dec50 DECIMAL(5,0) = 32767
DECLARE @dec83 DECIMAL(8,3) = 32767.123
DECLARE @dec30 DECIMAL(3,0) = 255
DECLARE @dec63 DECIMAL(6,3) = 255.123

SELECT @dec190, @dec223, @dec100, @dec133, @dec50, @dec83, @dec30, @dec63

No errors.

That's all folks for today.

piątek, 18 października 2013

Access to (full) shell of Symantec Messaging Gateway (aka Brightmail)

Symantec Messaging Gateway (aka Brightmail) is anti-spam and anti-virus software for internet mail. It's distributed as VMware appliance (or installation disc for dedicated machines).

It's Linux based system but its shell is limited to some maintenance commands specific to product. There are also some limited number of Linux commands available - like ifconfig, route, ping, telnet.

But when it's not enough, when you need access some additional logs, there is a support user with access to full Linux shell.

Here is a receipt how to access this account.


  1. Open a console (on pictures Virtual Machine Console is launched under VMware vShpere Client).
  2. Login as admin with your admin password.
  3. Run set-support command and set temporary password for support user (temporary but product asks for complex password).
  4. Logout (as admin).
  5. Login as support with temporary password.
  6. Enjoy your freedom.