Categorie
Information and Communications Technology

Xenserver 7.0 / XCP-ng 7.5 API Python Backup Running VMs

Python 3 script equivalent to the previous powershell gist script. This is the gist:
https://gist.github.com/nikiink/97356430e6fd5025ca217afc00831ef6

Categorie
Information and Communications Technology

Xenserver 7.0 API PowerShell Backup Running VMs

The script backups one or more virtual machines on one or more Xenserver hosts. The configuration of virtual machine to backup is read from an xml file.
This is the gist on github:
https://gist.github.com/nikiink/cdc687d1bbe227e5cfa3e5759c7f7214

## EQUIVALENT BASH SCRIPT:
## SNAPUUID=`xe vm-snapshot uuid=$VMUUID new-name-label="SNAPSHOT-$VMUUID-$DATE"`
## xe template-param-set is-a-template=false ha-always-run=false uuid=${SNAPUUID}
## xe vm-export vm=${SNAPUUID} filename="$BACKUPPATH/$VMNAME-$DATE.xva"
## xe vm-uninstall uuid=${SNAPUUID} force=true
Import-Module XenServerPSModule
Connect-XenServer -url https://$XENHOST $XENUSER $XENPASSWORD
#Create temporary snapshot for hot backup (choose unique name for snapshot)
Invoke-XenVM -Name "Xenial Test" -XenAction Snapshot -NewName "Xenial Test Snapshot"
$snapshot = Get-XenVM -Name "Xenial Test Snapshot"
#Set is-a-template and ha-always-run to false
Set-XenVM -Uuid $snapshot.uuid -IsATemplate $false -HaAlwaysRun $false
#Export snapshot (path is on the server where this script runs)
Export-XenVM -Uuid $snapshot.uuid -XenHost $XENHOST -Path 'C:\Users\Administrator\Documents\Xenial Test.xva'
#Destroy Snapshot
Remove-XenVM -Uuid $snapshot.uuid
Disconnect-XenServer
Categorie
Information and Communications Technology

Windows Update Automatic Download, Install, Reboot and repeat (reboot and recall)

With this scheduled task you can install all windows updates without user intervention. The reboot is automatic until all updates are installed.
Download the three files on the following gist. The files must be copied in the folder C:\WUA:

  • C:\WUA\WUA_SearchDownloadInstall.vbs
  • C:\WUA\WUA_SearchDownloadInstall.bat
  • C:\WUA\WUA_SearchDownloadInstall.xml

After copying these three files open the task scheduler and import the WUA_SearchDownloadInstall.xml file. At the next reboot the task will start the update process and will reboot the pc many times until all updates are installed.
IMPORTANT: Remember to disable or delete the task when finished.
https://gist.github.com/nikiink/87b6f735b82165f089bd85b615435a01

Categorie
Information and Communications Technology

Windows 7 Recovering RegBack Scheduled Task

If you want to recover the task that backups the registry of windows 7. You must import this file in the Task Scheduler (save as xml and import):

