Skip to content

Instantly share code, notes, and snippets.

View kyleparisi's full-sized avatar

Kyle Parisi kyleparisi

  • Newtown, PA
View GitHub Profile
zfs set acltype=posixacl lxd
# Forcefully remove images that don't have tags
docker rmi -f $(docker images | grep "<none>" | awk '{print $3}')
# Remove dead and exited containers
docker ps --filter status=dead --filter status=exited -aq \
| xargs docker rm -v
# Remove images that have dependent children
docker image prune -a
# set /etc/hosts to 10.0.2.2 first
VBoxManage list runningvms
VBoxManage modifyvm "VM name" --natdnshostresolver1 on
find . -name "vendor" -type d -maxdepth 3 -exec vendor-prune {} \;
find . -name "node_modules" -type d -maxdepth 3 -exec node-prune {} \;
0 1 * * * [[ -e /var/run/docker.sock ]] && /usr/local/bin/docker system prune --force
0 2 * * * [[ -e /var/run/docker.sock ]] && /usr/local/bin/docker volume prune --force
@kyleparisi
kyleparisi / README.md
Last active January 2, 2018 15:01
init.d script for java jar
vi /etc/init.d/java-app
chmod +x /etc/init.d/java-app
/etc/init.d/java-app start
# reminder:
# chown -R www-data: /needed/paths
docker run --name redis -p 6379:6379 -d redis
class RenderItemWithKeyAndHandlers extends Component {
  render() {
    return this.props.renderListItem(this.props.data);
  }
}

and then

@kyleparisi
kyleparisi / decent_search.js
Last active December 6, 2017 16:25
A little search algorithm for a person's name. It looks only for sequential letters in a name.
handleChange(event) {
let value = event.target.value;
if (!value) {
this.setState({ value, data: this.props.data });
return true;
}
// Let the search be async
// The the more the data is filtered the faster it will be
@kyleparisi
kyleparisi / hubot
Last active October 5, 2017 15:11
hubot init script
#!/bin/sh
### BEGIN INIT INFO
# Provides: hubot
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the hubot service
# Description: starts the Hubot bot with slack adapter