segunda-feira, fevereiro 29, 2016

CSS Inliner Tool | Email Design Reference

CSS Inliner Tool | Email Design Reference



transform css into embedded for gmail



make css styles go inside html on style tag

quarta-feira, fevereiro 24, 2016

Titanium Backup - Backup Failed error parsing package

[Solution] Titanium Backup - Backup Failed: Insufficient Free Storage Space and Error Parsing Package Errors



This tutorial show how to fix Titanium Backup, backup and restore related errors - Backup failed: Insufficient free storage space and Error parsing package while restoring backup.



Titanium Backup freezes on restore... hang



These error mainly occurs when you've installed Chainfire SuperSU over any other super user app. Just follow the below instructions to solve these errors,

  • Open SuperSU and move to Settings tab.
  • Now scroll till you find Security.
  • Notice that Mount namespace separation is already checked, now uncheck it and reboot your device
  • Done.!!
  • Now backup/restore your apps.

terça-feira, fevereiro 23, 2016

How to Install Stock Firmware on Moto Maxx XT1225



How to Install Stock Firmware on Moto Maxx XT1225







Android, the most popular operating system for mobile devices, is best known for its capability for customization, flexibility and vast development community. The OS allows you access to millions of apps but the real joy of being an Android user lies in the very sense of freedom and possibilities that comes through root privilege. By gaining root access on your device, you can take control of the system files and modify them to achieve the desired goals.


Even if you are not an advanced user, there are hundreds of people working selflessly to help you with customizing your device or solve the issues you might have in using it. Indeed, rooting and flashing custom recoveries, kernels, mods, patches and ROMs add a hell lot of adventures to Android experience!

Since involving in custom development activities void the warranty of the device and expose it to risks, you must know the way to restore your device to stock. Sometimes, flashing the stock firmware back might prove to be a lifesaver! If you want to unroot your device, or recover it from a bootloop, or want to get OTA updates, or make a warranty claim, you must restore it to stock.

Android is blessed with hundreds of OEMs who use the customized versions of OS on their devices. And therefore, there’s no universal method for installing the stockfirmware on Android devices. The tools and methods differ from OEM to OEM. When it comes to Motorola phones there are 3 ways to flash the stock firmware on them— using a tool called the RSD Lite, using ADB and Fastboot commands to push the firmware files to the device, and by running the .bat file provided with the firmware.

Not too long ago, we did a tutorial on restoring the Verizon Droid Turbo to stock, and today we’ve come with another guide to help you with installing the stock firmware on the Moto Maxx XT1225. The tutorial will also work on the other model of the phone but you need to have the correct firmware.
Download Moto Maxx XT1225 Stock Firmwares
India (Android 5.0.2):

QUARK_RETEU_INDIA_5.0.2_LXG22.33-12.11_cid7_subsidy-DEFAULT_CFC.xml.zip | Mirror | Mirror 2
Puerto Rico (Android 4.4.4):

AMXPR_XT1225_4.4.4_KXG21.50-9_cid12_subsidy-CLALASL_CFC.xml.zip | Mirror
Mexico (Android 4.4.4 + Lollipop OTA + Firmware):

RETLA_XT1225_4.4.4_KXG21.50-9_cid12_subsidy-DEFAULT_CFC.xml.zip

Lollipop OTA: Blur_Version.21.11.9.quark_retla.retla.en.01.zip

XT1225_QUARK_RETLA_5.0.2_LXG22.33-12.13_cid12_subsidy_CFC.xml.zip
Brazil (Android 4.4.4 + 5.0.2 Lollipop):

RETBR_XT1225_4.4.4_KXG21.50-9_cid12_subsidy-DEFAULT_CFC.xml.zip

Lollipop OTA: Blur_Version.22.34.13.quark_retbr.retbr.en.BR.zip

QUARK_RETBR_5.0.2_LXG22.33-12.13_cid12_subsidy_CFC.xml.zip

