Skip to content

Instantly share code, notes, and snippets.

@BretFisher
BretFisher / docker-for-mac.md
Last active June 23, 2025 11:39
Getting a Shell in the Docker Desktop Mac VM

2021 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1


@matthewmueller
matthewmueller / osx-for-hackers.sh
Last active June 23, 2025 13:24
OSX for Hackers (Mavericks/Yosemite)
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
# vim:ts=4:sw=4
export PATH=/usr/local/apache2/bin:/usr/local/git/bin:/usr/local/ruby/bin:$PATH
#export PATH=/usr/local/apache2/bin:/usr/local/ruby/bin:$PATH
#export TERM=xterm-256color
export HISTSIZE=10000
export JAVA_HOME=/usr/local/jdk1.7.0_17
export PATH=$PATH:$JAVA_HOME/bin
export PATH=$PATH:/root/bin
@mbixby
mbixby / EXTNull.h
Last active December 14, 2015 17:59
EXTNull
/**
EXTNull
Experimental
EXTNull is a subclass of NSNull that acts more like nil.
Calling unrecognized methods on EXTNull *will not* throw
a NSInvalidArgumentException but again return EXTNull.
@ggerard
ggerard / Spring3_Hibernate4_Configiration.xml
Created April 26, 2012 01:18
Spring 3.1, Hibernate 4 and Jboss 7 configuration
<!--Transactions are managed by Spring. I am not sure which transaction factory should be used for 'hibernate.transaction.factory_class'. I
feel it should be org.hibernate.engine.transaction.internal.jta.JtaTransactionFactory because we get BMT with Spring. Check
https://hibernate.onjira.com/browse/HHH-7215. So far I have not seen any side effects of this configuration probably because Jboss TS
transaction related data is thread bound and both UserTransaction and TransactionManager implementations will have reference to transaction
instance with same state.Please comment if you see any side effects of this configuration-->
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource"><ref bean="dataSource" /></property>
<property name="hibernateProperties">
<value>
hibernate.dialect=org.hibernate.dialect.Oracle10gDialect