Skip to content

Instantly share code, notes, and snippets.

View alanorth's full-sized avatar

Alan Orth alanorth

View GitHub Profile
diff --git a/arch/arm/mach-exynos/mach-px.c b/arch/arm/mach-exynos/mach-px.c
index a655490..e948195 100644
--- a/arch/arm/mach-exynos/mach-px.c
+++ b/arch/arm/mach-exynos/mach-px.c
@@ -3055,8 +3055,8 @@ static struct mpu3050_platform_data mpu3050_pdata = {
1, 0, 0,
0, 0, 1},
#elif defined(CONFIG_MACH_P2)
- .orientation = {1, 0, 0,
- 0, -1, 0,
@alanorth
alanorth / gist:5530986
Created May 7, 2013 08:02
DSpace vhost caching via mod_headers in Apache httpd
### BEGIN: cache settings ###
### Depends on mod_headers being loaded:
### sudo a2enmod headers
### sudo apache2ctl graceful
### See: http://httpd.apache.org/docs/2.2/mod/mod_headers.html
javax.mail.AuthenticationFailedException
at javax.mail.Service.connect(Service.java:306)
at javax.mail.Service.connect(Service.java:156)
at javax.mail.Service.connect(Service.java:105)
at javax.mail.Transport.send0(Transport.java:168)
at javax.mail.Transport.send(Transport.java:98)
at org.dspace.core.Email.send(Email.java:366)
at org.dspace.eperson.AccountManager.sendEmail(AccountManager.java:262)
at org.dspace.eperson.AccountManager.sendInfo(AccountManager.java:222)
at org.dspace.eperson.AccountManager.sendForgotPasswordInfo(AccountManager.java:87)
diff --git a/dspace-api/src/main/java/org/dspace/core/Email.java b/dspace-api/src/main/java/org/dspace/core/Email.java
index 540b978..7eab7f8 100644
--- a/dspace-api/src/main/java/org/dspace/core/Email.java
+++ b/dspace-api/src/main/java/org/dspace/core/Email.java
@@ -265,7 +265,7 @@ public class Email
String username = ConfigurationManager.getProperty("mail.server.username");
String password = ConfigurationManager.getProperty("mail.server.password");
- if (username != null)
+ if (username != null || username == "")
#!/usr/bin/env python2
import re
string1 = "<placemark><name>Mengstu muleta</name> <description> #males 3#females 9<point><coordinates>038.29037, 09.59430</coordinates></Point> </Placemark>"
matches = re.search(r"(<name>.*</name>)", string1)
if matches:
print "We matched: " + matches.group(1)
#!/usr/bin/env python2
import re
string1 = "<placemark><name>Mengstu muleta</name> <description> #males 3#females 9<point><coordinates>038.29037, 09.59430</coordinates></Point> </Placemark>"
matches = re.search(r"(<name>.*?</name>).*?(<coordinates>.*</coordinates>)", string1)
if matches:
print matches.group(1)
print matches.group(2)
print "Name: %s and Coord: %s" % matches.groups()
@alanorth
alanorth / input-forms.xml.diff
Created June 14, 2013 19:49
xmllint --format config/input-forms.xml
diff --git a/dspace/config/input-forms.xml b/dspace/config/input-forms.xml
index 8202d52..3544dde 100644
--- a/dspace/config/input-forms.xml
+++ b/dspace/config/input-forms.xml
@@ -1,402 +1,373 @@
<?xml version="1.0"?>
<!DOCTYPE input-forms SYSTEM "input-forms.dtd">
-
-
<input-forms>
@alanorth
alanorth / glusterfs.yml
Created August 7, 2013 08:08
Deploy gluster mounts from ansible
---
- name: Copy glusterfs-epel.repo
when: "ansible_distribution == 'CentOS'"
action: copy src=glusterfs-epel.repo dest=/etc/yum.repos.d/glusterfs-epel.repo
tags: glusterfs-client
- name: Install glusterfs-fuse
when: "ansible_distribution == 'CentOS'"
yum: name=glusterfs-fuse state=installed enablerepo=glusterfs-epel
tags: glusterfs-client
@alanorth
alanorth / mtr.txt
Created August 7, 2013 12:51
Traceroute from ILRI to mirror.angani.co
Start: Wed Aug 7 15:50:37 2013
HOST: noma Loss% Snt Last Avg Best Wrst StDev
1.|-- 172.26.23.254 0.0% 10 2.1 2.2 1.9 2.4 0.0
2.|-- 41.204.190.33 0.0% 10 11.7 7.8 0.8 23.6 6.8
3.|-- 41.215.129.181 0.0% 10 2.3 10.9 1.7 47.3 14.1
4.|-- 195.229.27.57 0.0% 10 70.3 68.1 60.6 74.2 4.7
5.|-- 195.229.0.89 0.0% 10 73.3 75.7 66.4 83.9 5.8
6.|-- ix-2-1-1-0.tcore2.mlv-mum 0.0% 10 99.1 108.1 94.7 137.5 13.2
7.|-- if-6-2.tcore1.l78-london. 0.0% 10 211.6 219.9 209.7 235.1 9.4
8.|-- if-11-2.mse1.lvx-london.a 0.0% 10 208.5 221.1 208.2 239.9 10.2
@alanorth
alanorth / tmux.conf
Created August 21, 2013 08:24
Basic ~/.tmux.conf with screen bindings.
unbind C-b
set-option -g prefix ^A
bind a send-prefix
# Bind appropriate commands similar to screen.
# lockscreen ^X x
unbind ^X
bind ^X lock-server
unbind x
bind x lock-server