Showing posts with label hack. Show all posts
Showing posts with label hack. Show all posts

Friday, January 29, 2016

No Sound from Speaker but Headphones Work?

Some notebooks manufactured by ASUS (maybe by other vendors too) have strange issue with sound output. When all required drivers are installed and everything is properly set, you can not hear any sound from the internal speakers. Only plugged headphones or external audio works...

I was trying different tricks. Even soldered new audio jack connector to the motherboard of my ASUS U36SD notebook. I've spent lots of time, but found the solution! It is not a hardware issue. It is software/driver glitch :)

So if you have the same issue with your notebook: no sound from speakers, but headphones works. Here is the solution:

  1. Restart computer.
  2. Open BIOS/Setup console, by pressing F1, F2, F10 or Del key depending on your notebook model.
  3. Choose "Load Default Settings" option at the beginning.
  4. Then search for "Ring on Boot" or "Boot Sound Volume" option(s) and TURN IT OFF or set the volume level to ZERO!
  5. Save BIOS/Setup settings and restart computer again.

Now you can hear sound from the internal speaker of your notebook, laptop or tablet :)

Option to disable to get sound on ASUS notebook

Let me know if this workaround helps you and please specify the model of your notebook in comments. Thank you.

BTW, do you know about my Auto Mute software utility to make computer silent by default? :)

Wednesday, October 14, 2015

Skype freezes and hangs your system?

The best solution is uninstall the Skype and never use it again!

But if you still need Skype application to contact your siblings and co-workers, here is a useful trick

Screenshot of Task Manager how to set low priority for Skype.exe process

Sunday, August 09, 2015

Wrap Headphones in the Right Way


Here is a lifehack to wrap headphones and earphones quickly, without any twisting:




Also you can use "devices" like this:





Monday, May 05, 2014

Bad Key Hash for Facebook Apps


When you are creating application for Facebook on Android platform, Developer Website requires the Key Hash for every development device.

This secret stroke is automatically generated by Eclipse or other dev studio in "debug.keystore" storage.

You can obtain Key Hash via command line:

keytool -exportcert -alias androiddebugkey -keystore debug.keystore | openssl sha1 -binary | openssl base64

or sample code:

...
   @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // Temporary code to print out the key hash
        try {
            PackageInfo info = getPackageManager().getPackageInfo(
                    "com.Your.Application.Package.Name", PackageManager.GET_SIGNATURES);
            for (Signature signature : info.signatures) {
                MessageDigest md = MessageDigest.getInstance("SHA");
                md.update(signature.toByteArray());
                Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT));
            }
        } catch (NameNotFoundException e) {
        } catch (NoSuchAlgorithmException e) {
        }
...

You have to add all you developer and release key hashes into Web panel of your Facebook Application. Everything looks simply enough.

But, if your hash key contains / (slash) or + (plus) symbol Facebook integration will not work! You'll get error message, something like that: "Key hash Fj2DQ/kUxqHuaTq1jy9iTejN2Uk= does not match any stored key hashes".

I've spent few hours to understand the problem and find a workaround :( Here is an easiest way:

  1. Delete "debug.keystore" file in your "[%USERNAME%]/.android" folder.
  2. Rebuild project to get new "debug.keystore" file with new key hash.
  3. If new hash contains any symbol (= at the end is OK :)) repeat again

Hope this tip helps other developers! Sometimes, development for Android and Facebook is a pain...


Thursday, March 20, 2014

How to detect Internet Explorer 10 and higher?

For a long time detecting of Internet Explorer browser was easy using Conditional Comments, something like:

<!--[if IE]>
 <script type="text/javascript">
  var isIE = true;
 </script>
<![endif]-->

Starting version 10, Internet Explorer doesn't support conditional comments feature :(

Here is the JavaScript code to detect IE of any version since 5 till 11:

var isIE = (function(){
    var undef,rv = -1; // Return value assumes failure.
    var ua = window.navigator.userAgent;
    var msie = ua.indexOf('MSIE ');
    var trident = ua.indexOf('Trident/');

    if (msie > 0) {
        // IE 10 or older => return version number
        rv = parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);
    } else if (trident > 0) {
        // IE 11 (or newer) => return version number
        var rvNum = ua.indexOf('rv:');
        rv = parseInt(ua.substring(rvNum + 3, ua.indexOf('.', rvNum)), 10);
    }

    return ((rv > -1) ? rv : undef);
}());
 

Hope Internet Explorer 12 and higher will work the same way :)


Tuesday, August 13, 2013

Websites at Different Screen Resolutions

If you are creating a lot of web pages, or have a bunch of own websites, you know how important it is to make the HTML documents are looking good for each user. Different formats of monitors (4x3, 16x9, 16x10), lots of screen resolutions (1366x768, 1920x1080, etc), the variety of mobile devices, half of them with automatic rotation of the screen ... What the hell?

So I've created a simple online web service to view any web page at different sizes and resolutions.

By the way, it's free :)

Friday, August 24, 2012

What to do if Caps Lock stuck?


If you CapsLock button doesn't work, try to download software that can toggle Caps Lock with a mouse!

Friday, October 28, 2011

PHP - Print any variable easily

You often need to print some PHP variable right into the HTML code, but the variable is out of your current scope. Familiar problem, isn't it?

Here is a bright solution: PHP function that prints any global variable:


function print_var($var = 'domain', $url = '')
{
  global $$var, $$$var;
  if ($url != '')
    echo("<a href=\"$url\">${$var}</a>");
  else
    echo(${$var});
}

Moreover, you can pass some URL as a second parameter, and your variable becomes a clicable link :)

Some examples:


<?php print_var('page')?>
<?php print_var('domain', '/') ?>
<?php print_var('software', '/download/') ?>
<?php print_var('author', 'http://www.site.com') ?>

Sunday, October 16, 2011

Wordpress + Custom Scripts = Error 404

Wordpress is the most popular CMS in the world. Many sites are powered by Wordpress, plugins almost for every need are available. But...

If you decide to add some custom web scripts or other CMS to the domain where Wordpress is already installed, you'll get a problem with Error Handling. Wordpress shows Error 404 (File not found) for any URL that is not a part of Wordpress system!

Moreover, Wordpress changes standard error pages to its own ones. So if an error occurs outside Wordpress environment, the error message appears in Wordpress style anyway!

This can be fixed using .htaccess settings. At first you should exclude work folders form RewriteMode redirections. Add the following line into .htaccess file in the root of your site:

RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_URI} !^/(folder1|folder2)/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress /index.php [L]

Then you should disable custom error page, at least in folders of your scripts. Add the following line to .htaccess files in your script folders. You can add this line to the root file as well, but sometimes it doesn't work:

ErrorDocument 404 default

This is enough if Wordpress is installed into a folder. But if Wordpress is installed into the root of the site, the solution may not work depending on CMS version and installed theme. Most probably you will need to fix some files manually to disable 404 error handling. The core is located in class-wp.php file:

function handle_404() {
...
$wp_query->set_404();
status_header( 404 );
...
}

BTW, Wordpress in the root of the site is not a best practice...