Mentor's blog

Android: how to extract a System image

Usually to extract an image file of the Android /system partition we can use the simple Android Kitchen but if the System image is signed (System_signed) to extract it we have to use simg2img : #!/sbin/sh # python simg2img.py system_signed tmp.img sudo mount -t ext4 -o loop tmp.img extracted/ Sources: andwise , Hazou

Windows Update stuck on Checking for Updates: solve the problem with WSUS

If on Windows should happen that Windows Update search the updates forever, remaining stuck on "Checking for Updates" the simplest way to solve the problem is using WSUS Offline Update . Browsing the web for this problem a lot of people advise to install some packet or some patch, I tried everything and for me the only solution has been using WSUS Offline Update to search and install the missing...

Windows: manually start VMware

Usually VMware automatically start at boot time, to start and stop it manually we can disable the autostart of the following services: VMware Authorization Service VMware DHCP Service VMware NAT Service VMware USB Arbitration Service and we can use a batch script as the following: @echo off echo Start/Stop VMware Workstation services echo. echo 1. Start echo 2. Stop echo. choice /c:12 If...

Windows: environment variables Java

Usually we define the environment variables for Java in this way: JAVA_HOME-> C:\Program Files\Java\jdkx.x.x_xx Path-> C:\Program Files\Java\jdkx.x.x_xx\bin but the best way to define the environment variables for java is the following: JAVA_HOME-> C:\Program Files\Java\jdkx.x.x_xx Path-> %JAVA_HOME%\bin

Windows: batch to simultaneously uninstall multiple KB updates

In Windows to list the installed updates we can use these commands and to uninstal simultaneously multiple updates we can use the batch suggested here : @echo off for /f %%i in ('type c:\list.txt') do ( echo "Uninstalling KB%%i" wusa /uninstall /kb:%%i /quiet /norestart ) echo "Uninstallations Complete." echo.echo "Rebooting..." echo. shutdown /r In the file list.txt we have to indicate only the...

Boost'cache lifetime ignored in Drupal 7: how to solve the problem

Sometime in Drupal 7 the Boost 's cache is flushed during the cron without respecting the Boost maximum cache lifetime setting, this happens when the cron is running and there is an attempt to re-run it, something goes wrong and the Boos'ts cache is flushed. To solve this problem i made that the Boost's hook_cron is executed for last using the function hook_module_implements_alter : function...

Signal lost after selecting USA Band in menu *#*#4636#*#*: how to solve the problem

In some android phone we can access at the advanced menu *#*#4636#*#* in which we can change some baseband settings including the radio band. In some case after selecting the USA Band in this menu the signal goes down, we lose every network connection, and we can't do nothing to restore the network. In this case the only real solution is to re-flash the radio through fastboot, this is the command...

Drupal 7: how to get the body of a node

If in Drupal 7 we have to use the content of the body of a node as variable then we can get it through php, everything is really simple, we only have to give attention if the site uses only one language or if it is a multilanguage site. If the site use only one language we can get the body of a node in this way: $body = $node->body['und'][0]['value']; If the site is a multilanguage site we can...

Drupal 7: how to get absolute path url or path alias url of a node

In Drupal 7 we can access to a node through its absolute path url or through its path alias. In some case it is really useful get these urls and as usually in drupal we can do this in a lot of ways, here there are some examples. Code to get absolute url: global $base_url; $nodeurl = $base_url . '/' . current_path(); $nodeurl = url('node/'. $node->nid); Code to get path alias url: $nodeurl =...

Drupal 7: how to detect when a node or a comment is changed from unpublished to published or vice versa

In Drupal 7 we don't have a simple way to detect when a node or a comment switches from published to unpublished or vice versa but we can detect these actions with some php code. Node publishing: isset($node->original->status) && $node->original->status == 0 && $node->status == 1 Node unpublishing: isset($node->original->status) && $node->original-...

Pages

Subscribe to RSS - Mentor's blog