If you like to lay out multi line preprocessor definition in macros in .props files.
<pc32_preprocessor>
WF_PC32;
WIN32;
_CRT_SECURE_NO_WARNINGS;
$(FORCED_ENVARS)
</pc32_preprocessor>
Something like that. Certain plugins like the clang plugin will cause all sorts of interesting errors because it'll pass the command line to the compiler with the CRLF.
Change line endings to Old Mac format CR only.
VS will allow you to edit and it will respect the line endings and wont convert it, and it seems to pass through to the compiler just fine.
Thursday, June 5, 2014
Integrating windows hosted SVN with hall, logs and diffs provided with WEBSVN
For posterity
SET PATH=%PATH%;E:\svn;E:\curl\bin;E:\bin
SET REPOS="%1"
SET REV=%2
SET HALLROOM=put Group API Token here
SET WEBSVNHOST=https://YOUR_URL_HERE/revision.php?repname=REPONAME
SET PATHTOMATCH=trunk
REM HALL INTEGRATION
svnlook author %REPOS% --revision %REV%> E:\temp\svnlook%REV%_USER
SET /P SVN_USERNAME=<E:\temp\svnlook%REV%_USER
del E:\temp\svnlook%REV%_USER
svnlook log %REPOS% --revision %REV%> E:\temp\svnlook%REV%_LOG
SET /P SVN_COMMIT_MESSAGE=<E:\temp\svnlook%REV%_LOG
del E:\temp\svnlook%REV%_LOG
svnlook dirs-changed %REPOS% --revision %REV%> E:\temp\svnlook%REV%_CHANGED
SET /P SVN_COMMIT_DIRECTORY=<E:\temp\svnlook%REV%_CHANGED
SET SVNMESSAGE=Revision : %REV% - %SVN_USERNAME% - %SVN_COMMIT_MESSAGE%
grep -E "%PATHTOMATCH%" E:\temp\svnlook%REV%_CHANGED
if "%ERRORLEVEL%"=="0" curl -X POST -H "Content-Type: application/json" -d "{\"title\":\"SVN Commit\",\"message\":\"%SVNMESSAGE%^<br^> ^<a href="%WEBSVNHOST%&path=%%2F&rev=%REV%"^>Inspect Log^</a^>\"}" https://hall.com/api/1/services/generic/%HALLROOM%
del E:\temp\svnlook%REV%_CHANGED
Wednesday, May 1, 2013
Reset WINS cache on a QNAP device
Disable WINS server from web administration page
SSH into it
cd /var/log/samba/locks
delete wins.dat
Enable WINS server from web administration page
Done.
SSH into it
cd /var/log/samba/locks
delete wins.dat
Enable WINS server from web administration page
Done.
Wednesday, October 17, 2012
VSPTree is alive!
I've been using Windows 8 for the last couple of months and have been having a great time with it. It's Windows 7 with a nice flat UI, much faster I/O. Stability is the same, and pretty much have never opened a metro app. I'm not even sure how to use those correctly. The new Start Menu is just a very big start menu to me.
Anyway I digress, I needed to profile something and went with the usual suspects. CodeAnalyst, Got no data. AQTime, failed to launch the exe. Very Sleepy, worked but no hierarchical call graph. Tried to resurrect VSPTree with the VS2010 profiler and I got a driver not allowed error.
Oh well. Some digging around and I found Remote Tools for Visual Studio 2012.
So I took a little time and updated VSPTree to work with it, and added some minor usability updates. It's not the best application in the world, but sometimes it's handy just to have it.
VSPTree 0.5 : Now with Windows 8 64 bit support. Here.
Anyway I digress, I needed to profile something and went with the usual suspects. CodeAnalyst, Got no data. AQTime, failed to launch the exe. Very Sleepy, worked but no hierarchical call graph. Tried to resurrect VSPTree with the VS2010 profiler and I got a driver not allowed error.
Oh well. Some digging around and I found Remote Tools for Visual Studio 2012.
So I took a little time and updated VSPTree to work with it, and added some minor usability updates. It's not the best application in the world, but sometimes it's handy just to have it.
VSPTree 0.5 : Now with Windows 8 64 bit support. Here.
Friday, October 12, 2012
Conditionals in Property Sheets
I've since moved to using property sheets exclusively instead of wfMake and it's been going well. A bit more more typing but I like the fact that I can edit a bunch of includes and not have to regenerate the vcproj/vcxproj. The most time consuming part was going through all the projects and setting the right macros everywhere. But you only have to do it once.
It's one place to update everything and can be syntax highlighted and formatted quite neatly.
You end up with something like this. This is only an excerpt, the whole thing is quite huge. You can then string your macros any way you like. The fanciest bit of this is the conditionals at the top that I use because some sln's that include these projects are sometimes in different places, and there was no other way I could think of to correctly set the path.
It's one place to update everything and can be syntax highlighted and formatted quite neatly.
You end up with something like this. This is only an excerpt, the whole thing is quite huge. You can then string your macros any way you like. The fanciest bit of this is the conditionals at the top that I use because some sln's that include these projects are sometimes in different places, and there was no other way I could think of to correctly set the path.
$(ProjectDir)..\..\..\ $(ProjectDir)..\..\..\ $(SolutionDir) WF_DEBUG; _DEBUG WF_RELEASE; NDEBUG WF_FINAL; NDEBUG WF_PC32; WIN32; _CRT_SECURE_NO_WARNINGS; $(FORCED_ENVARS) $(WF_DEBUG); $(PC32_PREPROCESSOR); __PLACEMENT_NEW_INLINE
Wednesday, March 28, 2012
Pre-commit goodness
This solution was used to solve programmers frequently accidentally committing debug executables into SVN. On developer machines you rarely see this issue because all the debug libs exist, but a level designer or artist will frequently run into the problem and will have no idea what the problem is, and someone will have to take a look at it and figure out what in the world is going on. Then the doh! moment happens and someone has to recompile and commit that.
The precommit hook also show an example of how to deny committing certain files like .argb and thumb.db
The solution is simple enough. Add a precommit hook that scans all the exe's for debug libs. This method uses Dependency Walker by Steve Miller.
So far I've tested it on rather large commits with 20 exe's and it doesn't take more than 20 - 30 seconds to complete. Server is running a i7-960 for reference.
The precommit hook also show an example of how to deny committing certain files like .argb and thumb.db
The solution is simple enough. Add a precommit hook that scans all the exe's for debug libs. This method uses Dependency Walker by Steve Miller.
So far I've tested it on rather large commits with 20 exe's and it doesn't take more than 20 - 30 seconds to complete. Server is running a i7-960 for reference.
cd /d %~dp0 SETLOCAL ENABLEDELAYEDEXPANSION SET REPOS=%1 SET TXN=%2 SET PATH=E:\svn;E:\bin;E:\depends svnlook changed %REPOS% -t %TXN% > E:\temp\svnlook%TXN% grep -E "A.+(.argb)" E:\temp\svnlook%TXN% if "%ERRORLEVEL%"=="0" ( echo Do not commit ARGB files! >&2 goto :error ) grep -E "A.+(thumbs.db)" E:\temp\svnlook%TXN% if "%ERRORLEVEL%"=="0" ( echo Do not commit thumbs.db! >&2 goto :error ) grep -P -o "(?<=\w\s\s\s).+\.exe" E:\temp\svnlook%TXN% > E:\temp\svnlook%TXN%_exegrep for /f "tokens=1 delims=¶" %%f IN (E:\temp\svnlook%TXN%_exegrep) DO ( svnlook cat %REPOS% -t %TXN% "%%f" > E:\temp\temp depends.exe /c /of:E:\temp\dep.txt E:\temp\temp grep -E "QT.+D4.DLL" E:\temp\dep.txt if "!ERRORLEVEL!"=="0" ( echo Do not commit Debug executables! %%f is in debug>&2 goto :error ) ) del E:\temp\svnlook%TXN% del E:\temp\svnlook%TXN%_exegrep exit 0 :error del E:\temp\svnlook%TXN% del E:\temp\svnlook%TXN%_exegrep exit 1
Wednesday, February 15, 2012
Saving tortoiseGit password
Took me a little while to find this, so I thought I would immortalize it here.
Apparently you need to save a file called _netrc in %USERPROFILE%
So a quick little batch file :
Apparently you need to save a file called _netrc in %USERPROFILE%
So a quick little batch file :
@echo off SET /P HOST=What is the hostname i.e github.com? SET /P USERNAME=What is your username? SET /P PASSWORD=What is your password? echo machine %HOST% login %USERNAME% password %PASSWORD% > "%USERPROFILE%\_netrc"
Thursday, February 9, 2012
Crappy documentation? Internet to the rescue
So through some amazing series of events, I broke the TeamCity installation.
Things weren't building. I thought it might be a bug, so maybe I'll try a newer version. The newer version needed an upgrade to the database so I said OK, but I made sure to back up first of course.
Lo and behold the new version did solve the old problem, but it presented a host of new ones! Basically made it unusable. Of course this was a beta build, but hey beta is the new GMC nowadays right? WRONG!
Oh well, time to uninstall and go back to the backup. Cue the 30 minutes I spend trying to figure out how in the world do I restore this backup!
The manual says :
Things weren't building. I thought it might be a bug, so maybe I'll try a newer version. The newer version needed an upgrade to the database so I said OK, but I made sure to back up first of course.
Lo and behold the new version did solve the old problem, but it presented a host of new ones! Basically made it unusable. Of course this was a beta build, but hey beta is the new GMC nowadays right? WRONG!
Oh well, time to uninstall and go back to the backup. Cue the 30 minutes I spend trying to figure out how in the world do I restore this backup!
The manual says :
Just do this!
maintainDB[cmd|sh] restore -F <TeamCity backup file name>
Error : config is not empty. Ok I'll delete that then.
maintainDB[cmd|sh] restore -F <TeamCity backup file name>
Error : config is not empty. Ok I'll delete that then.
run again
Error : system is not empty. Ok I'll empty that too!
run again.
Needs a target!
Wuh? That's the "Restoring Data from Backup to Another Database" instruction not the standard restore.
But no. It doesn't work. Ok, scrounge around a bit more....
Hallelujah.
Turns out you need to copy the database.hsqldb.properties.dist out of the config directory in your backup zip first. Give that as the -T database.hsqldb.properties.dist
And then everything gets restored. Then it gives you some instruction that says, you have to copy that file into system\buildserver.properties.
Wuh? That's the "Restoring Data from Backup to Another Database" instruction not the standard restore.
But no. It doesn't work. Ok, scrounge around a bit more....
Hallelujah.
Turns out you need to copy the database.hsqldb.properties.dist out of the config directory in your backup zip first. Give that as the -T database.hsqldb.properties.dist
And then everything gets restored. Then it gives you some instruction that says, you have to copy that file into system\buildserver.properties.
Did I? Nope. Did the restore work? Yes.
Bad documentation is bad.
Bad documentation is bad.
Tuesday, November 8, 2011
S3 and the 5GB limit!
s3cmd as of this point still does not support mutli-part uploads to break the 5GB barrier.
But http://sprightlysoft.com/S3Upload/ does!
Now the problem with that is the Etag that used to be the md5 is NOT the md5 anymore once you start using multi-part uploads. It looks like it, but it's not because it has a dash in it.
So a slight modification of s3cmd
@@ -633,7 +633,10 @@
output(u" File size: %s" % info['headers']['content-length'])
output(u" Last mod: %s" % info['headers']['last-modified'])
output(u" MIME type: %s" % info['headers']['content-type'])
- output(u" MD5 sum: %s" % info['headers']['etag'].strip('"'))
+ if info["headers"].has_key("x-amz-meta-multipart-etag"):
+ output(u" MD5 sum: %s" % info['headers']['x-amz-meta-multipart-etag'])
+ else:
+ output(u" MD5 sum: %s" % info['headers']['etag'].strip('"'))
else:
info = s3.bucket_info(uri)
output(u"%s (bucket):" % uri.uri())
and bam you're back in business with s3Upload and s3cmd
Executable version with Standalone Python 2.5 and cx_freeze : Here
But http://sprightlysoft.com/S3Upload/ does!
Now the problem with that is the Etag that used to be the md5 is NOT the md5 anymore once you start using multi-part uploads. It looks like it, but it's not because it has a dash in it.
So a slight modification of s3cmd
@@ -633,7 +633,10 @@
output(u" File size: %s" % info['headers']['content-length'])
output(u" Last mod: %s" % info['headers']['last-modified'])
output(u" MIME type: %s" % info['headers']['content-type'])
- output(u" MD5 sum: %s" % info['headers']['etag'].strip('"'))
+ if info["headers"].has_key("x-amz-meta-multipart-etag"):
+ output(u" MD5 sum: %s" % info['headers']['x-amz-meta-multipart-etag'])
+ else:
+ output(u" MD5 sum: %s" % info['headers']['etag'].strip('"'))
else:
info = s3.bucket_info(uri)
output(u"%s (bucket):" % uri.uri())
and bam you're back in business with s3Upload and s3cmd
Executable version with Standalone Python 2.5 and cx_freeze : Here
Tuesday, November 1, 2011
Subscribe to:
Posts (Atom)
