Skip to content

Instantly share code, notes, and snippets.

Make sure your VM is shut down!
1. In your virtualbox folder, find the correct disk image. If it isn't already a vdi, convert it:
`VBoxManage clonehd box-disk1.vmdk box-disk1.vdi --format vdi`
2. Enlarge the vdi file.
The number you give as an argument is in MB, or GB times 1024. In this case 250GB * 1024 MB/GB = 256000:
`VBoxManage modifyhd box-disk1.vdi --resize 256000`
3. Open VirtualBox manager and click on the New icon in the top left to create a new machine. After naming it and picking the amount of memory,
@bellerbrock
bellerbrock / Create temp user accounts
Last active May 6, 2019 20:06
Create temp user accounts en masse for workshops
#here's how I was able to create temp user accounts en masse for spb workshops. Could prove useful for future workshops:
Step1:
Manually create a dummy account through the test site's user interface. Give it username 'password_source' and the password that you want to use for all the temp user accounts.
Then, connect to the test database using psql and run:
begin;
insert into sgn_people.sp_person (first_name, last_name, username, password, private_email, user_type) (select 'test' as first_name, 'user' || i as last_name, 'testuser' || i as username, (select password from sgn_people.sp_person where username = 'password_source') as password, 'spbuser' || i || '@mailinator.com' as email, 'submitter' as user_type from generate_Series(0,50) as i);
@bellerbrock
bellerbrock / Editing trait ontology obo file in protege
Last active August 5, 2019 19:18
Editing trait ontology obo file in protege
Step 1: Download and install Protege.
Step 2: Git clone the ontology repository into local directory.
Step 3: run git checkout -c topic/your_new_topic.
Step 4: Run Protege (./run.sh on linux) and load the .obo file.
Step 5: go to File -> Preferences -> New Entities. Set Auto Generated ID to Numeric, and set Start to an id that will start filling in an unused sequence.
Step 6: Go to entities tab and add new terms by selecting parent class and clicking add subclass.
Step 7: When finished with edits, go to file -> save as and save as obo file.
Step 8: Finally add to git with git add -u, git commit -m "your message here", and git push --set-upstream topic/your_new_topic.
Step 9: Repeat with futher commits as needed, then go to github.com and submit pull request.
@bellerbrock
bellerbrock / sgn_local.conf
Created October 16, 2019 20:52
Default example of sgn_local.conf
dbhost breedbase-db
dbname breedbase
dbuser postgres
dbpass postgres
rootpath /home/production/cxgn
basepath /home/production/cxgn/sgn
composable_cvs trait,toy
composable_cvs_allowed_combinations Time Series|trait+toy
@bellerbrock
bellerbrock / new_system_config.txt
Last active October 17, 2019 20:16
New system configuration
Install Rstudio
Install Peek
Install VirtualBox
Install Android Studio
sudo apt install docker.io
sudo apt install htop
Setup .bash_aliases
@bellerbrock
bellerbrock / bash_aliases.txt
Last active October 17, 2019 20:42
Handy general aliases and for working with breedbase docker containers
#breedbase
alias log='tail -f -n 100 /var/log/sgn/error.log'
#docker commands
alias drm='docker stop $(docker ps -qa) && docker rm $(docker ps -qa) && docker image rm $(docker images) && docker volume rm $(docker volume ls)' # && docker ps -a && docker images && docker volume ls'
alias dps='docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Image}}"'
alias dpsa='docker ps -a'
alias dstart='docker start $(docker ps -qa)'
alias dstop='docker stop $(docker ps -qa)'
@bellerbrock
bellerbrock / breedbase_docker_deployment.txt
Last active October 21, 2019 01:36
Deploying breedbase via docker
#Docker deployments are now even easier and handled via docker-compose
git clone https://github.com/solgenomics/breedbase_dockerfile.git
cd breedbase_dockerfile
# For development
./prepare.sh
mkdir archive
mv sgn_local.conf.template sgn_local.conf # Edit default and add web_usr password
sudo docker-compose up -d
1. Download the latest schemaspy release from https://github.com/schemaspy/schemaspy
2. Check your java installation, and if not installed already install the required version of java. In this case java 8
To check:
java -version
update-alternatives --list java
To install: (from https://www.vultr.com/docs/how-to-manually-install-java-8-on-ubuntu-16-04)
@bellerbrock
bellerbrock / gist:e936e6f1595c5552c60e715c9576dfc2
Last active December 4, 2019 18:58
Trait component ontology update
# starting in the cxgn directory clone or pull the latest updates in the sgn and Chado repos
git clone https://github.com/solgenomics/sgn.git
git clone https://github.com/GMOD/Chado.git
# Load the ontology terms
# If you get a message about missing packages it may be necessary to add to Chado modules to perl5lib: export PERL5LIB=/home/production/cxgn/Chado/chado/lib:$PERL5LIB
perl Chado/chado/bin/gmod_load_cvterms.pl -H db4.sgn.cornell.edu -D sandbox_batatabase -s TIME -d Pg -r postgres -p <PASSWORD> -n cxgn_time_ontology -u -v sgn/ontology/cxgn_time.obo
@bellerbrock
bellerbrock / gist:2248f83417fb71ca712fa10025a33bee
Last active December 6, 2019 16:59
Sending confirmation emails via SMTP

Notes about confirmation email troubleshooting.

Confirmation emails sent with the local hostname go to spam, and Mail::Sendmail does seem to support SMTP auth very well. I could not get Mail::Sendmail to work with smtp.gmail.com. I also had no luck with Email::Sender::Transport::SMTP which is already a dependency, or Email::Sender::Transport::SMTPS

The best soultion I've found is Email::Send::SMTP::Gmail which works well and has bonus features like support for file attachments. To use it, install it (cpanm Email::Send::SMTP::Gmail) and make sure the gmail account being used for login has the 'allow access for less secure apps' setting turned on.

Here's a test script for proof of concept: