Send email asynchroniously using Sidekiq.
Create your mailer us usual:
alias dcp='docker-compose -f /opt/docker-compose.yml ' | |
alias dcpull='docker-compose -f /opt/docker-compose.yml pull --parallel' | |
alias dcplogs='docker-compose -f /opt/docker-compose.yml logs -tf --tail="50" ' | |
alias df='df -h -x aufs -x tmpfs -x udev' | |
alias editle='sudo vi /opt/appdata/letsencrypt/nginx/site-confs/default' |
#!/bin/bash | |
# To run from shell: | |
# bash <(curl -sSL https://gist.githubusercontent.com/dmp1ce/84c31085745101f8c241/raw) | |
do_config() { | |
# Make sure to run as root | |
user="$(id -un 2>/dev/null || true)" | |
if [ "$user" != 'root' ]; then |
CRYSTAL = crystal | |
UNAME = "$(shell uname -ms)" | |
LIBRARY_PATH = $(shell brew --prefix crystal-lang)/embedded/lib | |
LIBS = -levent -lpcl -lpcre -lgc -lpthread | |
LDFLAGS = -Wl,-undefined,dynamic_lookup | |
TARGET = crystal_example_ext.bundle | |
$(TARGET): crystal_example_ext.o | |
$(CC) -bundle -L$(LIBRARY_PATH) -o $@ $^ $(LIBS) $(LDFLAGS) |
page.execute_script("$('.selectize-input input').val('ber')") | |
sleep 0.5 | |
page.execute_script("$('.selectize-input input').keyup()") | |
sleep 0.5 | |
page.execute_script("$('.full-name').mousedown()") | |
# https://github.com/brianreavis/selectize.js/blob/master/src/selectize.js |
This gist shows how you could use apartment with searchkick, including a rake task that reindex all models/tenants.
This gist is used in this blog post: http://tiagoamaro.com.br/2014/12/11/multi-tenancy-with-searchkick/
source: http://www.markbrilman.nl/2011/08/howto-convert-a-pfx-to-a-seperate-key-crt-file/ | |
`openssl pkcs12 -in [yourfile.pfx] -nocerts -out [keyfile-encrypted.key]` | |
What this command does is extract the private key from the .pfx file. Once entered you need to type in the importpassword of the .pfx file. This is the password that you used to protect your keypair when you created your .pfx file. If you cannot remember it anymore you can just throw your .pfx file away, cause you won’t be able to import it again, anywhere!. Once you entered the import password OpenSSL requests you to type in another password, twice!. This new password will protect your .key file. | |
Now let’s extract the certificate: | |
`openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [certificate.crt]` |
People
:bowtie: |
😄 :smile: |
😆 :laughing: |
---|---|---|
😊 :blush: |
😃 :smiley: |
:relaxed: |
😏 :smirk: |
😍 :heart_eyes: |
😘 :kissing_heart: |
😚 :kissing_closed_eyes: |
😳 :flushed: |
😌 :relieved: |
😆 :satisfied: |
😁 :grin: |
😉 :wink: |
😜 :stuck_out_tongue_winking_eye: |
😝 :stuck_out_tongue_closed_eyes: |
😀 :grinning: |
😗 :kissing: |
😙 :kissing_smiling_eyes: |
😛 :stuck_out_tongue: |
#!/usr/bin/env ruby | |
require 'net/ssh' | |
require 'highline/import' | |
def get_password | |
ask( "Enter Password: " ) {|q| q.echo = '*'} | |
end | |
def remote_sudo host, ssh_user, command, opts={} |
#Model | |
@user.should have(1).error_on(:username) # Checks whether there is an error in username | |
@user.errors[:username].should include("can't be blank") # check for the error message | |
#Rendering | |
response.should render_template(:index) | |
#Redirecting | |
response.should redirect_to(movies_path) |