Skip to content

Instantly share code, notes, and snippets.

View rhiroyuki's full-sized avatar
🏠
Working from home

Ricardo Eihara rhiroyuki

🏠
Working from home
  • Brazil
View GitHub Profile
@rhiroyuki
rhiroyuki / peepcode-bright.zsh-theme
Last active March 25, 2017 05:18
Peepcode for dark terminal colors
#
# Based on Geoffrey Grosenbach's peepcode zsh theme from
# https://github.com/topfunky/zsh-simple
#
git_repo_path() {
git rev-parse --git-dir 2>/dev/null
}
git_commit_id() {
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" Load matchit.vim, but only if the user hasn't installed a newer version.
if !exists('g:loaded_matchit') && findfile('plugin/matchit.vim', &rtp) ==# ''
runtime! macros/matchit.vim
endif
" Set neovim to use truecolors
@rhiroyuki
rhiroyuki / gist:0c56c3f4466a6326fa11de11ea793526
Last active September 17, 2018 03:05
How to flash GH60/OK60 hex file into keyboard

Import/create your file in this URL. Then generate the .hex file. https://config.qmk.fm/

Flash your keyboard by pressing the buttom on the back.

To check if it is indeed in flash mode, check it by running $ lsusb it should show the name of the microcontroller in one of the items (in my case ATMEGA32U4)

$ sudo dfu-programmer erase atmega32u4

$sudo groupadd docker $sudo gpasswd -a $USER docker Either do a $newgrp docker or log out/in to activate the changes to groups. Test it $docker run hello-world

Follow the instructions to install docker-compose Better to follow through the below link since it will be more new https://docs.docker.com/compose/install/

# DOCKER
# Running docker without sudo:
sudo usermod -aG docker $USER
# You need to logout in order to apply the settings
# To get more information about each command and its parameters
# type $docker command --help
# ex: docker stop --help
https://docs.docker.com/engine/examples/running_ssh_service/#run-a-test_sshd-container
```
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y openssh-server
RUN mkdir /var/run/sshd
RUN echo 'root:screencast' | chpasswd
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
@rhiroyuki
rhiroyuki / crontabs.md
Last active November 21, 2018 14:24
crontab

*nix solution for scheduled tasks

See all cronjobs

$ crontab -l

Edit cronjobs

$ crontab -e

Remove all cronjobs

$ crontab -r

@rhiroyuki
rhiroyuki / dummy.md
Last active November 21, 2018 14:33
dd

Dog Walking

@rhiroyuki
rhiroyuki / hook-after-deploy-multiple-tasks-with-capistrano.md
Last active December 1, 2018 17:14
running more than one task after deploying with capistrano

If for some reason you want to run more than one task after deploying with capistrano. Create a task that invokes all the tasks you want:

# capistrano/tasks/after_deploy_hooks.rake

namespace :deploy do
  desc 'Deploy hooks'
  task :after_deploy_tasks do
 on roles(:app) do