NIIBR_XT1225_4.4.4_KXG21.50-9_cid12_subsidy-DEFAULT_CFC.xml.zip (Nextel)
Chile (Android 4.4.4 KitKat)

AMXCL_XT1225_4.4.4_KXG21.50-9_cid12_subsidy-CLACLSL_CFC.xml.zip
Install Stock Firmware on Moto Maxx Using RDSLite
Download the stock firmware file for your Moto Maxx from above or here.
Download RSD Lite tool and install it on your computer: RSDLite v6.2.4 | Mirror | Mirror 2
Download and setup Android SDK on your computer.
Install Motorola USB Drivers if you have not installed it yet.
Enable USB Debugging on your Moto Maxx.
Now reboot your Moto Maxx into the Fastboot/Bootloader mode. To do so, launch a command window on your PC, connect your phone to computer via USB cable and type the following line in the command window:adb reboot bootloader

Launch RSDLite and connect your device to computer using USB cable.
Now click the 3-dot (…) button on the Filename field, browse to the firmware file with .zip extension and select it.
Finally, click the Start button to initiate firmware installation.
Wait patiently while the firmware is being installed. It might take a few minutes.
When the installation is finished, reboot your phone.
Flash Firmware on Moto Maxx Using Motorola Fastboot
Preparations
Download the firmware file for your device.
Download Motorola Fastboot tool: mfastboot-v2.zip
Make sure you have installed Motorola USB drivers on your PC.
Also, enable USB Debugging on your phone.
Backup your phone’s data and make sure the device has at least 70% battery juice.
Instructions
Unzip the downloaded firmware on your desktop.
Also unzip mfastboot-v2.zip file and copy the contents of the mfastboot folder to thefirmware folder.
Now reboot your Moto Maxx into Fastboot mode. You can do so either by using “adb reboot bootloader” command, or by holding the Volume Down+Power keys simultaneously while the device is turned off.
Connect your device to the computer using USB cable.
Now open the folder that contains the firmware and mfastboot files. Place the mouse pointer at an empty space in the folder, press Shift key + Right-click on mouse and select “Open command window here” option.
When the command window is launched, type the following lines one by one. You need to hit the Enter key after each command and issue the next command when the previous command has been executed.mfastboot getvar max-sparse-size
mfastboot flash motoboot bootloader.img
mfastboot flash radio radio.img
mfastboot flash logo logo.bin
mfastboot flash boot boot.img
mfastboot flash recovery recovery.img
mfastboot flash system system.img_sparsechunk.0
mfastboot flash system system.img_sparsechunk.1
mfastboot flash system system.img_sparsechunk.2
mfastboot flash system system.img_sparsechunk.3
mfastboot flash system system.img_sparsechunk.4
mfastboot erase cache
mfastboot erase userdata
mfastboot erase clogo
mfastboot oem fb_mode_clear
mfastboot reboot

The last command having issued, your Moto Maxx will reboot.

Just wait patiently for 3-6 minutes as it takes longer than usual to reboot for the first time after flashing the firmware. When you see the welcome screen, go through the initial setup wizard and start enjoying the new firmware. You have successfully restored your Moto Maxx XT1225 to stock.

Should you have any question or problem regarding the procedure described above,drop a comment below!

quinta-feira, fevereiro 18, 2016

[X Force XT1580] Rooted!

[X Force] Rooted! | Motorola Droid Turbo 2





I use twrp for clark (moto x style).
Screen was upside down, so it little hard to hit in proper touchbutton - but works!
Installation update-supersu-v2.46.zip succeed!


twrp-3.0.0-1-clark.img



Download to phone update-supersu zip file.

Unlock bootloader and boot (not flash! - only boot from pc) twrp for clark.

fastboot boot twrp-3.0.0-1-clark.img

properly touch layer you must hit 'install' button in twrp,

and navigate to update-supersu zip file.

