Saturday, October 25, 2014

GIT Repository Tool - the stupid content tracker

This is a quick guide on commands to get started with using git in Linux.

What is git?
Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals. 

It is a repository program similar to Perforce for example that allows you to make changes to your work and 'check' them in and continue to make changes and at any time you could revert back to any version you previously had. It also can be integrated with github to share your work with others and have multiple people make changes at the same time. It is a powerful revision management system and collaboration tool.

Installing git

git is available on Linux, Mac and Windows, but in this guide I will only highlight using it with Linux. 

To install on a Debian-based distribution like Ubuntu, from terminal use:
$ apt-get install git

For Fedora:
$ yum install git

For installing from Source or on other OS's, please visit:
http://git-scm.com/book/en/v2/Getting-Started-Installing-Git

Initializing a Directory to use git (git init)

Navigate to the directory of your project or work that you want to backup using git.

$ cd myproject
~/myproject $ git init
Initialized empty Git repository in /home/user/myproject/.git/

Now there will be a hidden folder named ".git" in that directory that git will use for your repository. Do not modify or delete this folder unless you want to stop using git for this project.

Removing a Directory from git

Just delete the .git directory from your project folder and all your git repository will be gone.

Adding a File To Track in Your Repository (git add )

Please note, that you can only add files to track, not directories. It doesn't matter what your directory structure is. But if you move files or rename directories, then you will have to do a move command to rename your file (since the path changed). Using git status (below) will notify you if you need to do this and how to do it.

Create your new file then to add them use:

git add

Example:
~/myproject $ printf "hello world" > test.txt
~/myproject $ git add test.txt

Checking Status of your changes (git status)
Use the following command to show you a list of all the changes you made before committing.

git status

It will tell you how to add a file.

-----------------------------------------------------------------

How To Use GIT

A. Create a GIT Repository
    1. Navigate to the directory you want to be the repository
        ex. ~/git/priyaandarun
    2. Use command:
        git init

B. Select files that you want to modify/add
    1. git add FILENAME

C. Committing changes to repository
    1. git commit -m "Description of changes"

D. Update Git Hub with your changes
    1. git push -u [REPOSITORY] [BRANCH ON GITHUB]
        ex. git push -u priyaandarun master

E. Create New Branches
    1. git checkout -b [NEW BRANCH NAME]
        ex. git checkout -b Working
    NOTE: The default branch is called 'master'

F. Switch Branches
    1. git checkout [BRANCH]
        ex. git checkout Working
        ex. git checkout master

G. Save Changes without Committing
    1. git stash        // saves changes and reverts
    2. git stash pop    // brings back last stashed changes
    3. git stash drop   // discards stashed changes
    4. git stash list   // lists all stashes

7. See changes
    1. git log          // Shows who made changes
    2. git reflog       // Shorter change list

