bash

Analysing gigapixel images online is possible with Cytomine

Posted on

We have a collaborating project between Norway, Moldova, Armenia and Belarus in Oral Pathology. In order to view slides online we installed a software called Cytomine. This software, or multiple combined software/applications, is developed in Belgium by a cooperating team. All about Cytomine can be read here: https://cytomine.coop/ This is an open source software. It is […]

Linux

Clear the cache on Redhat 5/6/7

Posted on

On Redhat 5 and 6 we could empty the ldap cache with this command: nscd -i group and nscd -i netgroup But in Redhat 7 this doesn’t work. Instead one have to run this command: sss_cache -E here is more about sss_cache from Redhat: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/sssd-cache

bash

Downgrade to previous version: yum

Posted on

Sometime yum update just breaks everything. We experienced this, and had to go backup to previous versions. In RHEL6 and RHEL7 you can run this command:

which will give you a list of transactions ID’s. Now you just need to figure out how far you want to go back in the history, and do […]

Linux

Openstack – new volume

Posted on

I have managed to create my first server in an openstack enviroment here at university of Bergen. I can see my instance in the Dashboard: Next thing was to add a volume: Project -> Compute -> Volumes: Create Volume After creating it, I had to go to “Manage Attachments”, and in Manage Volumen Attachments, I […]

bash

Match email address

Posted on

If you have a file with several lines that contains email addresses that you like to extract, you can do that with Linux grep command: File “emails.txt”: somestreng anotherstring 342345 somename.lastname@domain.com where somename.lastname@domain.com is the string you like to extract: you can do this with: grep -EiEio ‘\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b’ emails.txt Result: somename.lastname@domain.com

Git

git-cola in Windows 7

Posted on

I have Windows 7 on my computer, but needed to run a git gui tool for our project. Searching on Google I found several, but they all were software for Linux. We have plenty of Linux Redhat servers, but no one running X window. I installed then a Xming X server (http://sourceforge.net/projects/xming/) on my Windows […]

bash

Searching in Excel files

Posted on

I had to find a specific Microsoft Spreadsheet among thousands of files on a mapped network drive O: on a Windows 7 Computer. The problem was that searching and indexing was only performed on local disk like C: and D: so I could only search for keyword in local Excel files. It is not optimal, […]

bash

Postgresql 9.1 BACKUP DUMP BASH script

Posted on

We wrote an improved postgresql dump bash script for Postgresql version 9.1. This one will save each dump file with the name: database_name_DAYNAME.sql.bz2 In this way, we would only have 7 backups at any time, because each file will be overwritten after seven days. Since our backup system (TSM) saves 7 versions of each file, […]

bash

Mysql SQL in bash one-liner

Posted on

If you just need a quick way to get some data from a mysql database in your shell (bash), you could do something like this in one line:

If you don’t like to scroll: -bash-3.2$ mysql -h your.server.edu -u db_username -pcat /path/to/your/homedir/secretpasswordfile -e “use databasename; SELECT tablename.columnname FROM tablename where id like ‘421111’ and […]