After that, simply install this file, disconnect phone from pc and reboot.



Done - you have rooted phone.

SuperSU  thread xda-developers
http://forum.xda-developers.com/showthread.php?t=1538053
TWRP / FlashFire installable ZIP:
Stable: http://download.chainfire.eu/supersu-stable
Beta: http://download.chainfire.eu/supersu-beta
Latest: http://download.chainfire.eu/supersu
Note that if you are already rooted, installing through Play is by far the easiest way to install SuperSU !




https://twrp.me/devices/motorolamotox2015pure.html


http://forum.xda-developers.com/moto-x-style/orig-development/recovery-twrp-2-8-7-0-touch-recovery-t3200520


https://dl.twrp.me/clark/twrp-2.8.7.1-clark.img.html

Remove Unlocked Bootloader Warning - Moto G (2nd Gen)
http://forum.xda-developers.com/moto-g-2014/general/fix-remove-unlocked-bootloader-warning-t2875385
mfastboot.exe flash logo logo.bin
lobo.bin download

[X Force] How to Manually Flash Official Firmware
http://forum.xda-developers.com/droid-turbo-2/general/x-force-how-to-manually-flash-official-t3282077

Official Stock Firmware For all Kinzie Devices (Droid Turbo 2, Moto X Force)
http://forum.xda-developers.com/droid-turbo-2/general/kinzie-stock-firmware-moto-x-force-t3279354

terça-feira, fevereiro 16, 2016

Set up an email alert when a ssh login is successful

cp /root/sendEmail /usr/local/sbin/
chmod +x /usr/local/sbin/sendEmail

vim /etc/ssh/login-notify.sh

#!/bin/sh

# Change these two lines:
EMAIL_FROM=root@`hostname`
EMATIL_TO=youemail@domain.com

if [ "$PAM_TYPE" != "close_session" ]; then
    ip=`echo $SSH_CONNECTION | cut -d " " -f 1`
    host="`hostname`"
    subject="SSH Login: $PAM_USER from $PAM_RHOST on $host from $ip"
    # Message to send, e.g. the current environment variables.
     message="`nslookup $PAM_RHOST|grep name` \n `env`"
    /usr/local/sbin/sendEmail -t $EMATIL_TO -f $EMAIL_FROM -u $subject -m $message
#    echo "$message" | mailx -r "$sender" -s "$subject" "$recepient"
fi

##END FILE


chmod +x /etc/ssh/login-notify.sh

vim /etc/pam.d/sshd

#add this lines
session optional pam_exec.so seteuid /etc/ssh/login-notify.sh

segunda-feira, fevereiro 01, 2016

HOWTO: Make a chroot'ed chroot CentOS 7 or debian 8

1.  groupadd chrootusers
2.  vim sshd_config -- add lines following lines
Match group sshusers
X11Forwarding no
AllowTcpForwarding no
ChrootDirectory /home/%u
#ForceCommand /usr/libexec/openssh/sftp-server
3.  useradd user1
4.  usermod -G chrootusers
5.  usermod -G chrootusers -d / user1
6.  yum --installroot=/var/chroot --releasever=7 --nogpg --disablerepo='*' --enablerepo=base install centos-release openssh-clients wget vi nano zip unzip tar mariadb findutils iputils bind-utils rsync
7.  echo "none /var/chroot/proc proc defaults 0 0" >> /etc/fstab
8.  echo "/dev /var/chroot/dev none bind 0 0" >> /etc/fstab
9.  mount -a
10. systemctl restart sshd.service
11. id -u user1 (keep it)
12. id -g user1 (keep it)
13. chroot /var/chroot /bin/bash -c 'useradd -u (id item 11) user1'
14. chroot /var/chroot /bin/bash -c 'groupadd -g (id item 12) chrootusers'
Luckily, I was able to come up with a way to do that.



Debian 8


Install the required packages

