Skip to content

Instantly share code, notes, and snippets.

View colorfulberry's full-sized avatar
:octocat:
love

colorfulberry colorfulberry

:octocat:
love
View GitHub Profile
@colorfulberry
colorfulberry / append.sh
Created December 5, 2020 05:00 — forked from palytoxin/append.sh
申请软件著作权时,源代码处理脚本
#!/bin/bash
read_dir() {
for item in $(ls $1)
do
if [ -d $1"/"$item ];then
read_dir $1"/"$item
else
file=$1"/"$item
suffix=${file##*.}
首先我们来生成公钥文件。Terminal下面输入
ssh-keygen -t rsa
之后在Terminal的提示里按回车。直到生成id_rsa.pub文件,生成的id_rsa.pub文件在 ~/.ssh下面。Terminal下面输入
cd ~/.ssh
cp id_rsa.pub authorized_keys
上面第一句的意思是进入~/.ssh文件夹,第二句是复制id_rsa.pub为authorized_keys文件。
@colorfulberry
colorfulberry / gist:ca88ba676fc236cb1d69
Last active April 1, 2016 02:31
complex form how to deal
#in model user.rb
class User < ActiveRecord::Base
has_one :addresses
end
#in model address.rb
class Address < ActiveRecod::Base
blongs_to :user
end
#in controller users_controller.rb