Blogs

Git ignore file mode permission changes (chmod)

So I came across this problem on Dropbox, but I am sure people will experience it elsewhere.

While working with a developer in India, I turned a dropbox folder into a github repo (by running git init) so I could easily diff changes done overnight. I did experience one problem though that came up randomly. One day I woke up to a bunch of modified files that apparently had no differences. When I diffed one, I got the following:

diff --git a/assets/js/jquery-ui-1.8.11.custom/development-bundle/themes/base/jq
old mode 100644
new mode 100755

Getting Started and Setting up a Micro Instance AWS (Amazon Web Services) Free Usage Tier

Here is a brief introduction to Amazon's new Free Usage Tier.

This is what you get for free with EC2:
* 750 hours of Amazon EC2 running Linux/Unix Micro Instance usage (613 MB of memory and 32-bit and 64-bit platform support) - enough hours to run steady state each month
* 750 hours of Elastic Load Balancing plus 15 GB data processing
* 10 GB of Amazon Elastic Block Storage (EBS) plus 1 million IOs, 1 GB snapshot storage, 10,000 snapshot Get Requests and 1,000 snapshot Put Requests
* 15 GB of bandwidth in and 15 GB of bandwidth out aggregated across all AWS services

Git / GitHub Commands

If you already pushed a commit to github and want to roll it back:

For the last commit:
git rebase -i HEAD~2

Delete the line of the commit you want to remove (If you are in VIM, 'dd' then ':wq')

git push origin +master

This should also do it in 1 command (have not tried it):
git push -f origin HEAD^:master

http://stackoverflow.com/questions/448919/how-can-i-remove-a-commit-on-g...

If you want to delete a tag on github:

git push origin :TAGNAME

e.g.
git push origin :1.0M1
To git@github.com:mystuff/myproject.git
- [deleted] 1.0M1

IntelliJ and Eclipse Keyboard Shortcuts

IntelliJ, Eclipse, Textmate

Open Implementation: Command+Alt+b
Open Resource: Command+Shift+n, Command+Shift+r, Command+T
Delete Line: Command+y, Command+d, Control+Shift+k
Update Resources: fn+command+f10,
Adjust Text Size: Command+Scroll,
Assign to New Local Variable: Command+Alt+V, Command+1
Show Parameter Info: Command+P

Find Out What Program is Using a Specific Port - Netstat Can not obtain ownership information

So I ran into a problem with my computer where I was trying to set up a Tomcat server to run on port 8081. Every time I started the server, I experienced an error saying that the port was already in use. Since I didn't have any other applications open, I became baffled so I did a little exploring.

Running netstat -a -p TCP:

TCP 0.0.0.0:8081 eng01:0 LISTENING
TCP [::]:8081 eng01:0 LISTENING

Maven Tomcat Run java.lang.ClassCastException: cannot be cast to javax.servlet.Filter

If you get an "cannot be cast to javax.servlet.Filter" exception likwhen running Tomcat from within Maven, or really from anywhere else, then you probably have an older version of the servlet-api defined in your dependencies or (most likely) have a dependency that depends on an older version of the servlet-api.

You can solve this by manually specifying which version to use in your dependency list:


javax.servlet
servlet-api
2.5
provided

My XBMC Notes

TV Headend URL:
http://localhost:9981/

Webmin URL:
http://192.168.1.135:10000/

Customizations:

Install Samba:
sudo apt-get install samba

edit /etc/samba/smb.conf
and add a share to the bottom

[xbmc]
comment = XBMC Share
path = /media
force user = YOURUSERNAME
inherit permissions = yes
read only = Yes
guest ok = Yes

If you want a share without guest access, create a samba user:
sudo smbpasswd -L -a username
sudo smbpasswd -L -e username

Run for configuration to take effect:
sudo /etc/init.d/smb restart

Install Locate:
sudo apt-get install locate

Ubuntu - Difference between apt-get upgrade and dist-upgrade

apt-get upgrade will upgrade all packages that can be upgraded without having to remove packages that are already installed or install new ones that are not already installed (as any version).

apt-get dist-upgrade will upgrade all packages and "intelligently" install newand/or remove existing ones necessary to perform upgrade.

Direct from man apt-get:

upgrade
upgrade is used to install the newest versions of all packages
currently installed on the system from the sources enumerated in

Fix for XBMC Live Linux USB Hard Drive No Longer Mounting From Firefox Install

My USB hard drives stopped automatically mounting on my XBMC Live installation. Fortunately, I found a fix as specified here:

http://forum.xbmc.org/showthread.php?t=71492

Apparently this was due to me installing Firefox which requires some Gnome components. Those Gnome apparently components caused the problem.

I ran:
sudo apt-get autoremove --purge firefox

rebooted, and the problem was fixed.

Note:

Problems Upgrading from GMaven 1.0 to Gmaven 3.0 - Gmaven Alternatives Explored: Groovy Eclipse Compiler and Ant

I have been having problems with the GMaven stub generation in 1.3. Apparently it doesn't like multi-line strings in annotations and nested arrays in annotations. GMaven 1.0 still works great, but I am ready to retire GMaven all together. Looking for alternatives, I found two Ant plugin integration and using the Groovy Eclipse Compiler.

Ant integration is documented here:
http://docs.codehaus.org/display/GROOVY/Compiling+With+Maven2

You can updated the versions, and it will run smooth, but I prefer a more integrated approach that looks promising:

Syndicate content