Tuesday 29 December 2015

Tiles game in android+code


Tiles game in android+code

software requirements:

1.Eclipse
2.Java

Import the project into the eclipse and start editing.

Game features:
1.Action game
2.High score
3.speed increase
4.Different map

Download game code : Download

Demo apps: https://play.google.com/store/apps/details?id=com.initedit.opps_wrong_tab

Sunday 1 November 2015

Blink keyboard light - Disco light

As you know there is 3 LED in every keyboard.

1. NUM LOCK
2.CAPS LOCK
3.SCROLL LOCK

Now we are gonna make this light blink using WScript.

Note: before running this program you should know how to close the program.

To close the program open task manager(Ctrl+Alt+Del) and kill wscript.exe

1. Open notepad and write this code.

Set WEBCHILLER =wscript.CreateObject("WScript.Shell")
do
wscript.sleep 100
WEBCHILLER.sendkeys "{CAPSLOCK}"
WEBCHILLER.sendkeys "{NUMLOCK}"
WEBCHILLER.sendkeys "{SCROLLLOCK}"
loop


2. Save the file as “blink.vbs”

3. Open blink.vps file and see your keyboard LED light.

Wednesday 7 October 2015

How to see password in password textbox

How to see password in password Textbox

When we type password in any password box it's get encrypted and you will see only ****.
 It is very easy just change the text Input type from password to text.

1. Right click on password text box and go to Inspect element.


2. At below(sometimes right) you will see Inspect tab. <input> Search for type="passoword" .



3. Change input type from type="passoword" to type="text" ..


4. Press Enter key.

Thursday 1 October 2015

Slow motion video using ffmpeg

Speeding up/slowing down video using ffmpeg:

-i = input file(mov,mp4,avi,mkv,flv)
-filter:v= video filter
-filter:a= audio filter(The atempo filter is limited to using values between 0.5 and 2.0)
setpts= set presentation timestamp
-r = frame rate

Slowing down:

Video:
ffmpeg -i input.mp4 -filter:v "setpts=2.0*PTS" output.mp4  //half speed

ffmpeg -i input.mp4 -filter:v -r 30 "setpts=2.0*PTS" output.mp4  //half speed with fps 30
(Note: More fps= Large video size)

Audio:
ffmpeg -i input.mkv -filter:a "atempo=2.0" -vn output.mkv

Speeding up:

Video:
ffmpeg -i input.mp4 -filter:v "setpts=2.0*PTS" output.mp4  //2xfaster

Audio:
ffmpeg -i input.mkv -filter:a "atempo=0.5" -vn output.mkv

Download ffmpeg https://www.ffmpeg.org/download.html

More info :ffmpeg.org


Saturday 12 September 2015

Windows trick to lock your folder using CACLS

CACLS command that apply the permission rules on folders.
Access Control Lists(ACL) only works on NTFS formatted drive,
ACL determines which users (or groups of users) can read or edit the file.


1. Open Notepad and type below command.

cacls folder_name /E /P everyone:n

eg. cacls test /E /P everyone:n

2. Save notepad file as "lock.bat".

3.Open another Notepad and type below command.

cacls folder_name /E /P everyone:f

eg. cacls test /E /P everyone:f

4. Save notepad file as "unlock.bat".

5. Now to lock your folder,double click lock.bat file.

6. And to unlock the folder,double click unlock.bat file.



More info about CACLS: http://ss64.com/nt/cacls.html

Grant access rights, permision can be:
          R  Read 
          W  Write
          C  Change (read/write) 
          F  Full control
          N  None

Thursday 27 August 2015

Simple photo upload and share code in php

Features:
-Upload, compress, share
-Album, blog, hash tag
-Search

Live code: http://photo.initedit.com 



more opensource code: http://opensource.initedit.com

Installation steps:
Now get started with how to install photo.initedit.com .

- First you need to have an server which support php and mysql(LAMP).
- Now Unzip the downloaded folder.(downlaod)
- Go to "mysql" directory inside the extracted directory.
- Now After confirming table.sql file go to phpmyadmin panel(or import using mysql console).
- Create a new database using phpmyadmin
- Now Click on import to import tables.sql file from our "mysql" directory.
- Now go to extracted folder inside php/class/ folder.
- Open common.php file in text editor.
- Change username ,password, and databases accordingly .
- Done.

Note : You also have to install Imagick for optimizing image loading
(http://php.net/manual/en/imagick.installation.php)

Tuesday 11 August 2015

simple Load balancer using Nginx web server

Nginx Load balancing on linux ubuntu 14.04

Loadbalancer(lb):192.168.0.10(Nginx)
webserver(web1):192.168.0.11(apache)
webserver(web2):192.168.0.12(apache)
webserver(web3):192.168.0.13(apache)
database server(db):192.168.0.14(mysql)

note:we can increase web server for load balancing.

1.Install nginx webserver on Loadbalancer(lb)

apt-get install nginx

2.Edit the nginx default file.

 nano /etc/nginx/nginx.conf

note:you can use any text editor vi or pico.

events {
        worker_connections  1024;
        use                 epoll;
        multi_accept        on;
}

upstream backend  {
  server 192.168.0.11;
  server 192.168.0.12;
  server 192.168.0.13;
}

server {
  location / {
    proxy_pass  http://backend;
  }
}

3.Restart nginx webserver

sudo service nginx restart

4.Install apache webserver on web1, web2 and web3.

apt-get install apache2


5.Goto var/www/html folder of webserver respectively and remove index.html .
add new index.html and write web1 for web1 apache server.

6.Install mysql server on db

apt-get install mysql-server


7.To allow mysql accessible to all webserver run bellow command.


$ mysql -u root -p
Enter password:


mysql> GRANT ALL ON *.* to root@'192.168.0.11' IDENTIFIED BY 'your-root-password';


mysql> GRANT ALL ON *.* to root@'192.168.0.12' IDENTIFIED BY 'your-root-password';


mysql> GRANT ALL ON *.* to root@'192.168.0.13' IDENTIFIED BY 'your-root-password';


Note:I didnot add mysql server in above example but you can add .


8.Open your browser goto url http://192.168.0.10 and refresh the page.

you will see whenever you refresh the page it will show you from which webserver your page is loaded.(because we have added html file in step 5). It will distribute web request equally across the apache Webserver.


Nginx also have diffrent type of load balancing:

1.Session persistence

2.Weighted load balancing

3.Max Fails, etc.


for more:http://nginx.org/en/docs/http/load_balancing.html