Monday, December 5, 2011

Speed tests

Here are some speed tests:

This is from a neighbour's open wireless (used two routers to get stronger signal) http://www.speedtest.net/result/1630296616.png

This is the new service from Acanac
http://www.speedtest.net/result/1635914795.png

Saturday, December 3, 2011

Gmail CommandLline

Syntax for emailing from gmail using command line tool (attached below):

mail -f my@gmail.com -d gmail.com -smtp smtp.gmail.com -port 587 -t my@gmail.com -sub "This is the email subject" -from my@gmail.com -cc techsupport@gmail.com +bcc -v -starttls -auth -user USERNAME -pass PASSWORD -M "My email message"

To put into windows script for easy management:

email.bat
---------------------------------------------------
@echo off

if NOT DEFINED m set m="Email test"
if NOT DEFINED sub set sub="Email test subject"

REM --------From, To and CC-----------
SET f=<FROM EMAIL ADDRESSS>
SET cc=<CC EMAIL ADDRESS>

REM ------username/pass-------
SET usr=<GMAIL USERNAME>
SET pass=<GMAIL PASSWORD

REM ------other values----------
SET p=587
SET sm=smtp.gmail.com
SET d=gmail.com
SET v=+bcc-starttls -auth 

echo Emailing To/From:%f% 
echo Subject: %sub%
echo Message: %m%
echo.
mail -f %f% -d %d% -smtp %sm% -port %p% -t %f% -sub %sub% -from %f% -cc %cc% %v% -user %usr% -pass %pass% -M %m%
pause

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

Download 231k

Thursday, December 1, 2011

How to make Git ignore files that already exist in your project

http://justaddwater.dk/2009/12/07/how-to-make-git-ignore-files-that-already-exist-in-your-project/

For a project I’m working on, I had to change some files with personal settings, and the files kept showing up with a git status.

Adding files to .gitignore that are already tracked does not work. (and it’s actually pretty well documented in the documentation). In stead, it’s possible to use this command:

git update-index --assume-unchanged [filename(s)]

From git-update-index manual page:

--assume-unchanged
--no-assume-unchanged

When these flags are specified, the object names recorded for the paths are not updated. Instead, these options set and unset the “assume unchanged” bit for the paths.

When the “assume unchanged” bit is on, git stops checking the working tree files for possible modifications, so you need to manually unset the bit to tell git when you change the working tree file. This is sometimes helpful when working with a big project on a filesystem that has very slow lstat(2) system call (e.g. cifs).

Fantastic! my system files are now ignored by git :)

It’s an incredibly useful tip for example if you have files that MUST live in the repository and that servers/editors change. In this particular project, Tomcat keeps changing two files. Furthermore I have changed the log-level from INFO to WARN which I should not commit into the repository.

git update-index --assume-unchanged lets me do exactly that.