<Task xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
 <RegistrationInfo>
 <Author>$(@%systemroot%\system32\regidle.dll,-600)</Author>
 <Version>1.0</Version>
 <Source>$(@%systemroot%\system32\regidle.dll,-601)</Source>
 <URI>Microsoft\Windows\Registry\RegIdleBackup</URI>
 <Description>$(@%systemroot%\system32\regidle.dll,-602)</Description>
 <SecurityDescriptor>O:BAG:BAD:P(A;;FA;;;BA)(A;;FA;;;SY)(A;;FR;;;IU)(A;;FRFX;;;S-1-5-80-2970612574-78537857-698502321-558674196-1451644582)</SecurityDescriptor>
 </RegistrationInfo>
 <Triggers>
 <CalendarTrigger>
 <StartBoundary>2008-01-01T00:00:00</StartBoundary>
 <ScheduleByDay>
 <DaysInterval>10</DaysInterval>
 </ScheduleByDay>
 <RandomDelay>PT1H</RandomDelay>
 </CalendarTrigger>
 </Triggers>
 <Settings>
 <Enabled>true</Enabled>
 <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
 <AllowStartOnDemand>false</AllowStartOnDemand>
 <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
 <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
 <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
 <ExecutionTimeLimit>PT0S</ExecutionTimeLimit>
 <Hidden>true</Hidden>
 <WakeToRun>false</WakeToRun>
 <StartWhenAvailable>true</StartWhenAvailable>
 <Priority>5</Priority>
 <RunOnlyIfIdle>true</RunOnlyIfIdle>
 <UseUnifiedSchedulingEngine>true</UseUnifiedSchedulingEngine>
 <IdleSettings>
 <Duration>PT3M</Duration>
 <WaitTimeout>PT23H</WaitTimeout>
 <StopOnIdleEnd>true</StopOnIdleEnd>
 <RestartOnIdle>true</RestartOnIdle>
 </IdleSettings>
 </Settings>
 <Principals>
 <Principal id="LocalSystem">
 <UserId>S-1-5-18</UserId>
 </Principal>
 </Principals>
 <Actions Context="LocalSystem ">
 <ComHandler>
 <ClassId>{ca767aa8-9157-4604-b64b-40747123d5f2}</ClassId>
 </ComHandler>
 </Actions>
</Task>
Categorie
Information and Communications Technology

Samsung Grand 2 G7102 updating to android 4.4.2 and replacing touch emergency calls only

Hello, yesterday i replaced the touch screen to my Galaxy Grand 2. It has android version 4.3 and after replacing the touch screen all was working.
So, after replacing touch screen i decided to update android to version 4.4.2. After updating the phone didn’t boot anymore. It hangs on boot with the blue text on top of the display “RECOVERY BOOTING…..”.
The problem was the touch screen. Detaching the touch screen the phone boots correctly to android 4.4.2. (this touch screen had no duos logo, another touch screen with the duos logo works perfectly)
Now another problem, with android 4.4.2 insering the sim card the phone says: Emergency calls only. This is a problem with modem.bin image. It has to be updated with odin 3.07 using the PHONE button. You have to download the modem.bin for android 4.4. You can find it on the internet, for example from here:
http://www.mediafire.com/download/x4loxo3ax4bh21p/Modem+4.4.2.rar
After updating the modem.bin with odin 3.07 the network works correctly.
(Use odin 3.07 because newer versions have no PHONE button)
 

Categorie
Information and Communications Technology

[Android] Automatic brightness without sensor using front camera

I have a Samsung Grand Neo Plus. That phone misses the brightness sensor but has the front facing camera.
Using Lux Lite (the free version) or Lux (the full version) application it’s possible to configure the front facing camera as brightness sensor.
After installing it, the application uses the light conditions captured from the front camera to change the phone brightness. I set the brightness update on unlocking.
Another useful thing is the possibility to increase the brightness shaking the phone. In Settings >> Brightness >> Shake to increase brightness. It works being in the lock screen.
If the brightness is too high or low it’s possible to customize the regulations opening the application, modifying the brightness and clicking on the chains symbol to link the ambient light values to the display brightness.
For my Grand Neo Plus I linked the following values:

Luma Brightness
0 1%
1 4%
75 25%
194 35%
253 100%
255 100%
Categorie
Information and Communications Technology

Android 5 Lollipop Enable Mobile Data with Llamalab Automate

Using Automate on a rooted Galaxy S4 with Lollipop 5.0.1 i was in trouble enabling or disabling mobile data. My android is rooted correctly but automate give me a timeout error.
To enable/disable mobile data i used a shell superuser command action block with one of these commands:

svc data enable
svc data disable
Categorie
Information and Communications Technology

Reset/Restore Glam'our START boot hangs

