Tag (people use this functionality to mark release points)
git tag -- Listing Your Tags
git tag -l ’v1.4.2.*’ -- wildcard Tag listing
git tag v1.4 -- Creates Lightweight Tag
git tag -a v1.4 -m ’my version 1.4’ -- Creates Annotated Tag
git tag -s v1.5 -m ’my signed 1.5 tag’ -- sign your tags with GPG, assuming you have a private key.
git show v1.4 -- Shows the last commit of a Tag
git tag -a v1.2 9fceb02 -- Tagging later (if you forgot to Tag a release point)
git push origin v1.2 -- Sharing Tags (pushing to remote origin)
git push origin --tags -- Transfer all of your tags to the remote server that are not already there
git tag -d v1.2 -- Delete a Tag
git checkout -b v1.4-fixes v1.4 -- Creates a branch(v1.4-fixes) from Tag(v1.4)
git diff v1.1 v1.2 --stat -- Shows no of files changed between two tags
git log --pretty=oneline v1.1..v1.2 -- Shows no of commits between two tags
Tuesday, November 27, 2012
Monday, September 13, 2010
Desktop to Mobile site switching Apache config
Recently i have come across a situation to write Apache config for Desktop to Mobile site switch and vice-versa.
Below are the Constraints,
In your Web version site Vhost file:
RewriteCond %{REQUEST_URI} ^/switch_to_mobile
RewriteRule ^/switch_to_mobile$ - [co=version:mobile:.domain.com]
RewriteCond %{HTTP_REFERER} http:\/\/www.domain.com\/(.*)
RewriteRule ^/switch_to_mobile$ http://mobile.domain.com/%1 [R=302,L]
RewriteCond %{HTTP_COOKIE} version=mobile [NC]
RewriteRule ^(.+)$ http://mobile.domain.com$1 [L,R=302]
RewriteCond %{HTTP_USER_AGENT} BlackBerry
RewriteCond %{HTTP_COOKIE} !version=web
RewriteRule ^(.+)$ http://mobile.domain.com/$1 [R=302,L]
In your Mobile version site Vhost file:
RewriteCond %{REQUEST_URI} ^/switch_to_web
RewriteRule ^/switch_to_web$ - [co=version:web:.domain.com]
RewriteCond %{HTTP_REFERER} http:\/\/mobile.domain.com\/(.*)
RewriteRule ^/change_to_web$ http://www.domain.com/%1 [L,R=302]
RewriteCond %{HTTP_COOKIE} version=web [NC]
RewriteRule ^(.+)$ http://www.domain.com$1 [L,R=302]
(or) Even simpler you may try the below config
Web version:
RewriteCond %{REQUEST_URI} ^/change_to_mobile
RewriteCond %{HTTP_REFERER} http:\/\/www.domain.com\/(.*)
RewriteRule ^/change_to_mobile$ http://mobile.domain.com/%1 [R=301,L]
RewriteCond %{HTTP_USER_AGENT} iphone|ipod|alcatel|android|midp|240x320|blackberry|dopod|htc|huwai|lg|midp|nec|netfront|nokia|panasonic|portalmmm|sharp|sie-|sony|sonyericsson|symbian|benq|mda|mot-|motorola|palm|panasonic|philips|sagem|samsung|sanyo|sharp|sda|sgh-|t-mobile|vodafone|xda|pocket\ pc|opera\ mini|windows\ ce [NC]
RewriteCond %{HTTP_COOKIE} !preference=web [NC]
RewriteRule ^(.+)$ http://mobile.domain.com$1 [R=302,L]
Mobile version:
RewriteCond %{REQUEST_URI} ^/change_to_web$
RewriteRule ^/change_to_web$ "$0" [co=preference:web:.domain.com]
RewriteCond %{HTTP_REFERER} http://mobile.domain.com/(.*)
RewriteRule ^/change_to_web$ http://www.domain.com/%1 [R=302,L]
Hope above configuration should help you Guys !!!
Below are the Constraints,
- Lets assume we have two sites, one for Desktop(web version 'www.domain.com') and another for Mobile(mobile version 'mobile.domain.com').
- If i view my site from Desktop then Desktop version should appear, similarly if i view the same site from any mobile device then it should automatically redirected to Mobile site.
- Important constraint here is, user should be allowed to change their preference from desktop to Mobile version and vice-versa by the link provided in both the sites('Mobile version','Web version'). Based on the preference set by user, proper version should appear when user Re-visits the site.
- Moreover, if user is in 'web version' under search page, from here if user clicks 'Mobile version' then in Mobile site same search page with result should appear.
In your Web version site Vhost file:
RewriteCond %{REQUEST_URI} ^/switch_to_mobile
RewriteRule ^/switch_to_mobile$ - [co=version:mobile:.domain.com]
RewriteCond %{HTTP_REFERER} http:\/\/www.domain.com\/(.*)
RewriteRule ^/switch_to_mobile$ http://mobile.domain.com/%1 [R=302,L]
RewriteCond %{HTTP_COOKIE} version=mobile [NC]
RewriteRule ^(.+)$ http://mobile.domain.com$1 [L,R=302]
RewriteCond %{HTTP_USER_AGENT} BlackBerry
RewriteCond %{HTTP_COOKIE} !version=web
RewriteRule ^(.+)$ http://mobile.domain.com/$1 [R=302,L]
In your Mobile version site Vhost file:
RewriteCond %{REQUEST_URI} ^/switch_to_web
RewriteRule ^/switch_to_web$ - [co=version:web:.domain.com]
RewriteCond %{HTTP_REFERER} http:\/\/mobile.domain.com\/(.*)
RewriteRule ^/change_to_web$ http://www.domain.com/%1 [L,R=302]
RewriteCond %{HTTP_COOKIE} version=web [NC]
RewriteRule ^(.+)$ http://www.domain.com$1 [L,R=302]
(or) Even simpler you may try the below config
Web version:
RewriteCond %{REQUEST_URI} ^/change_to_mobile
RewriteCond %{HTTP_REFERER} http:\/\/www.domain.com\/(.*)
RewriteRule ^/change_to_mobile$ http://mobile.domain.com/%1 [R=301,L]
RewriteCond %{HTTP_USER_AGENT} iphone|ipod|alcatel|android|midp|240x320|blackberry|dopod|htc|huwai|lg|midp|nec|netfront|nokia|panasonic|portalmmm|sharp|sie-|sony|sonyericsson|symbian|benq|mda|mot-|motorola|palm|panasonic|philips|sagem|samsung|sanyo|sharp|sda|sgh-|t-mobile|vodafone|xda|pocket\ pc|opera\ mini|windows\ ce [NC]
RewriteCond %{HTTP_COOKIE} !preference=web [NC]
RewriteRule ^(.+)$ http://mobile.domain.com$1 [R=302,L]
Mobile version:
RewriteCond %{REQUEST_URI} ^/change_to_web$
RewriteRule ^/change_to_web$ "$0" [co=preference:web:.domain.com]
RewriteCond %{HTTP_REFERER} http://mobile.domain.com/(.*)
RewriteRule ^/change_to_web$ http://www.domain.com/%1 [R=302,L]
Hope above configuration should help you Guys !!!
Tuesday, April 13, 2010
FIX: extconf.rb:8:in `require’: no such file to load — mkmf (LoadError)
When i try to install fastthread in my new system,
gem install -v=1.0.7 fastthread
I got the following error,
/usr/bin/ruby1.8 extconf.rb
extconf.rb:8:in `require': no such file to load -- mkmf (LoadError)
from extconf.rb:8
The solution is to install ruby1.8-dev,
Now try.
Hope it should work fine for you as well.
gem install -v=1.0.7 fastthread
I got the following error,
/usr/bin/ruby1.8 extconf.rb
extconf.rb:8:in `require': no such file to load -- mkmf (LoadError)
from extconf.rb:8
The solution is to install ruby1.8-dev,
$ sudo apt-get install ruby1.8-dev
Now try.
Hope it should work fine for you as well.
Thursday, July 3, 2008
Apache Rewrite for underscore to hyphen
I have faced an url issue in my webapplication.
I was asked to rewrite the requests for the html pages which has "_" ,
Example :
the following rule will work fine for the above scenario,
RewriteRule ^/([^_]+)_([^_]+)_([^_]+)$ /$1-$2-$3 [L,R=301] #pages with 2 underscores
RewriteRule ^/([^_]+)_([^_]+)$ /$1-$2 [L,R=301] #pages with 1 underscore
Ref: http://underscorebleach.net/jotsheet/2005/04/perl-301-redirect-script
I was asked to rewrite the requests for the html pages which has "_" ,
Example :
http://mydomain.com/test/resource_with_underscore.html
(to)
http://mydomain.com/test/resource-with-underscore.html
(to)
http://mydomain.com/test/resource-with-underscore.html
the following rule will work fine for the above scenario,
RewriteRule ^/([^_]+)_([^_]+)_([^_]+)$ /$1-$2-$3 [L,R=301] #pages with 2 underscores
RewriteRule ^/([^_]+)_([^_]+)$ /$1-$2 [L,R=301] #pages with 1 underscore
Ref: http://underscorebleach.net/jotsheet/2005/04/perl-301-redirect-script
Thursday, February 14, 2008
Search for file with a specific name in a set of files (-name)
find . -name "rc.conf" -print
This command will search in the current directory and all sub directories for a file named rc.conf.
Note: The -print option will print out the path of any file that is found with that name. In general -print wil print out the path of any file that meets the find criteria.Wednesday, January 23, 2008
Tuesday, January 8, 2008
uninitialized constant Gem::GemRunner (NameError)
I think,this error is due to upgrading your gem version.
To reproduce this issue, follow the steps below
1> whereis gem
Ex : /usr/bin/ruby/gem ...and so on..
2> delete all the listed files & directories (only gem related files..dir)
3>Once again install gem-0.9.5
4> Now ur problem get solved
To reproduce this issue, follow the steps below
1> whereis gem
Ex : /usr/bin/ruby/gem ...and so on..
2> delete all the listed files & directories (only gem related files..dir)
3>Once again install gem-0.9.5
4> Now ur problem get solved
Subscribe to:
Posts (Atom)