8. Change to a specific changelist #
    1. git reset [CHANGELIST#]  // revert all files back to previous state
    2. git checkout [FILENAME]  // revert specific file to latest

9. Git color
    1. git config color.ui true

10. Merging
    1. git mergetool



Thursday, June 20, 2013

Tasker Guide To A True Smart Phone

Are there certain things things that you do on your phone on a weekly, daily or sometimes even hourly basis? Have you ever thought about having your phone do that automatically like a true smart phone. Well if you have an Android device then you're in luck, because there is an app for that. That app is Tasker. Currently it costs $3.99 CAD in the Google Play Store and it is worth every penny.

In this guide I have linked to a really exceptional video tutorial series for beginners with Tasker then I've presented some really useful examples of Tasker Profiles that I use on a daily basis on my Samsung Galaxy S3. 

For those of you who don't know what Tasker is, Tasker allows you to completely automate your phone. For example, in the mornings I get to work at different times from day to day and I usually text my girlfriend "At work" when I get there so she knows not to call or that I will not respond right away. With tasker, now when I get to work, my phone automatically sends that text for me. Another example is using Tasker to control your phone's Wifi. Leaving Wifi on all day does drain your battery because it is constantly looking for an access point. For me, I am only around Wifi when I am home. Before discovering Tasker, every time I left my house I would have to turn off Wifi and whenever I come home I would have to manually turn it on. With Tasker, now once I leave my house, my Wifi is shut off and when I return it is automatically turned back on. Of course I still have the control to turn it on anywhere at other places. 

============================
Video Tutorials
============================

For those of you who are new to Tasker or even trying to get some ideas on some cool profiles, then I definitely recommend you watch Armando Ferreira's video tutorials on Tasker. They are exceptionally done and possibly the best videos done on this amazing app.

Beginners Guide to Android Tasker | Part 1 of 3

Beginners Guide to Android Tasker | Part 2 of 3

Beginners Guide to Android Tasker | Part 3 of 3

============================
My Profiles
============================

After watching those tutorials, I'm pretty sure you have a firm grasp on using Tasker. If you have past programming experience then using Tasker would be a breeze and you can go off and explore. For those who don't, with some practice you too can become proficient in this app. 

---------------------------------------------------------
Wave To Answer (Samsung Galaxy S3)
---------------------------------------------------------
Have you seen the commercials for the new Samsung Galaxy S4 and it's cool Wave To Answer Feature? Would you like that feature on your non-S4 phone? Well with Tasker you can. This theoretically will work on any phone that has a proximity sensor, but the only phone I've tried it on is the Samsung Galaxy S3 and I can confirm it works.

For this you will need to set up 2 Profiles:

First Profile - Wave To Answer
  1. On the Profiles tab, click the + sign in the bottom right corner to create a new Profile and select State -> Sensor -> Proximity Sensor and then click back.
  2. It will ask you to create a New Task, click New Task +. You do not have to name it if you do not want to. You can click the check mark to continue. 
  3. On the Action Edit screen, click the + to add a new action and choose Phone -> Take Call
  4. Click on the + to add another action and choose Task -> Wait and set it to wait 2 Seconds.
  5. Click on the + to add another action and choose Audio -> Speakerphone and set it to On.

    Now as it is whenever your Proximity Sensor senses something it will try to answer a call, but most of the time there will not be any call, so we need to modify the Profile's conditions. 
  6. Click back to go back to the main Tasker Profiles tab. 
  7. Hold your finger down on the Proximity Sensor state that we created and a new menu should appear. Click Add +
  8. Click State -> Phone -> Call and select Incoming and do not put a specific number. 
  9. Repeat steps 6 and 7 again then click State -> Sensor -> Orientation and choose Is Face Up. 
  10. Click and hold over the Profile's name at the top an A should appear. Click that to rename the Profile to whatever you like. I named it "Wave To Answer"
  11. Turn that profile on and click back to quit Tasker and the profile should now be active. Whenever you get a call, just wave your hand over the sensor (on the Galaxy S3 it is at the top beside the call speaker and the camera on the front face) and it should answer and turn speaker on. 
I found that when I leave this profile on, after about an hour or so my phone really starts to heat up. My guess is it's the proximity sensor. So I created a second Profile to combat this.

Second Profile - Wave To Answer Activator

  1. Create a new profile by clicking the + sign in the bottom right corner and choose State -> Phone -> Call and choose incoming. 
  2. Create a new task (no need to name it). Click the + and choose Tasker -> Profile Status. For Name you can click the magnify glass to see all the Profiles you have created and choose the first one you created, mine was call Wave To Answer. Choose Set On and then click back.
  3. Now on the Profiles page, hold your finger over the Profile Status... task that we just created and it should give you the option to Add Exit Task, click that.
  4. Click the + to add an action and choose Tasker -> Profile Status. Select the same profile you did in Step 2 and this time choose Set Off. 
  5. Back on the main Profiles page, click on the profile you selected in Step 2 (the profile we created in the first part) to expand it and press and hold on the tasks and select Add Exit Task.
  6. Click the + to add an action and choose Tasker -> Profile Status. Select the profile you selected in Step 2 and choose Set Off.
  7. Now turn off the profile we created in the first part (Wave To Answer) and leave this new profile (Wave To Answer Activator) on. 
Now the proximity sensor will only turn on when there actually is a phone call. Previously it was always on and checking for activity along with waiting for a phone call. 
































Wednesday, June 19, 2013

Rooting Wind Samsung Galaxy S3 (SGH-T999V)

Here is a quick tutorial on how to Root your Wind Mobile Samsung Galaxy S3 (SGH-T999V). At the end of these steps, you will end up with a completely stock OS (Ice Cream Sandwich 4.0.4 or JellyBean 4.1.1), but with root capabilities. The whole process after downloading the necessary files should take about 15 minutes or less to do. From my experience, you will not lose any of your data or apps, but it is recommended that you backup your data before following this guide.

At the time of writing this, no Rom for JellyBean 2 (4.2.2) is available for a Wind Mobile Galaxy S3.

1. DISCLAIMER
 CAUTION: PERFORM THE FOLLOWING STEPS AT YOUR OWN RISK. ANY ERRORS ALONG THE WAY CAN RESULT IN YOUR PHONE GOING INTO A 'BRICK' (NON USABLE) STATE. ROOTING YOUR PHONE WILL VOID YOUR WARRANTY.

2. DEFINITIONS

ROOTING - To give Super User access. Allows you to modify system files. A common example is most work computers that run Windows disable you from doing a lot of stuff like installing new programs or even changing the desktop background because you are just a local user, but if you log in as System Administrator, you get a lot more access. Rooting would be giving you System Administrator access for example. 

ROM - The Operating System your phone will run. In this tutorial we will be using a Stock Rom (Samsung released OS) modified with Root capabilities. 

ROM IMAGE - Without being technical it is the Rom in a form that can be installed. 

FLASHING - Installing a Rom. Parts of the OS (boot loader, cache, etc.) are installed on a system partition that cannot be written to while an OS is running. This will have to be done while the phone is in recovery/download mode and will completely change the OS.

3. REQUIREMENTS

  1. PHONE - Samsung Galaxy S3 Model: SGH-T999V provided by Wind Mobile (Non-LTE, HPSA+ version of S3). You can confirm your version from the Settings -> About Device -> Model Number
  2. ODIN - Software to Flash the Rom onto your phone. You can download Odin 3.07 here [1.2 MB]
  3. DRIVERS - You need to download the USB drivers for your phone in order for Odin to recognize when the phone is plugged into the computer. You can download them directly from Samsung's website here [11 MB to 14 MB] or just go to http://www.samsung.ca and Support -> Mobile Phone and Select 1. Mobile Phone 2. Smart Phone 3. SGH-T999V then click on Downloads and then click on Software. If you still experience trouble with Odin detecting your phone, then you can select Samsung Galaxy S3 as your phone and download the entire Kies program and install it (it will install the drivers for it) [65 MB].
  4. ROM IMAGE - Download the one you prefer:
    December 2012 - 4.1.1 JellyBean
    Note: This is based off of the stock image GLW T999VVLDLL1
    Perm Mirror: root66_GLW_T999VVLDLL1.7z [570 MB]

    August 2012 - 4.0.4 ICS
    Note: This is based off of WIND T999VVLALH2
    Perm Mirror: root66_GLW_T999VVLALH2.7z [571.2 MB]
  5. USB CABLE - It is recommended that you use the USB cable that came with the phone. There are people that report having the installation gone wrong because of the USB cable. 
  6. WINRAR - Needed to extract the .md5 from the Rom download in Step 4. You can download from http://rarlab.com
  7. Phone must be at least 50% battery life to continue. 
4. BACKUP
At this point it is recommended that you backup your phone. I used Kies, but I found that it took a really long time, over an hour.

5. INSTALLATION
  1. Extract the *.md5 file from the .7z file you downloaded using WinRAR (or any other compatible unzipping program). 
  2. Put the phone in Download Mode. In order to do this Power Off your phone, then hold the Volume Down Key + Power Key + Home Key simultaneously until a disclaimer comes up asking if you want to put the phone in Download Mode. Press the Volume Up key to accept. Here it will show you the Rom Counter (how many times your phone was flashed after it left the factory). It must be 0 to not void your warranty, but this Root66 method is supposed to not increment this counter.
  3. Connect USB to computer and wait for your phone to be detected on the computer. In Windows your computer should make a sound. 
  4. Once your phone is connected, open Odin. In Windows right click on Odin and click Run As Administrator to open. The top left square should say ID: COM and then have a number, if it doesn't then it doesn't detect your phone (either because of bad/wrong drivers, usb cable, etc.). If it has a number then we can continue. 
  5. In Odin, click on PDA and load the .md5 you extracted earlier. 
  6. In Odin, make sure the only 2 Options checked are Auto Reboot and F. Reset Time
  7. Click Start and wait. It should complete in about 15 minutes and your phone will be restarted automatically into the OS. 
That's it, now you have a Rooted phone. You can install a different Rom now if you want, but I find it very hard to find Roms that are confirmed to work on SGH-T999V. If you download and install a Rom that ends up bricking your phone, then you can just follow these steps again to reinstall this Rom that you know works and you should be fine. 

For download files for Mobilicity, Videotron and T-Mobile, you can follow this guide here.




Wednesday, February 8, 2012

How to Hide a .rar File in a JPEG Image File (Using DOS)

The following are instructions on how to hide a .rar file in an image file. This will allow you to display an image on your website, or have an image file on your computer, that when renamed from a jpeg file to a *.rar file, it will be a usable .rar archive.

To do this:

1. Create the .rar archive you want to hide in the jpeg.

2. Locate the jpeg file you want to hide your .rar archive in and ensure that it is located in the same directory as your archive.

3. Open up a Command Prompt session by clicking Start -> Run and typing "cmd".

4. In the DOS window, navigate to your directory containing your archive and jpeg file using the 'cd' command.

5. Type the command:
copy /b input.jpg + input.rar output.jpg
Where you replace input.jpg with the name of the jpeg you want to hide the archive in, input.rar with the name of your .rar archive file, and output.jpg is the desired name of the compined jpeg and .rar file.

When you open the file, you will see the image (originally your jpeg image), but if you open the file with WinRAR or rename the extension to .rar and open it with WinRAR, you will be able to view the files in the archive.

Friday, September 24, 2010

Fresh Install Of Windows 7: Applications Installed + Modifications

Here's a list of Applications I install after doing a fresh install of Windows 7 and some Modifications I make to improve my usage of the OS.

# Applications I Install #####################

- Adobe Flash Player 10 ActiveX
Eventually some site, like youtube will ask you to install this
and provide a link for it.
Got from getvolery.com (ninite.com)
- Adobe Reader 9.1
Used to read PDF files.
Got from getvolery.com (ninite.com)
- CutePDF Writer 2.8
Used to write PDF files by adding a virtual printer to computer.
Got from getvolery.com (ninite.com)
- Microsfot Office Professional Plus 2010
- Microsoft Security Essentials
Free Antivirus software from Microsoft for machines with legally
actived versions of Windows.
Got from getvolery.com (ninite.com)
- Notepad++
Got from getvolery.com (ninite.com)
- Pidgin
Got from getvolery.com (ninite.com)
- VirtuaWin v4.3
Small simple, low resource tool that allows for multiple desktops.
It's free.
- VLC Media Player 1.1.4
Got from getvolery.com (ninite.com)
- WinRAR archiver
Got from getvolery.com (ninite.com)
- uTorrent
Got from getvolery.com (ninite.com)
- ASUS ATK Hot Key
Required for my ASUS laptop to get the special function keys to
work (Fn + ...). Got it from my ASUS DVD that came with laptop.

# Downloading From Ninite #####################

www.ninite.com (or www.getvolery.com) is a great site that allows you to download and install multiple programs with one installer without having to go through the hassle of running seperate installs. The installer is actually so basic that it doesn't ask you any questions at all (not even where to install), it just installs everything.

All programs are installed under:
C:\Program Files\...
or
C:\Program Files (x86)\... on a 64-bit version of Windows 7.

For a full list of available applications, visit www.nanite.com

# Programs I Pin To The Start Menu ############

- Calculator
- Paint
- Notepad
- Microsoft Word
- Pidgin
- Notepad++
- Sticky Notes (comes with Windows)

# Programs I Pin To The Task Bar ##############

- Internet Explorer
- Windows Explorer
- Notepad

# System Modifications I Make #################

Tools -> Folder Options -> View
1) Check 'Always show icons, never thumbnails'
2) Under 'Hidden files and folders', select 'Show hidden files, folders, or drives'
3) Uncheck 'Hide extensions for known file types'