I found an android phone of the Glam’our brand, the START model hanging on boot with the Glam’our logo unable to boot. The phone was rooted and with link2sd plus installed and with most of the applications linked to sd.
I tryed resetting it to factory defaults. I found no documentation about that. I supposed that it can be done in recovery mode, but how? Going to recovery mode it’s possible, but the steps are not so clear. At the end i realized it. Well, i did this way: i turned off the phone (removing the battery) and i turned it on pressing at the same time the buttons: VOL- and POWER until it shows up this menù in CHINESE!Glam Our Start Recovery
To reset the phone we need to select (with VOL-) the item containing “e MMC” after some chinese characters. Then i confirmed the choice with POWER and when the text changed to “data e MMC”, or something similar, i confirmed again with the POWER button. After a while the phone will reset and reboot.
At this point the phone will turn on correctly to the lock screen. After unlocking it and selecting the default SIM behaviour, the phone shows me this notification: “App permission management is closed” [from the application com.mediatek.security] and then I see as home screen a black screen (all black without icons). And NOW!!!
The home screen manager application (the launcher) doesn’t start up correctly. To solve this problem we can install a launcher from Play Store, for example i installed Nova Launcher. To install it we need to open the Play Store app, but how without home screen working?…. following these steps:

  1. From notification bar we can open Settings,
  2. Go to the application manager,
  3. Find and select Play Store,
  4. In the application details choose “Start Application”,
  5. After opening Play Store let’s install “Nova Launcher”.

At this point the phone is usable. Nova Laucher it’s good, better then the original launcher. Or you can use another launcher like, for example, Apex Launcher and Go Launcher.
These are the phone details:

GLAM'OUR START
MOLY.WR8.W1315.MD.WG.MP.V4.P1
Android 4.2.2
Kernel 3.4.5
V5.0_20131114
Categorie
Information and Communications Technology

Hidden / Unlock tethering using socks proxy on Android

Activating tethering/wifi router (on Android) navigating from your computer doesn’t work. The computer connects correctly to your phone wifi, but you’re unable to navigate. Seems your mobile operator detects you’re tethering and locks your traffic.
To hide/unlock tethering traffic you can use a proxy server installed on your android device, so internet requests are made by your android device and not directly from your computer:

+-------------+     +-------------------------+     +----------+
|  Computer   | --> | Proxy on android device | --> | Internet |
+-------------+     +-------------------------+     +----------+

There is a free proxy for android “Proxy Server” from Ice Cold Apps. Bu last version (v 3.2) doesn’t work, the pc loads the first web page and than returns always a page with 404 error.
So I used another proxy server from Ice Cold Apps the “Socks Server Ultimate”. It’s free as “Proxy Server” and works. Below the configuration steps:

  1. install Ice Cold Apps “Socks Server Ultimate” on your android device from Play Store
  2. open the app and configure a new socks server in this way:
    • server name: a name (let’s set Default)
    • run on port: a port from 1024 to 65536 (let’s set 8080)
    • select option “Start directly when app starts clean” to start this proxy when opening the app
    • exit and save
  3. start tethering/wifi router on your device
  4. start the app “Socks Server Ultimate” (proxy will start automatically)
  5. inside the app clic on “Info” and take note of the address that starts with 192.168…
  6. now we can configure the browser (for example firefox) on your pc: open firefox and configure the proxy in this way: Options >> Advanced >> Network >> Settings… (where 192.168.42.129 is the address of the previous step that is the address of the android device) [the image is on the italian version of firefox]:
    firefox-socks-proxy

Note that this proxy server is a socks proxy not only an http proxy, so it can be used with all applications that support a socks proxy, not only for the web navigation.
Sometimes the application Socks Server Ultimate doen’t work, you have to restart it: use the Exit button and reopen it.
 

Categorie
Information and Communications Technology

Evernote Importing from LG Memo and from ColorNote Android Apps

I switched from LG Memo and Colornote to Evernote.
The Evernote application imports the enex file format. I created two php scripts that export the notes from Colornote and from LG Memo.
For Colornote is required the file colornote.db that is only visible on rooted devices. For LG Memo the note database is inside the backup backup.nrt that can be created from LG Memo and rooting is not required.
This is lgmemo2enex.php:
https://gist.github.com/nikiink/d94c5e2d3d964740a34c#file-lgmemo2enex-php
and this is colornote2enex.php:
https://gist.github.com/nikiink/aff1e5470db969737c8d#file-colornote2enex-php
these scripts must be run in the same directory containing the files colornote.db or richnote. The scripts outputs the files lgmemo.enex and colornote.enex that could be imported in Evernote.