Skip to content

Instantly share code, notes, and snippets.

View kelsS's full-sized avatar
🍵

Kelsey S. kelsS

🍵
View GitHub Profile
@kelsS
kelsS / chmod.sh
Created July 28, 2017 21:14
Docker for Windows file permissions issue. Find all files not under current user permssions and change the files to the new user. Shell script located on host OS shared drive but executed inside Linux Container.
#!/bin/bash
# the command doing the real work has an exit status here
status=$? # save it
find . -not -uid $(stat -c "%u" .) -exec chown --reference=. {} \;
exit $status # exit with the saved status value
@kelsS
kelsS / example-ssh-config.md
Last active July 20, 2017 17:11
Example ssh config file for multiple SSH keys.
# Default GitHub
Host github.com
    HostName github.com
    User git
    PreferredAuthentications publickey
    IdentityFile ~/.ssh/id_rsa

# Work GitHub
Host work.github.com
@kelsS
kelsS / multiple_ssh_setting.md
Created July 20, 2017 17:10 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@kelsS
kelsS / windows-ssh.md
Last active July 20, 2017 17:13
SSH on Windows

Kill all ssh-agents

taskkill /F /IM ssh-agent.exe /T
  • Run from Powershell

Add Git to PATH variable to use git from PS

  • From GUI
    • Open control panel
  • go to System and Security
@kelsS
kelsS / git.md
Last active July 20, 2017 15:45
Useful git commands.
@kelsS
kelsS / README.rst
Created June 19, 2017 17:17 — forked from dupuy/README.rst
Common markup for Markdown and reStructuredText

Markdown and reStructuredText

GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.

@kelsS
kelsS / jquery-snippets.md
Last active June 14, 2017 18:00
Useful jQuery snippets.
@kelsS
kelsS / docker-for-windows.md
Last active June 19, 2017 16:45
Docker info pertaining to Windows

docker container port container_name

  • Shows what port is exposed to the container

docker container inspect --format

  • Shows the IP address of the container which by default is different from the host IP
  • Using Windows shell you need to replace the single quotes with double quotes
    • i.e.
      • "{{.NetworkSettings.IPAddress}}"
  • docker container inspect --format "{{.NetworkSettings.IPAddress}}" container_name

-p or Publish flag for exposing ports

  • Publishing ports is always in HOST:CONTAINER format
@kelsS
kelsS / docker-rm.sh
Last active June 14, 2017 17:51
Shell script that deletes all docker containers and images
#!/bin/bash
# Delete all containers
docker container rm $(docker container ps -a -q)
# Delete all containers even running ones
docker container rm -f $(docker container ps -a -q)
# Delete all images
docker rmi $(docker images -q)