apt-get install binutils debootstrap libpam-chroot

Choose a location

mkdir -p /srv/chroot/wheezy

Build the chroot
Either select a close network mirror manually, use one of the dns based mirrors such as ftp.XX.debian.org where XX is your geographic country code, or use the httpredir.debian.org which will do this for you automatically. The httpredir.debian.org is easier to document and becoming the generally preferred method and is therefore recommended if you don't have your own fast preferred local mirror. See http://httpredir.debian.org/ for documentation and details.

debootstrap --arch [i386|amd64] wheezy /srv/chroot/wheezy http://httpredir.debian.org/debian
To enter:

chroot /srv/chroot/wheezy
Configuration

In general, it is necessary to create/edit key configuration points.

Create a /usr/sbin/policy-rc.d file IN THE CHROOT so that dpkg won't start daemons unless desired. This example prevents all daemons from being started in the chroot.


chroot /srv/chroot/wheezy
cat > ./usr/sbin/policy-rc.d <
#!/bin/sh
exit 101
EOF
chmod a+x ./usr/sbin/policy-rc.d


real system /etc/passwd (points to the chroot folder)
rbf7:x:1002:1002::/home/user:/bin/sh

where /var/chroot is the dir you build your chroot system
# vi  /etc/security/chroot.conf 

user    /var/chroot

# mount --bind /dev/pts /var/chroot/dev/pts
# mount -t proc proc /var/chroot/proc

# vim /etc/pam.d/sshd
session    required   pam_chroot.so debug

# vim /etc/pam.d/login
session    required   pam_chroot.so debug





Step 1: Add a group for chrooted users
groupadd chrootusers
Step 2: Configure SSH
nano /etc/ssh/sshd_config
Replace
Subsystem     sftp    /usr/libexec/openssh/sftp-server
With
Subsystem     sftp    internal-sftp
Paste at the End
Match Group chrootusers
  ChrootDirectory /home/%u
Run
systemctl restart sshd
systemctl status sshd
Step 3: Add a user
Change peter to your desired user name.
export NEW_USER_NAME=peter

useradd ${NEW_USER_NAME}
usermod -G chrootusers -d / ${NEW_USER_NAME}
passwd ${NEW_USER_NAME}
Step 4: Install packages and create the necessary directory structure
yum --installroot=/home/${NEW_USER_NAME} --releasever=7 --nogpg --disablerepo='*' --enablerepo=base install centos-release openssh-clients wget vi nano zip unzip tar mariadb findutils iputils bind-utils rsync
Step 5: Mount proc and dev
echo "none /home/${NEW_USER_NAME}/proc proc defaults 0 0" >> /etc/fstab
echo "/dev /home/${NEW_USER_NAME}/dev none bind 0 0" >> /etc/fstab
Run
mount -a
Step 6: Configure the DNS servers
echo "nameserver 8.8.8.8" >> /home/${NEW_USER_NAME}/etc/resolv.conf
echo "nameserver 8.8.4.4" >> /home/${NEW_USER_NAME}/etc/resolv.conf
That's all.
Keep in mind that $NEW_USER_NAME is bound to the current session!
Start from Step 3 when adding another user.
To install more packages later use the same command as in Step 4.

When logging in using SSH you will get messages like cannot find name for user ID x. They are safe to ignore, but if you'd like to get rid of them, you will need to duplicate the user in chroot:
export NEW_USER_ID=$(id -u ${NEW_USER_NAME})
export NEW_USER_GROUP_ID=$(id -g ${NEW_USER_NAME})

chroot /home/${NEW_USER_NAME} /bin/bash -c 'useradd -u ${NEW_USER_ID} ${NEW_USER_NAME}'
chroot /home/${NEW_USER_NAME} /bin/bash -c 'groupadd -g ${NEW_USER_GROUP_ID} chrootusers'


For use with chrooted in apache 2.4 and above you must include
 cp /sbin/suexec /var/chroot/sbin/suexec
