Skip to content

Instantly share code, notes, and snippets.

View deoren's full-sized avatar
💭
I may be slow to respond.

Deoren Moor deoren

💭
I may be slow to respond.
View GitHub Profile
@darkn3rd
darkn3rd / docker_wordpress.yml
Created September 14, 2018 01:11
Docker WordPress Playbook
---
- hosts: localhost
gather_facts: no
vars:
docker_volume: db_data
docker_network: ansible_net
db_name: db
wp_name: wordpress
wp_host_port: 8000
wp_container_port: 80
@darkn3rd
darkn3rd / docker_wordpress.sh
Created September 14, 2018 01:00
Docker WordPress
# create the network if network does not exist
docker network list | grep -q "wordpress_net" || \
docker network create "wordpress_net"
# create volumes
docker volume create -d local --name "db_data"
# start mysql database
docker run -d \
-v db_data:/var/lib/mysql:rw \
@berndbausch
berndbausch / LXD-cheat-sheet.md
Last active September 3, 2024 17:13
LXD cheat sheet

Useful LXD commands

Summarized from https://stgraber.org/2016/03/19/lxd-2-0-your-first-lxd-container-312/.

Interestingly, the LXD command line client is named.... lxc!

List available containers

lxc image list ubuntu:        # ubuntu: is officially supported image source
lxc image list images:        # images: is an unsupported source
lxc image alias list images:  # lists user-friendly names
@deoren
deoren / gist_first_comment.md
Created January 24, 2018 00:18
Standard Gist "first comment"

This is intended for copying/pasting as the first comment to all Gist entries I create. It's unfortunate that GitHub doesn't support notifying creators and participants in the feedback process for Gists, but this is at least something I can do to let potential viewers know that I'm not intentionally ignoring them.

As of the time this Gist entry was created, GitHub does not support notifications for comments for mentions to Gist entries (see isaacs/github#21 for details). Please contact me via Twitter or file an issue in the deoren/leave-feedback repo (created for that very purpose) if you wish to receive a response for your feedback. Thank you in advance!

@posener
posener / go-shebang-story.md
Last active August 5, 2024 13:00
Story: Writing Scripts with Go

Story: Writing Scripts with Go

This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.

Why Go is good for scripting?

While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.

@jeanlouisferey
jeanlouisferey / LXD_SSH_KEY.md
Last active August 26, 2024 23:53
How to create a LXD Container with your ssh key in it (and with ssh server in the container)
@rgl
rgl / wait_for_http_200.sh
Last active September 23, 2024 14:25
Wait for an HTTP endpoint to return 200 OK with Bash and curl
bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9000)" != "200" ]]; do sleep 5; done'
# also check https://gist.github.com/rgl/c2ba64b7e2a5a04d1eb65983995dce76
@bgromov
bgromov / git-reset-author.sh
Created June 23, 2016 17:50
Git: reset author for ALL commits
#!/bin/sh
# Credits: http://stackoverflow.com/a/750191
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='Newname'
GIT_AUTHOR_EMAIL='new@email'
GIT_COMMITTER_NAME='Newname'
GIT_COMMITTER_EMAIL='new@email'
" HEAD
@alces
alces / ansible_ad_hoc_inventories.md
Last active September 2, 2022 07:17
Using Ad-hoc Inventories in Ansible

In case you want to run ansible (or ansible-playbook) command against a set of hosts that makes sense only for one run, you can don't bother to create one-time inventory file, but simply define a comma-separated list of hosts as argument of --invertory option (or its short form that's simply -i) as follows:

ansible --inventory=myhost1,myhost2,myhost3 all -m setup -a 'filter=*name*'

(note that all in this command line stands for the target hostname)

If you have only one host to run your playbook against, your inventory string must ends with ,