curl -L http://install.perlbrew.pl | bash
mkdir /opt/perlbrew
export PERLBREW_ROOT=/opt/perlbrew
export PERLBREW_HOME=/opt/perlbrew
perlbrew init # and follow the directions
#!/usr/bin/expect -f | |
# device | |
set modem /dev/ttyUSB0 | |
# keep it open | |
exec sh -c "sleep 3 < $modem" & | |
# serial port parameters | |
exec stty -F $modem 9600 raw -clocal -echo -istrip -hup |
# 假设新建一个叫 core1 的 core | |
mkdir -p /path/to/core1/data | |
cd /path/to/project | |
cp -r `bundle show sunspot_solr`/solr/solr/conf /path/to/core1 | |
bundle exec rake sunspot:solr:start |
#!/usr/bin/python | |
import time, signal, sys | |
from Adafruit_ADS1x15 import ADS1x15 | |
def signal_handler(signal, frame): | |
print 'You pressed Ctrl+C!' | |
sys.exit(0) | |
signal.signal(signal.SIGINT, signal_handler) | |
#print 'Press Ctrl+C to exit' |
# if you want to monkey patch every controller, put this in initializers/active_admin.rb | |
ActiveAdmin::ResourceController.class_eval do | |
include ActiveAdmin::CSVStream | |
end |
class CustomMarkdown < Middleman::Extension | |
$markdown_options = { | |
autolink: true, | |
fenced_code_blocks: true, | |
no_intra_emphasis: true, | |
strikethrough: true, | |
tables: true, | |
hard_wrap: true, | |
with_toc_data: true | |
} |
if ::ActiveRecord::Base.connection_config[:adapter] == 'sqlite3' | |
if c = ::ActiveRecord::Base.connection | |
# see http://www.sqlite.org/pragma.html for details | |
# Page size of the database. The page size must be a power of two between 512 and 65536 inclusive | |
c.execute 'PRAGMA main.page_size=4096;' | |
# Suggested maximum number of database disk pages that SQLite will hold in memory at once per open database file | |
c.execute 'PRAGMA main.cache_size=10000;' |
# Idempotent way to build a /etc/hosts file with Ansible using your Ansible hosts inventory for a source. | |
# Will include all hosts the playbook is run on. | |
# Inspired from http://xmeblog.blogspot.com/2013/06/ansible-dynamicaly-update-etchosts.html | |
- name: "Build hosts file" | |
lineinfile: dest=/etc/hosts regexp='.*{{ item }}$' line="{{ hostvars[item].ansible_default_ipv4.address }} {{item}}" state=present | |
when: hostvars[item].ansible_default_ipv4.address is defined | |
with_items: groups['all'] |
I hereby claim:
To claim this, I am signing this object:
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |