Skip to content

Instantly share code, notes, and snippets.

View webRat's full-sized avatar

Todd Rafferty webRat

View GitHub Profile
// Things I don't want to see.
func (r *loadCmdReader) Next() (cmd loadCmd, err error) {
try(
r.offset = r.next
r.f.Seek(r.offset, 0)
binary.Read(r.f, r.order, &cmd)
)
}
// And, believe me, if I don't see the above because it's illegal or something, then we'll definitely see this:
@webRat
webRat / gist:af330f586e8c5bf5c6a0da06be0cc9aa
Created July 25, 2017 14:38
Alpine `go build -race` issues
api_1 | [00] # runtime/race
api_1 | [00] race_linux_amd64.syso: In function `__sanitizer::InternalAlloc(unsigned long, __sanitizer::SizeClassAllocatorLocalCache<__sanitizer::SizeClassAllocator32<0ul, 140737488355328ull, 0ul, __sanitizer::SizeClassMap<3ul, 4ul, 8ul, 17ul, 64ul, 14ul>, 20ul, __sanitizer::TwoLevelByteMap<32768ull, 4096ull, __sanitizer::NoOpMapUnmapCallback>, __sanitizer::NoOpMapUnmapCallback> >*, unsigned long)':
api_1 | [00] gotsan.cc:(.text+0x16e1): undefined reference to `__libc_malloc'
api_1 | [00] race_linux_amd64.syso: In function `__sanitizer::GetArgv()':
api_1 | [00] gotsan.cc:(.text+0x4543): undefined reference to `__libc_stack_end'
api_1 | [00] race_linux_amd64.syso: In function `__sanitizer::InternalRealloc(void*, unsigned long, __sanitizer::SizeClassAllocatorLocalCache<__sanitizer::SizeClassAllocator32<0ul, 140737488355328ull, 0ul, __sanitizer::SizeClassMap<3ul, 4ul, 8ul, 17ul, 64ul, 14ul>, 20ul, __sanitizer::TwoLevelByteMap<32768ull, 4096ull, __sanitizer::NoOpMapUnmapCallback>

Keybase proof

I hereby claim:

  • I am webrat on github.
  • I am webrat (https://keybase.io/webrat) on keybase.
  • I have a public key ASAW8zQoiYptRMBuC_U4_3kWbvf85oq2P5v19oCwMDEILwo

To claim this, I am signing this object:

@webRat
webRat / backup.bat
Created August 29, 2012 15:27
Windows Batch File for backing up a db
@echo off
set HOSTNAME=
set USERNAME=
SET SQLPASSWORD=
SET FILENAME=
SET BACKUPPATH=D:\Dev\SQL Server 2005 Express\datafiles\backup
SET BACKUPSQLSCRIPT=%BACKUPPATH%\dbbackup.sql
:: execute backup SQL script
sqlcmd -S %HOSTNAME% -U %USERNAME% -P %SQLPASSWORD% -i "%BACKUPSQLSCRIPT%"
::7zip the bastard
@webRat
webRat / git_commands
Created June 23, 2011 02:38
9 Common Git Commands
git init - navigate to the appropriate directory and just type that.
git add . - adds everything in that path
git commit -m 'stuff' - Commits with the message 'stuff'
git branch - views branches
git checkout -b <new branch> - Creates & switches to new branch
git checkout <branch> - switches to branch
git merge <branch> - merges that branch to the existing branch that you're already in.
git branch -d <branch> - deletes branch
git push - This assumes you already have a remote setup (like github)