cp /sbin/suexec /var/chroot/usr/sbin/suexec
 Require all granted

    ServerName bkp.domain-chrooted.com
    DocumentRoot /var/chroot/home/user-name/public_html
    ServerAdmin webmaster@domain-chrooted.com
    UseCanonicalName Off
    UserDir enabled user-name
    CustomLog /var/log/httpd/domlogs/bkp.domain-chrooted.com combined


   
#       Include conf.d/auth-inc.conf.txt
       AllowOverride All
       Require all granted
   
    # Enable backwards compatible Server Side Include expression parser for Apache versions >= 2.4.
    # To selectively use the newer Apache 2.4 expression parser, disable SSILegacyExprParser in
    # the user's .htaccess file.  For more information, please read:
    #    http://httpd.apache.org/docs/2.4/mod/mod_include.html#ssilegacyexprparser
   
       
            SSILegacyExprParser On
       
   

   
        suPHP_UserGroup user-name user-name
   
   
       
            SuexecUserGroup user-name user-name
       
   
   
        RMode config
        RUidGid user-name user-name
   
   
        # For more information on MPM ITK, please read:
        #   http://mpm-itk.sesse.net/
        AssignUserID user-name user-name
   

    ScriptAlias /cgi-bin/ /var/chroot/home/user-name/public_html/cgi-bin/





A proper way to create a chrooted chroot SSH on CentOS 7

linux - A proper way to create a chrooted SSH on CentOS 7 - Server Fault
linux - A proper way to create a chrooted SSH on CentOS 7 - Server Fault

Luckily, I was able to come up with a way to do that.
Step 1: Add a group for chrooted users
groupadd chrootusers
Step 2: Configure SSH
nano /etc/ssh/sshd_config
Replace
Subsystem     sftp    /usr/libexec/openssh/sftp-server
With
Subsystem     sftp    internal-sftp
Paste at the End
Match Group chrootusers
  ChrootDirectory /home/%u
Run
systemctl restart sshd
systemctl status sshd
Step 3: Add a user
Change peter to your desired user name.
export NEW_USER_NAME=peter

useradd ${NEW_USER_NAME}
usermod -G chrootusers -d / ${NEW_USER_NAME}
passwd ${NEW_USER_NAME}
Step 4: Install packages and create the necessary directory structure
yum --installroot=/home/${NEW_USER_NAME} --releasever=7 --nogpg --disablerepo='*' --enablerepo=base install centos-release openssh-clients wget vi nano zip unzip tar mariadb findutils iputils bind-utils rsync
Step 5: Mount proc and dev
echo "none /home/${NEW_USER_NAME}/proc proc defaults 0 0" >> /etc/fstab
echo "/dev /home/${NEW_USER_NAME}/dev none bind 0 0" >> /etc/fstab
Run
mount -a
Step 6: Configure the DNS servers
echo "nameserver 8.8.8.8" >> /home/${NEW_USER_NAME}/etc/resolv.conf
echo "nameserver 8.8.4.4" >> /home/${NEW_USER_NAME}/etc/resolv.conf
That's all.
Keep in mind that $NEW_USER_NAME is bound to the current session!
Start from Step 3 when adding another user.
To install more packages later use the same command as in Step 4.

When logging in using SSH you will get messages like cannot find name for user ID x. They are safe to ignore, but if you'd like to get rid of them, you will need to duplicate the user in chroot:
export NEW_USER_ID=$(id -u ${NEW_USER_NAME})
export NEW_USER_GROUP_ID=$(id -g ${NEW_USER_NAME})

chroot /home/${NEW_USER_NAME} /bin/bash -c 'useradd -u ${NEW_USER_ID} ${NEW_USER_NAME}'
chroot /home/${NEW_USER_NAME} /bin/bash -c 'groupadd -g ${NEW_USER_GROUP_ID} chrootusers'