This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Problem: You want to access Futon on a remote server but do not want port 5984 to listen for outside connections. | |
Solution: Tunnel through a local port using SSH. [1] | |
Example: | |
ssh -L5984:127.0.0.1:5984 ssh.example.com | |
Access: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://twistedmind.com/bundle-exec-bash-shortcut | |
bundle_commands=( rake spec rspec cucumber cap watchr rails rackup ) | |
function run_bundler_cmd () { | |
if [ -e ./Gemfile ]; then | |
echo "bundle exec $@" | |
bundle exec $@ | |
else | |
echo "$@" | |
$@ | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
execute "chown tomcat" do | |
command "chown -R #{node[:tomcat][:config][:user]} #{node[:tomcat][:config][:home]}" | |
action :nothing | |
end | |
ruby_block "delay chown tomcat" do | |
block {} | |
notifies :run, resources(:execute => "chown tomcat") | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
># java -ea:org.apache.lucene -cp /var/lib/chef/solr/solr-jetty/work/Jetty_0_0_0_0_8983_solr.war__solr__k1kf17/webapp/WEB-INF/lib/lucene-core-2.9-dev.jar org.apache.lucene.index.CheckIndex -fix /var/cache/chef/solr/data/index/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test ? affirmative : negative |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rpmdev-setuptree | |
rpmbuild --buildroot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If you want to search field one for (part of) a string: | |
awk '$1 ~ /search string/ { print $2 }' example.txt | |
If the search string should match anywhere in the line (all fields): | |
awk '/search string/ { print $2 }' example.txt | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-keygen -y -f <private key file> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
value = 5; while value > 0; value -= sleep(value); end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rack_map = { | |
<% counter = @options.size %> | |
<% @options.each do |key, value| %> | |
<% counter -= 1 %> | |
'<%= key %>' => '<%= value %>'<%= ',' unless counter == 0 %> | |
<% end %> | |
} |
OlderNewer