This is more of a self-reminder, than a tutorial, and it goes something like this, for the currently newest phpMyAdmin version (3.5.7):

1
2
3
4
5
6
7
8
9
wget http://www.sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/3.5.7/phpMyAdmin-3.5.7-all-languages.tar.bz2
 
mkdir adm
 
tar -jxf phpMyAdmin-3.5.7-all-languages.tar.bz2 -C adm
 
cp -rf phpMyAdmin-3.5.7-all-languages/* ./
 
rm -rf phpMyAdmin-3.5.7-all-languages/

The last 2 commands are to get ourselves rid of the root dir in the archive, and I seem to recall that there was an argument to specify this, but I can’t seem to remember it right now. If anyone could help me out with this, I’d be greatful!

Android, Technology @ 10 November 2012, “No Comments”

This all started when our team won a Galaxy S3 in a hackathon, and I needed to do some development on it. And, once again, the same problem with driver install:

Samsung Drivers failed to install

Well, the good thing is, I already knew a way to fix this:

  • Open Device manager, by pressing Start and type “Device Manager
  • Find your phone (Usually something like Samsung Android device) with a ? mark in the Other Devices section, like this

  •  Click the Update Driver Software
  • Browse My Computer for driver software
  • Let me pick from a list[..]
  • Android USB Devices
  • Chose Samsung on the left side and Composite ADB Interface on the right, something like this:
  • Next
And that should be IT!
IMPORTANT
If something for one of these steps is missing, try installing Kies. Altough it may seem, that it wont install anything, it actually does set up the necessary drivers, only somehow fails to set them up for proper user.

Due to some specific requirements from a user, I needed a way to generate some colors, and to it reliably, as well as aesthetically pleasing. So, thanks to this article, I created this little wonder:

1
2
3
4
5
6
7
8
9
10
11
function getColor(from){
$hash=String(CryptoJS.MD5(from));
$color1 =parseInt($hash.substring(8,10), 16);
$color2 =parseInt($hash.substring(4,6), 16);
$color3 =parseInt($hash.substring(0,2), 16);
if($color1 < 128) $color1 += 128;
if($color2 < 128) $color2 += 128;
if($color3 < 128) $color3 += 128;
 
return "#" + $color1.toString(16)+$color2.toString(16)+ $color3.toString(16);
}

Now I do have to mention, that I am using CryptoJS MD5 bundle for this, which you can get here.

And here is how the colors look in my prototype:

 

Technology, Travel @ 03 October 2012, “No Comments”

Šodien ar draugu lekcijā panesās diskusija par elektromobīļu braukšanas izmaksām. Teicu, ka salīdzinoši nelielas, draugs iebilda. Tad nu, salīdzināsim! Kā parasto, iekšdedzes automobīli paņemsim WV Jetta 2012. gada modeli, kā elektrisko, Tesla S. Galu galā, ja pieņemam, ka līzingā mašīnām ierastie limiti 3 gados ir ~150000km. Neesmu mašīnu pārzinātājs, tāpēc minimālie nepieciešamie parametri, ir no pieredzes, pārāk neiedziļinoties detaļās:

WV Jetta Tesla S
Cena: ~$30k ~$40k
Enerģija/100km 5.4l DD 18.8 kW
Cena enerģijas vienībai 0.969Ls/l 0,0973Ls/kW
100Km brauciena cena 5.232Ls 1.829Ls
Enerģijas izmaksas 7848Ls 2743.5Ls

Cenas ņemtas 03.10.2012 Ja skatāmies tikai šādā, ļoti šaurā leņķī, ietaupījums aptuveni tik pat liels, cik mašīnas izmaksu starpība. Nulles vienādojums. Bet ja mēs vēl paķertu klāt baterijas nomaiņu vienam, un ritošo detaļu nomaiņu otram, tad skaitļi drošvien būtu citi.

Now this will by no means be a comprehensive tutorial on extraction, just a small and quick tip.

Situation

You receive a .doc, .docx or .odt file with a bunch of images in it, and you just can’t be bothered to save them one by one?

Solution!

  1. Open the file in your favorite text editor
  2. Use Save As
  3. Choose HTML Document
  4. There should now be a new document in the directory you chose and a bunch of image and other files, that were embedded in the document

Alternative would be:

  1. Open the file in your favorite text editor
  2. Use Save As
  3. Choose .docx
  4. Rename this new document to have an ending of .zip
  5. Unarchive
  6. And voila, in the new folder you have all of the contents of the document

I personally, prefer the 2nd option, since that gives me nicer folder structure.

Tags: ,

OK, this is more of a reminder to myself, rather than an actual tutorial, but I’ll begin with an intro.

A couple of years ago, while working on a small, but much-needed project for a large company in Latvia, I had just developed the first version of my site, uploaded it onto the server, and contacted the server admins. Everything seemed to have worked great, until I tried to access the Administration page located at http://example.com/admin. 404 greeted me.

Well at first I was frustrated with the admins, their seeming incompetence to fix the issue, and so I ended up renaming the link to the admin section.

Well recently, once I started offering hosting solutions for those pages that I created, the problem has kept coming up every time an /admin page has been used. So here’s what the solution was for me:

My servers use Ubuntu and Apache 2.2, thus in the .htaccess I had these lines:

1
2
3
DocumentRoot /srv/www/example.com.lv/public_html
[..]
<Directory /srv/www/westsolutions.lv/public_html/>

But what they were missing was the added /public section, since the setup I was using was Zend Framework, and the first level .htaccess had problems parsing it

1
2
3
DocumentRoot /srv/www/example.com.lv/public_html/public
[..]
<Directory /srv/www/westsolutions.lv/public_html/public>

That seemed to fix it. Now, this is in no way answering my question, why does Apache2 by default not parse urls with /admin in them, but that is a problem for another day, another time.

For a client of mine, I had to create the ability to add a youtube video. And, since I wanted to do it as comfortably as possible, and with the least amount of hassle, I turned to internet.

Since I was already using ZF for various tasks on the project, and I knew it had a couple of libraries for this, it was a natural first choice.

And, I wanted to allow the user to enter the same link they coppied out of the URL bar, and that would be enough.

So, here’s the code!

After spending nearly 2 days trying to get this right, and even posting a question on stackoverflow.com I managed to find a way to get this working

But before we got on with the code:

There are quite a few articles about this on the internet. Most of them talk about connecting to a self-signed certificate. That requires some other configurations, and will not work with this code. Also, this is made to work only with SSL (HTTPS), and will not work with regular HTTP.

Android @ 01 February 2012, “No Comments”

Since I’m creating an Android application at work, I’ll be posting quite a few articles, while I get acquainted with the platform.

And the first in this series is going to be about SSL certificates. Since I’ve been having some troubles getting my app working, I needed to find the list of SSL Certificates my Android knows. Therefore – getting the list.  Altough Andrea Baccega made a list for 2.2, that wasn’t what I was after. Luckily, he also posted a way to do this. And for the lazy one’s out there – here is the complete list I got:

Pāris pēdējās dienas pa internetu ceļo dažādas publikācijas un video kāpēc jāsaka  ACTA’i. skakri piedāvāja visu EP deputātu no Latvijas e-pastus. Nu ko, izdomāju uzrakstīt. Un viņi pat abildēja! Nu labi, tikai Inese Vaidere, bet tāpat labi. Uzrakstīju atbildi.  Un tā kā daži draugi twitterī palūdza, publicēju to. Skatīt varat:

Sarakste ar Inesei Vaideri par ACTA

Un kā jau īsts Opensource piekritējs – atļauju jums arī komentēt! Nu, ko, aiziet! Lasām!

Labojums

Šodien iesniedzu arī priekšlikumu sakarā ar šo manabalss.lv  Tikko kā tas būs rediģēts no ekspertu puses – būs arī saite!