Modify Power Options
- Change Power Button to Hibernate instead of Turn Off
- Make sure Sleep button is set to Sleep

Start Menu Properties
- Changed Look of Start Menu to not show 'Large icons'.
- Changed Control Panel to show as a list rather than be a link.
- Added Administrative tools to Start Menu to show as a list.

Internet Explorer
- Changed homepage
- Change search tool
- Change each tabs to appear in start menu preview

Automatic Updates
- Set to ask to download and install whenever important updates are
available. This way it doesn't download and install what you don't want.

Tuesday, September 21, 2010

Everything You Need To Know About GRUB 2

Here's a link to a thread that has all the information about GRUB 2, including how to re-install and uninstall.

http://ubuntuforums.org/showthread.php?t=1195275

Tuesday, August 31, 2010

Creating Virtual Drives In Windows



This is a quick guide on how to create a Virtual Hard Drive in Windows that points to a folder somewhere within the filesystem. This could be a folder on a local hard disk, CD/DVD or USB drive as long as it is accessible.

1) Start Menu -> Run and type in "cmd" to launch Command Prompt

2) Now you can run the following commands (replace what is in []):

To Create A Virtual Drive
Command: subst [DRIVE LETTER]: "[FOLDER PATH]"
Example: subst x: "D:\temp"

To List All Virtual Drives
Command: subst

Delete A Virtual Drive
Command: subst [DRIVE LETTER]: /D
Example: subst x: /D


Upon successful execution of these commands, no argument will be returned. When you go to My Computer you should see your virtual drive. The virtual drive will not appear if you restart your computer. You will be required to redo the commands.

To Make A Virtual Drive Permanent, then refer to the steps 3 to 6 in this guide on how to do that:
http://www.ehow.com/how_2136865_virtual-drive.html