Skip to content

Instantly share code, notes, and snippets.

@suplo
suplo / vagrant
Created March 25, 2014 09:34
Clone vagrant box
Create a new box from your existing vm:
cd into the directory with your Vagrant file
run vagrant package This will export a box file called package.box by default
run vagrant box add foo package.box virtualbox to add package.box to your existing boxes. (Assuming you are using virtualbox and not VMWare)
run vagrant box list to verify it was added.
virsh qemu-monitor-command --hmp Stoma 'hostfwd_add ::2222-:22'
@suplo
suplo / gist:9887143
Created March 31, 2014 07:37
kvm install guest
virt-install --name centos-server1 --ram 512 --vcpus=1 --check-cpu --os-type=linux -c /home/luxurioust/CentOS-6.4-x86_64-LiveCD.iso --disk path=/opt/centos.img,device=disk,bus=ide,format=qcow2 --bridge=br0 --vnc --vncport=5901 --vnclisten=0.0.0.0
330 openssl x509 -noout -nomodule -in ssl.globalsign.com.crt
331 openssl rsa -noout -nomodule -in ssl.globalsign.com.crt
332 openssl x509 -noout -nomodulus -in ssl.globalsign.com.crt
333 openssl x509 -noout -modulus -in ssl.globalsign.com.crt
334 openssl x509 -noout -modulus -in ssl.globalsign.com.crt -dates
339 openssl x509 -noout -modulus -in ssl.globalsign.com.crt -dates
def show
@assignment = @context.assignments.active.find(params[:assignment_id])
if @context_enrollment && @context_enrollment.is_a?(ObserverEnrollment) && @context_enrollment.associated_user_id
id = @context_enrollment.associated_user_id
else
id = @current_user.try(:id)
end
@user = @context.all_students.find(params[:id]) rescue nil
if !@user
flash[:error] = t('errors.student_not_enrolled', "The specified user is not a student in this course")
rvmsudo passenger start -a 0.0.0.0 -p 80 --max-pool-size 1 --spawn-method conservative -e development --user=canvas
@suplo
suplo / gist:10696785
Created April 15, 2014 02:20
delete delayed jobs canvas lms
Delayed::Job.delete_all
@suplo
suplo / gist:10718942
Created April 15, 2014 09:54
clone postgres database
createdb -O ownername -T originaldb newdb
@suplo
suplo / gist:10955408
Created April 17, 2014 05:37
play with table span css
http://jsfiddle.net/YfgPM/
sudo sed -i".bak" -e 's/\/\/us.archive.ubuntu.com/\/\/ftp.jaist.ac.jp/g' /etc/apt/sources.list