Tuesday, July 8, 2014

How to enable user switching on android 4.2.x if you have no such option in settings menu.

Several  simple  steps required.

1) root your device.
2)install terminal  emulator
3)run these commands

su
mount -o rw,remount /system

echo "fw.max_users=5" >> /system/build.prop
reboot
4) go  to  settings/user  and configure another user.

That is it .

android user switch
android change user
android no user switch  feature
android no user settings
android multiple users

Tuesday, April 29, 2014

mySQL optimization. Index not used. Why?

Recently  i  have found that index is never  used  for searching  in a slow mySQL query,  despite the fact  that  it would be very usefull.  FORCE INDEX did nothing.   The  explain command  still shows ALL.

After  digging  the web i have finally got what  is happening.
While the  field  was VARCHAR  the value in  the  query was integer.
where field_name =123

So  after  quoting  the  value like this [where field_name ="123"]  the  query  runs instantly. 0.001 s on a million of rows.

Epic win .

Thursday, June 25, 2009

Opera Is The Browser to Sample Music

Ok,  i found it pretty  easy  to  combine google,  myspace and opera into the machine to try - out a new Rock Band.  

Opera has the customisable  search  feature.

Google has a nice search  and a brilliant "feeling  lucky"  feature.

Myspace has nice feature of playing  sample songs of the musician if you  are on his page.

So  let's try  to do  it  with bare hands first.

let's craft  an  URL to show us a myspace page of great  Finnish  Melodic Death Metal  band

Insomnium.

http://www.google.com/search?q=myspace+Insomnium

Aha,  found one. but  to directly  navigate to  that  page  we need  to  use "feeling  lucky" feature .

No problems. Let's add  a new variable to  the URL.

http://www.google.com/search?q=myspace+Insomnium&btnI=1

It works ,  we go stright to the page and can  listening  to  music without pressing  a key.

Now,  let's  integrate the search into  Opera.

  1. Go to menu   tools/preferences/search tab . 
  2. Press "add" .
  3. Specify :
  • Name : myspace
  • Keyword : m
  • Address : http://www.google.com/search?btnI=1&q=myspace+%s 

It is done .

Now you  can  write in  addres field of Opera : m Insomnium and go  directly  to  the page .

Friday, June 5, 2009

RIP Fravia

Fravia passed away on Sunday, 3rd May 2009

http://fravia.com

thank you  , my  teacher  for everything  you've done.

I  hope your  reincarnation is underway .

Wednesday, April 29, 2009

I  am now a proud owner of Google Android - enabled HTC G1 t-mobile Gadget.

Trying to make use of it.

first  impressions : it downloaded update via GRPS and that  has put  $10 to my  mobile bill. 

Not  very  nice. Good thing it is on our company.

 

Thursday, April 9, 2009

setupapi problem with browsers : malware

Recently i have found IE and Opera misbehave on my system.
Ie just crashes, and opera does not download anything , crashing upon trying to download. drweb - cure-it found infected setupapi.dll in bin forlder of opera, IE & firefox. i removed them and voila- all works like a charm.

P.S
Before that i removed a rootkit driver and winlogon plugin dll.

a massive attack , must i say. Looks like a 0-day exploit.

http://virusscan.jotti.org/

File: 509fff07.sys 
Status: INFECTED/MALWARE 
MD5: 013baa9555f638680f8e0485d838c290

A-Squared Found Backdoor.Winnt!IK
AntiVir Found TR/Rootkit.Gen
ArcaVir Found nothing
Avast Found Win32:Rootkit-gen
AVG Antivirus Found nothing
BitDefender Found nothing
ClamAV Found nothing
CPsecure Found nothing
Dr.Web Found Trojan.Packed.142
F-Prot Antivirus Found nothing
F-Secure Anti-Virus Found nothing
Ikarus Found Backdoor.Winnt
Kaspersky Anti-Virus Found nothing
NOD32 Found nothing
Norman Virus Control Found nothing
Panda Antivirus Found nothing
Quick Heal Found nothing
Sophos Antivirus Found Mal/TDSSPack-G

VirusBuster Found nothing

VBA32 Found Malware-Cryptor.Win32.General.3 (probable variant)



that  one is more famous and stupid

File: crypts.dll

Status: INFECTED/MALWARE (Note: this file has been scanned before. Therefore, this file's scan results will not be stored in the database) 
MD5: 9e1715c7898a8cd97a162711886989dc 
Packers detected: PE_PATCH.UPX, UPX

A-Squared Found Trojan-Spy.Finanz.J!IK
AntiVir Found TR/Dldr.Age.orh.1.A
ArcaVir Found nothing
Avast Found nothing
AVG Antivirus Found nothing
BitDefender Found nothing
ClamAV Found nothing
CPsecure Found nothing
Dr.Web Found Trojan.DownLoad.33838
F-Prot Antivirus Found nothing
F-Secure Anti-Virus Found Trojan-Downloader.Win32.Agent.bqus
Ikarus Found Trojan-Spy.Finanz.J
Kaspersky Anti-Virus Found Trojan-Downloader.Win32.Agent.bqus
NOD32 Found Win32/TrojanDownloader.Agent.ORH
Norman Virus Control Found nothing
Panda Antivirus Found nothing
Quick Heal Found nothing
Sophos Antivirus Found Mal/Generic-A
VirusBuster Found nothing
VBA32 Found nothing

Thursday, March 5, 2009

How to do windows logon with smartcard

If you try to implement GINA replacement that fully supports all features that native msgina.dll supports , you have to implement smart card login (PKI). And here comes the problem. The information on how to do that is very limited. There is no even correct structures defnition available. It was not documented . Now it is defined in SDK , but not for systems earlier then Vista.(eg :Windows XP ).
I am speaking of


struct MY_KERB_SMART_CARD_LOGON
{
KERB_LOGON_SUBMIT_TYPE MessageType;
UNICODE_STRING Pin;
ULONG CspDataLength;
MY_KERB_SMARTCARD_CSP_INFO* CspData;
WCHAR pinData[256];
};
typedef MY_KERB_SMART_CARD_LOGON* PMY_KERB_SMART_CARD_LOGON ;


Compare it with msdn definition :


Somewhat different , eh?


typedef struct _KERB_SMARTCARD_CSP_INFO {
DWORD dwCspInfoLen;
DWORD MessageType;
ULONG nCardNameOffset;
ULONG nReaderNameOffset;
ULONG nContainerNameOffset;
ULONG nCSPNameOffset;
TCHAR bBuffer[1024];
} MY_KERB_SMARTCARD_CSP_INFO,
*PKERB_SMARTCARD_CSP_INFO;


Once again Compare it with MSDN definition .


And now the struct that should be supplied to LsaLogonUser as AuthenticationInformation parameter.

struct FullPacket
{
MY_KERB_SMART_CARD_LOGON smartCardLogon;
MY_KERB_SMARTCARD_CSP_INFO cspInfo;
};


Note : this is the most mystic thing that spoiled hours and days of debugging:

The LogonDomainName, UserName, and Password members of the MSV1_0_INTERACTIVE_LOGON structure must point to buffers in memory that are contiguous to the structure itself. The value of the AuthenticationInformationLength parameter must take into account the length of these buffers.

Yessss! And all others  , like  CardName, ReaderName,ContainerName,CSPName.

And one more thing ,  despite what  the msdn sais  about  KERB_SMARTCARD_CSP_INFO.MessageType


The type of message being passed. This member must be set to 1.

- for XP  it shold be 0.  I believe it is a version of the structure. 

That  is all  for now.  The clever one  can do the rest  ;)

Note : tested on 32bit  Windows XP & 2k3;