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
kill `ps aux | grep foo | grep -v grep | awk '{print $2}'` |
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
use Rack::Config do |env| | |
env[ActionDispatch::Cookies::TOKEN_KEY] = 'abc123' # Secret token from Rails config | |
end | |
use ActionDispatch::Session::CookieStore, key: '_myapp_session' # Session key from session store options in Rails config | |
run MyApp |
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
$ defaults write -g ApplePressAndHoldEnabled -bool false |
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
SecureRandom.base64(6).gsub(/[$=+\/]/,65.+(rand(25)).chr) |
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 -lf ~/.ssh/id_rsa.pub |
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
# Find rows containing string 'foo' in file bar.txt | |
$ sed -n '/foo/p' < bar.txt | |
# Replace occurrences of 'foo' with 'bar' in baz.txt and backup original to baz.txt.bak | |
$ sed -i.bak -e 's%foo%bar%' baz.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
# All activities with one comment or more | |
Activity.collection.find('$where' => "function() { if (this['activity_comments'] && this['activity_comments'].length > 0) return true; }") |
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
Go to Preferences > Advanced > Folder Preferences and set File Pattern to: | |
!(/\.(?!.)[^/]*|\.(tmproj|o|pyc)|/Icon\r|/svn-commit(\.[2-9])?\.tmp)$ |
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
# Using the -text option will give you the full breadth of information. | |
openssl x509 -text -in cert.pem | |
# Other options will provide more targeted sets of data. | |
# who issued the cert? | |
openssl x509 -noout -in cert.pem -issuer | |
# to whom was it issued? |
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
# rabbitmq.config | |
[ | |
{rabbit, [ | |
{tcp_listeners,[{"127.0.0.1",5672}]}, | |
{ssl_listeners, [{"127.0.0.1",5671}]}, | |
{ssl_options, [{cacertfile,"/usr/local/etc/rabbitmq/ssl/testca/cacert.pem"}, | |
{certfile,"/usr/local/etc/rabbitmq/ssl/server/cert.pem"}, | |
{keyfile,"/usr/local/etc/rabbitmq/ssl/server/key.pem"}, | |
{verify,verify_none}, | |
{fail_if_no_peer_cert,false}]} |
NewerOlder