Skip to content

Instantly share code, notes, and snippets.

View aschereT's full-sized avatar
👨‍🚀
accepting recruitment to be an astronaut

Vincent Tan aschereT

👨‍🚀
accepting recruitment to be an astronaut
View GitHub Profile
@aschereT
aschereT / audezemaxwell.sh
Last active January 18, 2024 08:11
Audeze Maxwell: Enable Chatmix in Linux
echo 'ATTRS{idVendor}=="3329", ATTRS{idProduct}=="4b19", ENV{PULSE_PROFILE_SET}="usb-gaming-headset.conf"' | sudo tee /etc/udev/rules.d/91-pulseaudio-audeze-gamedac.rules > /dev/null
public static function varexport($expression): ?string
{
return (new \Zend\Code\Generator\ValueGenerator($expression, \Zend\Code\Generator\ValueGenerator::TYPE_ARRAY_SHORT))->setIndentation(' ')->generate();
}
#spin up a container, run your command (or sh if not provided), then kill and remove it after you exit
function dr() {
docker run --rm -dt --name `echo $1 | tr -dC '[:alpha:]'` $1 >/dev/null && docker exec -it `echo $1 | tr -dC '[:alpha:]'` ${2:-sh}; docker kill `echo $1 | tr -dC '[:alpha:]'` > /dev/null
}
@aschereT
aschereT / dockerInternalHostname.sh
Created November 20, 2019 22:14
Script that enables host.docker.internal resolution on both native Docker and Docker for Mac
nslookup host.docker.internal 2>/dev/null >/dev/null #test if host.docker.internal exists
if [ $? = 0 ]; then
# use that if available
echo "$(nslookup host.docker.internal 2>/dev/null | awk '/Address/ {print $3}') host.docker.internal" >> /etc/hosts
else
echo "$(ip route|awk '/default/ { print $3 }') host.docker.internal" >> /etc/hosts
fi
### Keybase proof
I hereby claim:
* I am ascheret on github.
* I am vincenttan (https://keybase.io/vincenttan) on keybase.
* I have a public key ASBiKyf-bQlWLlls8DgrcjHaGRtzzDuCmMdr_B5lEIZJrgo
To claim this, I am signing this object: